Improve mirror links
This commit is contained in:
parent
50ef7c26f3
commit
81b6a6167c
|
@ -177,11 +177,11 @@ export function renderLink(value, row, handler, tooltip, href, middleClickHref)
|
||||||
};
|
};
|
||||||
linkElement.onmouseup = function (e) {
|
linkElement.onmouseup = function (e) {
|
||||||
// treat middle-click as regular click
|
// treat middle-click as regular click
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
if (e.which !== 2) {
|
if (e.which !== 2) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
if (!middleClickHref) {
|
if (!middleClickHref) {
|
||||||
handler(value, row);
|
handler(value, row);
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,14 @@ function handleGlobalStatusUpdate(ajaxRequest)
|
||||||
return note;
|
return note;
|
||||||
},
|
},
|
||||||
syncFromMirror: function (value, row) {
|
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();
|
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)
|
function searchRepository(value, dbInfo)
|
||||||
{
|
{
|
||||||
const form = PackageSearchPage.initSearchForm();
|
const form = PackageSearchPage.initSearchForm();
|
||||||
|
|
Loading…
Reference in New Issue