refactor!: rename Titano to Chronos and move CI and releases to Gitea (#6)
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
The owner renamed the product and moved the repository to the self-hosted Gitea (https://gitea.encke-hake.ts.net/BalboSoft/Chronos) for more control, and asked for Actions and a first automatic release with the server package and the Windows exe (docs/requests/2026-10-23-chronos-gitea.md). - Chronos everywhere: a byte-exact rename of contents and paths, then a per-language review of the forms the old name's ending had dictated. - Gitea instead of GitHub: the update check, licence, issue and support links read ChronosReleasesUrl; the update check takes the highest stable version, offers a pre-release build its final release and reports a repository it cannot see as a failed check. EULA, security policy and Gitea issue forms live at the repository root. - Gitea Actions for the Linux act_runner (.gitea/workflows): CI, release, nightly image and performance gates in the .NET SDK container with git checkout and the system SQLite. The release cross-compiles the Windows programs, checks their icon, version and DPI manifest, packs installers and zips, publishes the Gitea release and pushes the server image (REGISTRY_TOKEN). Windows-only tests run in an opt-in job on a Windows runner (WINDOWS_RUNNER). - New Chronos.Tools commands: zip, gitea-release, postgres-ci (replaces the docker-exec script, which Gitea's service containers do not allow; the throw-away server runs without durability) and pe-check. - Timed tests take their budget from TestTiming (CHRONOS_TEST_TIME_FACTOR, 3 on the shared runner; the weekly performance gates keep theirs). BREAKING CHANGE: programs, settings, data folders, file types, environment variables and the Docker image use the new name; nothing is migrated from Titano, which never had a release. 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 #6.
This commit is contained in:
1 parent
c99842cc86
commit
f2b58522b9
1801 files changed
+11804
-10676
No files matched your search
@@ -0,0 +1,119 @@
|
||||
// Archive (BRIEF §14.8): naming templates, proxy policy, scan/rebuild/verify/maintenance, statistics.
|
||||
import { t, plural, applyStrings } from "../i18n.js";
|
||||
import { escapeHtml, attr, formatBytes, formatNumber, bar, columns, toast, errorText, emptyState, markInvalid, clearInvalid, invalidText, escapeReverts } from "../ui.js";
|
||||
|
||||
const PROXY_SIZES = [-1, 1280, 1920, 2560, 3840, 0];
|
||||
const ACTIONS = ["scan", "rebuild", "verify", "maintenance"];
|
||||
|
||||
export async function render(root, { api, setMeta }) {
|
||||
let settings;
|
||||
let stats;
|
||||
try {
|
||||
[settings, stats] = await Promise.all([api.get("/api/v1/archive/settings"), api.get("/api/v1/archive/stats")]);
|
||||
} catch (err) {
|
||||
root.innerHTML = `<div class="panel empty">${escapeHtml(errorText(err))}</div>`;
|
||||
return;
|
||||
}
|
||||
setMeta(settings.rootPath, { ltr: true });
|
||||
const used = stats.capacityBytes > 0 ? (stats.capacityBytes - stats.freeBytes) / stats.capacityBytes : 0;
|
||||
const sizes = PROXY_SIZES.includes(settings.proxyLongEdge) ? PROXY_SIZES : [settings.proxyLongEdge, ...PROXY_SIZES];
|
||||
const proxyOptions = sizes.map((size) => `<option value="${size}" ${size === settings.proxyLongEdge ? "selected" : ""}>${escapeHtml(proxyLabel(size))}</option>`).join("");
|
||||
const statsTable = (rows, labelId) => rows.length === 0 ? "" : `<div class="table compact stats" role="table" aria-labelledby="${labelId}"><div role="rowgroup">${rows.map((r) =>
|
||||
`<div class="row" role="row"><span class="ellipsis" role="cell" dir="auto">${escapeHtml(r.label)}</span><span class="num end" role="cell">${formatNumber(r.count)}</span><span class="num end" role="cell">${escapeHtml(formatBytes(r.bytes))}</span></div>`).join("")}</div></div>`;
|
||||
const scanButton = `<button class="btn small" data-action="scan" data-i18n="Admin.Archive.Scan" data-i18n-title="Admin.Archive.Scan.Tip"></button>`;
|
||||
|
||||
root.innerHTML = `
|
||||
<div class="tiles">
|
||||
<section class="panel tile" aria-labelledby="tile-sequences"><h2 class="label" id="tile-sequences" data-i18n="Admin.Archive.Sequences"></h2><span class="value num">${formatNumber(stats.sequences)}</span>
|
||||
<span class="sub">${escapeHtml(`${plural("Admin.Dashboard.PhotoCount", stats.photos)} · ${plural("Admin.Dashboard.CameraCount", stats.cameras)}`)}</span></section>
|
||||
<section class="panel tile" aria-labelledby="tile-originals"><h2 class="label" id="tile-originals" data-i18n="Admin.Archive.Originals"></h2><span class="value">${escapeHtml(formatBytes(stats.bytes))}</span>
|
||||
<span class="sub num">${escapeHtml(stats.firstYear ? `${stats.firstYear}–${stats.lastYear}` : "—")}</span></section>
|
||||
<section class="panel tile" aria-labelledby="tile-storage"><h2 class="label" id="tile-storage" data-i18n="Admin.Dashboard.Storage"></h2><span class="value">${escapeHtml(formatBytes(stats.freeBytes))}<small data-i18n="Admin.Archive.FreeShort"></small></span>
|
||||
${bar(used)}<span class="sub">${escapeHtml(t("Admin.Dashboard.Of", formatBytes(stats.capacityBytes)))}</span></section>
|
||||
<section class="panel tile" aria-labelledby="tile-health"><h2 class="label" id="tile-health" data-i18n="Admin.Archive.Health"></h2><span class="value num">${formatNumber(stats.unverifiedSequences)}<small>${escapeHtml(plural("Admin.Archive.UnverifiedUnit", stats.unverifiedSequences))}</small></span>
|
||||
<span class="sub">${escapeHtml(plural("Admin.Dashboard.WithoutProxies", stats.sequencesWithoutProxies))}</span></section>
|
||||
</div>
|
||||
<div class="grid two">
|
||||
<form class="panel form settings-form" novalidate aria-labelledby="layout-title">
|
||||
<h2 id="layout-title" data-i18n="Admin.Archive.Layout"></h2>
|
||||
<label class="field"><span data-i18n="Admin.Archive.Name"></span><input class="input" name="name" dir="auto" value="${attr(settings.name)}" data-i18n-title="Admin.Archive.Name.Tip"></label>
|
||||
<label class="field"><span data-i18n="Admin.Archive.FolderTemplate"></span><input class="input mono" name="folderTemplate" dir="ltr" spellcheck="false" value="${attr(settings.folderTemplate)}" data-i18n-title="Admin.Archive.FolderTemplate.Tip"></label>
|
||||
<label class="field"><span data-i18n="Admin.Archive.FileTemplate"></span><input class="input mono" name="fileTemplate" dir="ltr" spellcheck="false" value="${attr(settings.fileTemplate)}" data-i18n-title="Admin.Archive.FileTemplate.Tip"></label>
|
||||
<label class="field"><span data-i18n="Admin.Archive.Proxies"></span><select class="input" name="proxyLongEdge" data-i18n-title="Admin.Archive.Proxies.Tip">${proxyOptions}</select></label>
|
||||
<div class="buttons"><button class="btn primary" type="submit" data-i18n="Admin.Common.Save" data-i18n-title="Admin.Common.Save.Tip"></button></div>
|
||||
</form>
|
||||
<section class="panel" aria-labelledby="maintenance-title">
|
||||
<h2 id="maintenance-title" data-i18n="Admin.Archive.Maintenance"></h2>
|
||||
<div class="button-row">${ACTIONS.map((a) => `<button class="btn" data-action="${a}" data-i18n="Admin.Archive.${cap(a)}" data-i18n-title="Admin.Archive.${cap(a)}.Tip"></button>`).join("")}</div>
|
||||
<h2 id="cameras-title" data-i18n="Admin.Archive.ByCamera"></h2>
|
||||
${statsTable(stats.byCamera.slice(0, 8).map((c) => ({ label: c.key || "—", count: c.count, bytes: c.bytes })), "cameras-title")
|
||||
|| `<p class="muted" data-i18n="Admin.Dashboard.NoData"></p>`}
|
||||
</section>
|
||||
</div>
|
||||
<div class="grid two charts">
|
||||
<section class="panel" aria-labelledby="years-title"><h2 id="years-title" data-i18n="Admin.Dashboard.ByYear"></h2>
|
||||
${stats.byYear.length === 0 ? emptyState("Admin.Dashboard.NoData", scanButton)
|
||||
: columns(stats.byYear.map((y) => ({ label: y.key, value: y.bytes, title: `${y.key} · ${formatBytes(y.bytes)}` })),
|
||||
{ label: t("Admin.Dashboard.ByYear"), valueLabel: (i) => formatBytes(i.value) })}</section>
|
||||
<section class="panel" aria-labelledby="formats-title"><h2 id="formats-title" data-i18n="Admin.Archive.ByFormat"></h2>
|
||||
${statsTable(stats.byFormat.map((f) => ({ label: f.key.toUpperCase(), count: f.count, bytes: f.bytes })), "formats-title")
|
||||
|| emptyState("Admin.Dashboard.NoData", scanButton)}</section>
|
||||
</div>`;
|
||||
applyStrings(root);
|
||||
|
||||
const form = root.querySelector("form");
|
||||
escapeReverts(form);
|
||||
form.addEventListener("submit", async (e) => {
|
||||
e.preventDefault();
|
||||
form.querySelectorAll("[aria-invalid]").forEach(clearInvalid);
|
||||
const data = new FormData(form);
|
||||
try {
|
||||
settings = await api.put("/api/v1/archive/settings", {
|
||||
...settings,
|
||||
name: String(data.get("name")).trim(),
|
||||
folderTemplate: String(data.get("folderTemplate")),
|
||||
fileTemplate: String(data.get("fileTemplate")),
|
||||
proxyLongEdge: Number(data.get("proxyLongEdge")),
|
||||
});
|
||||
// Esc now reverts to what was saved.
|
||||
form.querySelectorAll("input").forEach((input) => {
|
||||
input.defaultValue = input.value;
|
||||
});
|
||||
form.querySelectorAll("option").forEach((option) => {
|
||||
option.defaultSelected = option.selected;
|
||||
});
|
||||
toast(t("Admin.Common.Saved"));
|
||||
} catch (err) {
|
||||
// Errors name the field in details; the field gets the error border and the message as its tooltip.
|
||||
const field = err.details && form.elements[err.details];
|
||||
const message = field ? invalidText(field) : errorText(err);
|
||||
if (field) {
|
||||
markInvalid(field, message);
|
||||
field.focus();
|
||||
}
|
||||
toast(message, true);
|
||||
}
|
||||
});
|
||||
root.querySelectorAll("[data-action]").forEach((button) => button.addEventListener("click", async () => {
|
||||
button.disabled = true;
|
||||
try {
|
||||
await api.post(`/api/v1/archive/${button.dataset.action}`);
|
||||
toast(t("Admin.Archive.Queued"));
|
||||
} catch (err) {
|
||||
toast(errorText(err), true);
|
||||
} finally {
|
||||
button.disabled = false;
|
||||
button.focus();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
function proxyLabel(size) {
|
||||
if (size === -1) return t("Admin.Archive.ProxiesOff");
|
||||
if (size === 0) return t("Admin.Archive.ProxiesFull");
|
||||
return t("Admin.Archive.ProxiesEdge", size);
|
||||
}
|
||||
|
||||
function cap(s) {
|
||||
return s.charAt(0).toUpperCase() + s.slice(1);
|
||||
}
|
||||
Reference in new issue
Block a user