refactoring

This commit is contained in:
2026-09-02 08:38:03 +02:00
parent 649ff0d7c5
commit 38f255c1a4
48 changed files with 6998 additions and 5577 deletions
+25
View File
@@ -0,0 +1,25 @@
/* Administration overview. */
/**
* goal : Refresh the software and database versions on the admin overview.
* pre : api performs authenticated requests and translate resolves UI keys.
* post : The overview shows current and required version information.
* result : A promise that resolves after the overview has been updated.
*/
async function loadAdminOverview(api, translate) {
const info = await api("/api/admin/info");
document.getElementById("admin-software-version").textContent =
info.softwareVersion || "?";
const schemaVersion = info.databaseSchemaVersion ?? "?";
const requiredSchemaVersion = info.requiredDatabaseSchemaVersion ?? "?";
const databaseVersion = document.getElementById("admin-database-schema-version");
if (schemaVersion === requiredSchemaVersion) {
databaseVersion.textContent = String(schemaVersion);
} else {
databaseVersion.textContent =
`${schemaVersion} (${translate("required", "required")}: ${requiredSchemaVersion})`;
}
}
export { loadAdminOverview };