Improve mirror links

This commit is contained in:
Martchus 2023-05-31 23:45:06 +02:00
parent 50ef7c26f3
commit 81b6a6167c
2 changed files with 10 additions and 13 deletions

View File

@ -177,11 +177,11 @@ export function renderLink(value, row, handler, tooltip, href, middleClickHref)
};
linkElement.onmouseup = function (e) {
// treat middle-click as regular click
e.preventDefault();
e.stopPropagation();
if (e.which !== 2) {
return true;
}
e.preventDefault();
e.stopPropagation();
if (!middleClickHref) {
handler(value, row);
}

View File

@ -53,7 +53,14 @@ function handleGlobalStatusUpdate(ajaxRequest)
return note;
},
syncFromMirror: function (value, row) {
return GenericRendering.renderLink(value, row, showRepository);
const mirror = row.mainMirror;
if (mirror) {
const link = GenericRendering.renderLink(value, row, undefined, mirror, mirror);
link.target = 'blank';
return link;
} else {
return GenericRendering.renderNoneInGrey(value);
}
},
},
});
@ -231,16 +238,6 @@ function handleGlobalStatusUpdate(ajaxRequest)
BuildActionsPage.handleBuildActionPresetChange();
}
function showRepository(value, dbInfo)
{
const mirror = dbInfo.mainMirror;
if (!mirror) {
window.alert('No mirror configured for ' + dbInfo.name + '.');
} else {
window.open(mirror);
}
}
function searchRepository(value, dbInfo)
{
const form = PackageSearchPage.initSearchForm();