UI: das Repository wird in der Seitenüberschrift per Drop-Down gewählt
Die Link-Leiste neben dem Menü entfällt. An ihrer Stelle steht dort, wo bisher der Repository-Name stand, eine Auswahlliste der bedienten Repositories; werkator.js hängt die aktuelle Ansicht (branches, history, current) an, damit der Wechsel auf derselben Seite bleibt. Mit nur einem Repository bleibt der Name wie bisher reiner Text. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
e61adfbbaa
commit
fe11a339ad
@@ -736,12 +736,34 @@ function initReloadButton() {
|
||||
});
|
||||
}
|
||||
|
||||
// ---- repository switcher -------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Switching the repository keeps the view: an option's value is the repository root
|
||||
* (`/repos/<name>`), and the view this page shows is appended to it. A page that only
|
||||
* exists for one repository's build — an artifact index — falls back to that
|
||||
* repository's latest builds.
|
||||
*/
|
||||
function initRepoSelect() {
|
||||
const select = document.getElementById("repo-select");
|
||||
if (!select) {
|
||||
return;
|
||||
}
|
||||
const path = window.location.pathname;
|
||||
const view = repoBase && path.startsWith(repoBase) ? path.slice(repoBase.length) : path;
|
||||
const keptView = ["/branches", "/history", "/current"].includes(view) ? view : "";
|
||||
select.addEventListener("change", () => {
|
||||
window.location.href = select.value + keptView;
|
||||
});
|
||||
}
|
||||
|
||||
// ---- page wiring ---------------------------------------------------------------
|
||||
|
||||
initBuildsTable();
|
||||
initCurrentBuilds();
|
||||
initSystemTable();
|
||||
initReloadButton();
|
||||
initRepoSelect();
|
||||
// pages with a poller update the banner from their own tick; the static ones ask once
|
||||
if (!refreshNow) {
|
||||
refreshWatcherBanner();
|
||||
|
||||
Reference in New Issue
Block a user