feat: better first time downloading, feat: more logging
Build and Publish Container / Publish Linux container (push) Successful in 4m59s

This commit is contained in:
2026-10-05 14:23:25 -04:00
parent fa6eb856dc
commit 86b8ab9c75
14 changed files with 504 additions and 70 deletions
+24 -4
View File
@@ -108,9 +108,19 @@ function renderServiceState(data) {
const ready = Number(data.totals?.ready_mods || 0);
element.className = "service-state";
if (data.scheduler?.running) {
const progress = data.scheduler?.progress || {};
const progressPercent = Number(progress.percent || 0);
if (data.scheduler?.initial_download) {
element.classList.add("working");
label.textContent = "Updating now";
label.textContent = progress.total_mods
? `Downloading first-time mods · ${Math.round(progressPercent)}%`
: "Downloading first-time mods";
} else if (data.scheduler?.running) {
element.classList.add("working");
label.textContent = progress.total_mods
? `Updating now · ${Math.round(progressPercent)}%`
: "Updating now";
} else if (data.latest_run?.status === "failed") {
element.classList.add("failed");
label.textContent = "Update needs attention";
@@ -166,12 +176,22 @@ function renderDashboard(data) {
}
const updatedAt = data.rml_updated_at;
$("#last-updated").textContent = data.scheduler?.running ? "Updating now" : formatRelativeDate(updatedAt);
const progress = data.scheduler?.progress || {};
const initialDownload = Boolean(data.scheduler?.initial_download);
$("#last-updated").textContent = initialDownload
? `Downloading ${Math.round(Number(progress.percent || 0))}%`
: (data.scheduler?.running ? "Updating now" : formatRelativeDate(updatedAt));
$("#last-updated").title = formatDate(updatedAt);
state.rmlReady = total > 0 && ready === total && !data.scheduler?.running;
const nextRefresh = data.scheduler?.next_refresh_at;
if (data.scheduler?.running) {
if (initialDownload) {
const completed = Number(progress.completed_mods || 0).toLocaleString();
const target = Number(progress.total_mods || 0).toLocaleString();
$("#update-detail").textContent = progress.total_mods
? `First-time download: ${completed} of ${target} mods. Hourly checks begin after it finishes.`
: "Preparing the first-time Workshop download. Hourly checks are paused.";
} else if (data.scheduler?.running) {
$("#update-detail").textContent = "The hourly Workshop refresh is currently running.";
} else if (!state.rmlReady) {
$("#update-detail").textContent = "The current RML is being prepared from the latest Workshop data.";