From 9491a45864e3d0feece0a855314bb3be0556e8fe Mon Sep 17 00:00:00 2001 From: Andrei Smaliak Date: Mon, 2 Nov 2026 07:30:12 +0100 Subject: [PATCH] Show client updates in the IT-Screen profile card --- docs/releases/console-3.1.34.md | 13 +++++++++ stage-releases.json | 2 +- stage_ui/console_core/backend/app.py | 2 +- .../backend/test_client_update_ui.js | 3 ++ .../console_core/frontend/console.i18n.js | 4 +++ stage_ui/console_core/frontend/console.js | 28 +++++++++++++------ stage_ui/console_core/frontend/index.html | 6 ++-- stage_ui/version.json | 2 +- 8 files changed, 46 insertions(+), 14 deletions(-) create mode 100644 docs/releases/console-3.1.34.md diff --git a/docs/releases/console-3.1.34.md b/docs/releases/console-3.1.34.md new file mode 100644 index 0000000..07b1d80 --- /dev/null +++ b/docs/releases/console-3.1.34.md @@ -0,0 +1,13 @@ +# Console 3.1.34 — client update in the IT-Screen profile card + +- Show the shared Debian client update state and action directly in the + IT-Screen service profile card on Health: installed version, available + version, availability/progress/error status, and Check and update client. +- Use the same update controller and authenticated API as the dedicated + It-Screen tab. Health performs a check-only request and local status polling; + it does not change the automatic-update preference. +- Rename the separate stage 1.0.40 presentation to Client update system module + and explain that it is the technical updater module, not the application + version. +- Keep the generic stage renderer as the single owner; the IT-Screen card only + supplies contextual labels. No parallel installation path is introduced. diff --git a/stage-releases.json b/stage-releases.json index 8756f90..41c73b8 100644 --- a/stage-releases.json +++ b/stage-releases.json @@ -14,7 +14,7 @@ "version": "1.0.1" }, "stage_ui": { - "version": "3.1.33" + "version": "3.1.34" }, "stage_avahi": { "version": "1.0.0" diff --git a/stage_ui/console_core/backend/app.py b/stage_ui/console_core/backend/app.py index 32c197d..bcf1362 100644 --- a/stage_ui/console_core/backend/app.py +++ b/stage_ui/console_core/backend/app.py @@ -61,7 +61,7 @@ APP_DIR = "/opt/iomatex-console" PUBLIC_DIR = os.path.join(APP_DIR, "public") PROVIDERS_DIR = os.path.join(APP_DIR, "providers.d") CONFIG_PATH = "/etc/iomatex/console.json" -UI_VERSION = "V 3.1.33" +UI_VERSION = "V 3.1.34" STORAGE_HEALTH_COMMAND = "/usr/local/sbin/iomatex-storage-health" ZONEINFO_ROOT = "/usr/share/zoneinfo" diff --git a/stage_ui/console_core/backend/test_client_update_ui.js b/stage_ui/console_core/backend/test_client_update_ui.js index f6938b7..94de120 100644 --- a/stage_ui/console_core/backend/test_client_update_ui.js +++ b/stage_ui/console_core/backend/test_client_update_ui.js @@ -15,4 +15,7 @@ for (const [phase, label] of [['ready', 'A new client version'], ['not_required' assert.ok(!html.includes('')); } assert.ok(source.includes('panel.innerHTML = renderClientUpdate()'), 'Polling updates only the updater panel, preserving form edits'); +assert.ok(source.includes('["health", "tscreen"].includes(state.activeTab)'), 'Health profile and It-Screen tab share the update owner'); +assert.equal((source.match(/id="itscreenClientUpdate"/g) || []).length, 2, 'Both views expose the shared client update panel'); +assert.ok(source.includes('Client update system module'), 'Technical stage is explicitly distinguished from the client version'); console.log('Client update versions, available/current/error/busy states and local panel rendering passed'); diff --git a/stage_ui/console_core/frontend/console.i18n.js b/stage_ui/console_core/frontend/console.i18n.js index 33edd25..17e6bea 100644 --- a/stage_ui/console_core/frontend/console.i18n.js +++ b/stage_ui/console_core/frontend/console.i18n.js @@ -23,6 +23,10 @@ "Client updated": "Клиент обновлён", "Client update failed": "Не удалось обновить клиент", "Updates come from git.iomatex.com. The client restarts; registration and settings are preserved.": "Обновления загружаются с git.iomatex.com. Клиент перезапустится; регистрация и настройки сохранятся.", + "Client update": "Обновление клиента", + "Client update system module": "Системный модуль обновления клиента", + "System module": "Системный модуль", + "Technical module that checks, verifies and safely installs client releases.": "Технический модуль, который проверяет, валидирует и безопасно устанавливает версии клиента.", "Input/output relationship": "Связь входов и реле", "Independent inputs and outputs": "Независимые входы и выходы", diff --git a/stage_ui/console_core/frontend/console.js b/stage_ui/console_core/frontend/console.js index faff0cb..65198ec 100644 --- a/stage_ui/console_core/frontend/console.js +++ b/stage_ui/console_core/frontend/console.js @@ -49,7 +49,7 @@ { mode: "test_by", label: "test.it-screen.by", host: "rest.test.it-screen.by" }, { mode: "custom", label: "Custom", host: "" } ]; - const UI_VERSION = "V 3.1.33"; + const UI_VERSION = "V 3.1.34"; const ITSCREEN_LOG_INITIAL_LINES = 50; const ITSCREEN_LOG_BUFFER_LIMIT = 300; const ITSCREEN_LOG_BATCH_MS = 250; @@ -1857,6 +1857,10 @@
${renderItscreenInfoRows(payload || {}, itscreenService().version)}
`} +
+
${esc(t("Client update"))}
+
${renderClientUpdate()}
+
${esc(t("Flags"))}
@@ -2454,7 +2458,7 @@ return (job.stages || [job.stage]).includes(stage); } - function renderStageVersion(card, compact = false) { + function renderStageVersion(card, compact = false, labels = {}) { const release = card.release; if (!release) return ""; const updates = (state.healthServices && state.healthServices.updates) || {}; @@ -2466,9 +2470,11 @@ : updates.checking ? t("Checking versions...") : updates.error ? t(updates.error) : needsCheck ? t("Check available versions before installing.") : ""; - const versionButton = ``; + const versionLabel = labels.button || t("Version"); + const sectionLabel = labels.section || t("Stage version"); + const versionButton = ``; return `
- ${compact ? renderPanelTitle(t(card.title), `service:${card.id}`, "", versionButton) : `
${esc(t("Stage version"))}
+ ${compact ? renderPanelTitle(t(card.title), `service:${card.id}`, "", versionButton) : `
${esc(sectionLabel)}
${renderKeyValueRows([ { label: t("Installed"), value: release.current || t("Unknown") }, { label: t("Available"), value: release.latest || t("Not checked") }, @@ -2481,6 +2487,7 @@ ${!needsCheck && release.status !== "latest" && release.status !== "ahead" ? `` : ""} ${stageInJob(job, release.stage) && job.state ? `` : ""}
+ ${labels.hint ? `
${esc(labels.hint)}
` : ""} ${stageInJob(job, release.stage) && ["failed", "interrupted"].includes(job.state) ? `` : ""} ${!release.can_install && reason ? `
${esc(reason)}
` : ""}
`; @@ -2497,7 +2504,12 @@ const content = renderServiceCardContent(card); // All specialized cards retain their existing renderer and share one release control. const end = content.lastIndexOf(""); - return end < 0 ? content : content.slice(0, end) + renderStageVersion(card) + content.slice(end); + const stageLabels = card.id === "itscreen" ? { + section: t("Client update system module"), + button: t("System module"), + hint: t("Technical module that checks, verifies and safely installs client releases.") + } : {}; + return end < 0 ? content : content.slice(0, end) + renderStageVersion(card, false, stageLabels) + content.slice(end); } function renderServiceCardContent(card) { @@ -5203,7 +5215,7 @@ } async function loadItscreenInitialData(options = {}) { - if (state.activeTab === "tscreen") loadClientUpdate(Date.now() - state.itscreen.updateCheckedAt > 900000 ? "check_only" : null); + if (["health", "tscreen"].includes(state.activeTab)) loadClientUpdate(Date.now() - state.itscreen.updateCheckedAt > 900000 ? "check_only" : null); const force = !!options.force; const maxAgeMs = Number.isFinite(options.maxAgeMs) ? options.maxAgeMs : 10000; if (!force && state.itscreen.request) return state.itscreen.request; @@ -5881,7 +5893,7 @@ function renderClientUpdateStatus() { const panel = document.getElementById("itscreenClientUpdate"); - if (panel && state.activeTab === "tscreen") panel.innerHTML = renderClientUpdate(); + if (panel && ["health", "tscreen"].includes(state.activeTab)) panel.innerHTML = renderClientUpdate(); } window.__clientUpdate = async function () { @@ -7098,7 +7110,7 @@ loadForActiveTab({ preserveEditing: true }).catch(() => {}); }, 15000); setInterval(() => { - if (state.auth.authenticated && state.activeTab === "tscreen") loadClientUpdate(); + if (state.auth.authenticated && ["health", "tscreen"].includes(state.activeTab)) loadClientUpdate(); }, 3000); setInterval(updateSessionMeter, 30000); })(); diff --git a/stage_ui/console_core/frontend/index.html b/stage_ui/console_core/frontend/index.html index f98c3d4..039b9c1 100644 --- a/stage_ui/console_core/frontend/index.html +++ b/stage_ui/console_core/frontend/index.html @@ -23,7 +23,7 @@ } catch (error) {} })(); - +
@@ -109,7 +109,7 @@
- - + + diff --git a/stage_ui/version.json b/stage_ui/version.json index 052a750..d04a70a 100644 --- a/stage_ui/version.json +++ b/stage_ui/version.json @@ -1,3 +1,3 @@ { - "version": "3.1.33" + "version": "3.1.34" }