feat: owner review 2 phase 1: :latest, Unraid array space, Settings with About, whole-folder import (#9)
CI / Build and test (push) Successful in 5m11s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 6s
Release / Build, test and publish (push) Successful in 8m57s
CI / PostgreSQL 16 integration (push) Successful in 3m10s
CI / PostgreSQL 17 integration (push) Successful in 3m30s
CI / Docker image (push) Successful in 49s
Release / Server image (push) Successful in 1m4s
CI / Build and test (push) Successful in 5m11s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 6s
Release / Build, test and publish (push) Successful in 8m57s
CI / PostgreSQL 16 integration (push) Successful in 3m10s
CI / PostgreSQL 17 integration (push) Successful in 3m30s
CI / Docker image (push) Successful in 49s
Release / Server image (push) Successful in 1m4s
- :latest follows the highest stable release, or the highest pre-release while none is stable (Chronos.Tools release-channels); bad tags are refused before anything is built. - Unraid: CHRONOS_SPACE_PATH and the template's Array view show the array's free space; the write volume (cache) is shown apart; completions check the archive volume (507). - Settings is a gear, docked at the foot of the admin sidebar; About is the last part of Settings on the desktop and the panel. - Import > Folder > Whole folder: one sequence per format (desktop only). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #9.
This commit is contained in:
1 parent
5acdf146c7
commit
1f089888e8
320 files changed
+3030
-927
No files matched your search
@@ -1,8 +1,9 @@
|
||||
// Settings (BRIEF §14.8): server name, ports, TLS, discovery, jobs, limits, language, retention. Values fixed by environment
|
||||
// variables are read-only here; ports, TLS, chunk size and job history apply at the next restart. Jobs run one at a time
|
||||
// (owner review 1): the parallelism (photos at once) and the priority queue apply at once.
|
||||
// (owner review 1): the parallelism (photos at once) and the priority queue apply at once. About (version, API, database,
|
||||
// uptime) is the last group, read-only (owner review 2); #/about opens here on it.
|
||||
import { t, applyStrings, languages } from "../i18n.js";
|
||||
import { escapeHtml, attr, toast, errorText, nativeName, fingerprint, markInvalid, clearInvalid, invalidText, escapeReverts, PROXY_WARNING } from "../ui.js";
|
||||
import { escapeHtml, attr, toast, errorText, nativeName, fingerprint, formatDuration, markInvalid, clearInvalid, invalidText, escapeReverts, routeParams, PROXY_WARNING } from "../ui.js";
|
||||
import { kindLabel } from "../jobs.js";
|
||||
|
||||
/** Setting → environment variable that can fix it (BRIEF §14.9). */
|
||||
@@ -20,6 +21,10 @@ const MB = 1e6;
|
||||
const MIB = 1024 * 1024;
|
||||
|
||||
export async function render(root, { api, info, setMeta, actions }) {
|
||||
// Only the About group's database and uptime, filled in when the dashboard answers: the form never waits for its
|
||||
// archive statistics, and without them those rows keep a dash.
|
||||
const status = api.get("/api/v1/server/dashboard").then((d) => ({ ...d, at: Date.now() }), () => null);
|
||||
let dashboard = null;
|
||||
let settings;
|
||||
try {
|
||||
settings = await api.get("/api/v1/server/settings");
|
||||
@@ -78,7 +83,8 @@ export async function render(root, { api, info, setMeta, actions }) {
|
||||
${number("uploadRetentionHours", settings.uploadRetentionHours, 'min="1" max="8760"')}
|
||||
${number("jobHistoryDays", settings.jobHistoryDays, 'min="1" max="3650"')}
|
||||
</section>
|
||||
</form>`;
|
||||
</form>
|
||||
${about()}`;
|
||||
applyStrings(root);
|
||||
const form = root.querySelector("form");
|
||||
escapeReverts(form);
|
||||
@@ -89,6 +95,33 @@ export async function render(root, { api, info, setMeta, actions }) {
|
||||
form.elements.priorityQueue.addEventListener("change", () => { root.querySelector(".priorities").hidden = !form.elements.priorityQueue.checked; });
|
||||
}
|
||||
|
||||
/**
|
||||
* About, outside the form: nothing to save. The server name and the certificate fingerprint are left to the Server
|
||||
* and Network groups above; the uptime counts on from when it was read.
|
||||
*/
|
||||
function about() {
|
||||
const rows = [
|
||||
["Admin.About.Version", `<span class="num" dir="ltr">${escapeHtml(info?.version ?? "—")}</span>`],
|
||||
["Admin.About.Api", `<span class="num">${escapeHtml(info?.apiVersion ?? "—")}</span>`],
|
||||
["Admin.About.Database", `<span id="about-database" dir="ltr">${escapeHtml(database())}</span>`],
|
||||
["Admin.About.Uptime", `<span id="about-uptime">${escapeHtml(uptime())}</span>`],
|
||||
];
|
||||
return `
|
||||
<section class="panel about" aria-labelledby="about-title">
|
||||
<h2 id="about-title" tabindex="-1" data-i18n="Admin.Settings.About"></h2>
|
||||
<div class="brand large"><img src="favicon.svg" alt=""><strong data-i18n="Admin.About.Title"></strong></div>
|
||||
<dl>${rows.map(([key, value]) => `<dt data-i18n="${key}"></dt><dd>${value}</dd>`).join("")}</dl>
|
||||
</section>`;
|
||||
}
|
||||
|
||||
function database() {
|
||||
return dashboard?.database ?? "—";
|
||||
}
|
||||
|
||||
function uptime() {
|
||||
return dashboard ? formatDuration(dashboard.uptimeSeconds + (Date.now() - dashboard.at) / 1000) : "—";
|
||||
}
|
||||
|
||||
/** The certificate and key files are used only in Own certificate mode; elsewhere they are off and say so. */
|
||||
function pemFiles(form) {
|
||||
const pem = form.elements.tlsMode.value === "pem";
|
||||
@@ -143,6 +176,19 @@ export async function render(root, { api, info, setMeta, actions }) {
|
||||
}
|
||||
|
||||
draw();
|
||||
// Once: the route drops the group, so a later redraw (a language change) leaves the focus where it is.
|
||||
if (routeParams().get("group") === "about") {
|
||||
history.replaceState(null, "", "#/settings");
|
||||
root.querySelector(".about").scrollIntoView({ block: "start" });
|
||||
root.querySelector("#about-title").focus({ preventScroll: true });
|
||||
}
|
||||
// Only the two rows change, so the focus and the form's edits stay; a page left meanwhile is not touched.
|
||||
status.then((d) => {
|
||||
dashboard = d;
|
||||
if (!d || !root.isConnected) return;
|
||||
root.querySelector("#about-database").textContent = database();
|
||||
root.querySelector("#about-uptime").textContent = uptime();
|
||||
});
|
||||
}
|
||||
|
||||
function cap(s) {
|
||||
|
||||
Reference in new issue
Block a user