Recompose Health service cards for wide screens

This commit is contained in:
Andrei Smaliak 2026-11-02 08:47:00 +01:00
parent d3c815a4c8
commit 3edce30416
8 changed files with 102 additions and 36 deletions

View File

@ -0,0 +1,14 @@
# Console 3.1.36 — compact Health service profiles
- Recompose standard Health service cards around one shared compact summary
for ID, state and status, with details, tests, flags, actions and release
controls arranged in responsive information columns.
- Give the IT-Screen profile two desktop grid columns and three internal zones
for registration, client update and system-module information. The existing
update actions and status semantics remain owned by the shared release UI.
- Keep specialized Display, access-point and reverse-tunnel layouts intact.
Standard cards collapse to two and then one internal column as space narrows.
- Browser verification at 360, 768, 1024, 1440 and 1920 px confirmed the
1/2/2/3/3 outer grid, no horizontal overflow and readable responsive
composition. At 1920 px the IT-Screen card height decreased from 921 px to
482 px, a reduction of 439 px (47.7%).

View File

@ -14,7 +14,7 @@
"version": "1.0.1" "version": "1.0.1"
}, },
"stage_ui": { "stage_ui": {
"version": "3.1.35" "version": "3.1.36"
}, },
"stage_avahi": { "stage_avahi": {
"version": "1.0.0" "version": "1.0.0"

View File

@ -61,7 +61,7 @@ APP_DIR = "/opt/iomatex-console"
PUBLIC_DIR = os.path.join(APP_DIR, "public") PUBLIC_DIR = os.path.join(APP_DIR, "public")
PROVIDERS_DIR = os.path.join(APP_DIR, "providers.d") PROVIDERS_DIR = os.path.join(APP_DIR, "providers.d")
CONFIG_PATH = "/etc/iomatex/console.json" CONFIG_PATH = "/etc/iomatex/console.json"
UI_VERSION = "V 3.1.35" UI_VERSION = "V 3.1.36"
STORAGE_HEALTH_COMMAND = "/usr/local/sbin/iomatex-storage-health" STORAGE_HEALTH_COMMAND = "/usr/local/sbin/iomatex-storage-health"
ZONEINFO_ROOT = "/usr/share/zoneinfo" ZONEINFO_ROOT = "/usr/share/zoneinfo"

View File

@ -6,9 +6,16 @@ const js = fs.readFileSync(path.join(__dirname, '../frontend/console.js'), 'utf8
const css = fs.readFileSync(path.join(__dirname, '../frontend/console.css'), 'utf8'); const css = fs.readFileSync(path.join(__dirname, '../frontend/console.css'), 'utf8');
assert.match(js, /class="cards healthServiceGrid"/); assert.match(js, /class="cards healthServiceGrid"/);
assert.equal((js.match(/serviceCard serviceProfileCard/g) || []).length, 2);
assert.match(js, /function renderServiceSummary\(card\)/);
assert.match(js, /serviceCard serviceProfileCard itscreenServiceCard/);
assert.match(js, /if \(card\.id === "itscreen"\) return content/);
assert.match(css, /\.shell\{max-width:1600px/); assert.match(css, /\.shell\{max-width:1600px/);
assert.match(css, /\.healthServiceGrid\{\s*grid-template-columns:repeat\(3,minmax\(0,1fr\)\)/); assert.match(css, /\.healthServiceGrid\{\s*grid-template-columns:repeat\(3,minmax\(0,1fr\)\)/);
assert.match(css, /@media \(max-width:1100px\)[\s\S]*?\.healthServiceGrid\{grid-template-columns:repeat\(2,minmax\(0,1fr\)\)\}/); assert.match(css, /@media \(max-width:1100px\)[\s\S]*?\.healthServiceGrid\{grid-template-columns:repeat\(2,minmax\(0,1fr\)\)\}/);
assert.match(css, /@media \(max-width:720px\)[\s\S]*?\.healthServiceGrid\{grid-template-columns:1fr\}/); assert.match(css, /@media \(max-width:720px\)[\s\S]*?\.healthServiceGrid\{grid-template-columns:1fr\}/);
assert.match(css, /\.healthServiceGrid \.serviceProfileCard\{[\s\S]*?grid-template-columns:repeat\(2,minmax\(0,1fr\)\)/);
assert.match(css, /\.healthServiceGrid \.itscreenServiceCard\{[\s\S]*?grid-column:span 2;[\s\S]*?grid-template-columns:repeat\(3,minmax\(0,1fr\)\)/);
assert.match(css, /@media \(max-width:940px\)[\s\S]*?\.healthServiceGrid \.serviceProfileCard\{grid-template-columns:1fr\}/);
console.log('Health layout owner: 1600px shell and 3/2/1 service columns passed'); console.log('Health layout owner: 1600px shell and 3/2/1 service columns passed');

View File

@ -391,6 +391,38 @@ h1{margin:0;font-size:34px;line-height:1.02;font-weight:650;letter-spacing:-.03e
.cards > .card{height:100%} .cards > .card{height:100%}
.cardTop{display:flex;justify-content:space-between;gap:12px;align-items:flex-start} .cardTop{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.serviceCard{display:flex;flex-direction:column} .serviceCard{display:flex;flex-direction:column}
.healthServiceGrid .serviceProfileCard{
display:grid;
grid-template-columns:repeat(2,minmax(0,1fr));
column-gap:20px;
align-content:start;
}
.healthServiceGrid .itscreenServiceCard{
grid-column:span 2;
grid-template-columns:repeat(3,minmax(0,1fr));
}
.healthServiceGrid .serviceProfileCard > .cardTop,
.healthServiceGrid .serviceProfileCard > .serviceSummary,
.healthServiceGrid .serviceProfileCard > .banner,
.healthServiceGrid .serviceProfileCard > .emptyInline,
.healthServiceGrid .serviceProfileCard > .serviceAlertSection{
grid-column:1 / -1;
}
.serviceSummary{
display:grid;
grid-template-columns:repeat(3,minmax(0,1fr));
gap:10px;
margin-top:14px;
padding:10px 12px;
border:1px solid var(--line);
border-radius:12px;
background:var(--surface-soft);
}
.serviceSummaryItem{display:grid;gap:3px;min-width:0}
.serviceSummaryItem .key{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.06em}
.serviceSummaryValue{min-width:0;overflow-wrap:anywhere;font-size:13px}
.healthServiceGrid .serviceProfileCard > .list{min-width:0;align-self:start}
.serviceProfileAside{min-width:0}
.card h2{margin:0;font-size:19px} .card h2{margin:0;font-size:19px}
.cardSubtitle{margin:6px 0 0;color:var(--muted);font-size:13px} .cardSubtitle{margin:6px 0 0;color:var(--muted);font-size:13px}
.badge{ .badge{
@ -1638,6 +1670,9 @@ html[dir="rtl"] .timezoneOption{text-align:right}
.identityPanel{min-width:0} .identityPanel{min-width:0}
.gboxHero{grid-template-columns:1fr} .gboxHero{grid-template-columns:1fr}
.itscreenCards{grid-template-columns:repeat(2,minmax(0,1fr))} .itscreenCards{grid-template-columns:repeat(2,minmax(0,1fr))}
.healthServiceGrid .serviceProfileCard{grid-template-columns:1fr}
.healthServiceGrid .itscreenServiceCard{grid-template-columns:repeat(2,minmax(0,1fr))}
.serviceSummary{grid-template-columns:repeat(2,minmax(0,1fr))}
} }
@media (max-width:720px){ @media (max-width:720px){
.brand{flex-direction:column;align-items:flex-start} .brand{flex-direction:column;align-items:flex-start}
@ -1649,6 +1684,7 @@ html[dir="rtl"] .timezoneOption{text-align:right}
.tunnelSummaryGrid{grid-template-columns:repeat(2,minmax(0,1fr))} .tunnelSummaryGrid{grid-template-columns:repeat(2,minmax(0,1fr))}
.brandDevice{width:min(70vw, 260px);max-height:180px} .brandDevice{width:min(70vw, 260px);max-height:180px}
.wideCard,.displayCard,.accessPointCard{grid-column:auto} .wideCard,.displayCard,.accessPointCard{grid-column:auto}
.healthServiceGrid .itscreenServiceCard{grid-column:auto;grid-template-columns:1fr}
.audioDeviceGrid{grid-template-columns:1fr} .audioDeviceGrid{grid-template-columns:1fr}
.displayDetailsRow{grid-template-columns:1fr;align-items:start} .displayDetailsRow{grid-template-columns:1fr;align-items:start}
.displayModePanel{ .displayModePanel{

View File

@ -49,7 +49,7 @@
{ mode: "test_by", label: "test.it-screen.by", host: "rest.test.it-screen.by" }, { mode: "test_by", label: "test.it-screen.by", host: "rest.test.it-screen.by" },
{ mode: "custom", label: "Custom", host: "" } { mode: "custom", label: "Custom", host: "" }
]; ];
const UI_VERSION = "V 3.1.35"; const UI_VERSION = "V 3.1.36";
const ITSCREEN_LOG_INITIAL_LINES = 50; const ITSCREEN_LOG_INITIAL_LINES = 50;
const ITSCREEN_LOG_BUFFER_LIMIT = 300; const ITSCREEN_LOG_BUFFER_LIMIT = 300;
const ITSCREEN_LOG_BATCH_MS = 250; const ITSCREEN_LOG_BATCH_MS = 250;
@ -1828,6 +1828,20 @@
]); ]);
} }
function renderServiceSummary(card) {
const items = [
{ label: t("ID"), value: card.id },
{ label: t("State"), value: displayValue(card.state, "-") },
{ label: t("Status"), value: displayValue(card.status_text, "-") }
];
return `<div class="serviceSummary">${items.map(item => `
<div class="serviceSummaryItem">
<span class="key">${esc(item.label)}</span>
<strong class="serviceSummaryValue">${esc(item.value)}</strong>
</div>
`).join("")}</div>`;
}
function renderItscreenServiceCard(card) { function renderItscreenServiceCard(card) {
const payload = itscreenRegistration(); const payload = itscreenRegistration();
const tone = statusTone(card); const tone = statusTone(card);
@ -1837,18 +1851,14 @@
const registrationRequired = !!(state.itscreen.registrationLoadedAt && payload && !payload.registered && !state.itscreen.error); const registrationRequired = !!(state.itscreen.registrationLoadedAt && payload && !payload.registered && !state.itscreen.error);
return ` return `
<article class="panel card serviceCard"> <article class="panel card serviceCard serviceProfileCard itscreenServiceCard">
<div class="cardTop"> <div class="cardTop">
<div> <div>
${renderPanelTitle(t(card.title), `service:${card.id}`, card.subtitle ? translateUiText(card.subtitle) : "")} ${renderPanelTitle(t(card.title), `service:${card.id}`, card.subtitle ? translateUiText(card.subtitle) : "")}
<div class="badge"><span class="dot ${tone}"></span>${esc(translateStatusValue(card.status_text || card.state || "Unknown"))}</div> <div class="badge"><span class="dot ${tone}"></span>${esc(translateStatusValue(card.status_text || card.state || "Unknown"))}</div>
</div> </div>
</div> </div>
<div class="meta"> ${renderServiceSummary(card)}
<div class="key">${esc(t("ID"))}</div><div>${esc(card.id)}</div>
<div class="key">${esc(t("State"))}</div><div>${esc(displayValue(card.state, "-"))}</div>
<div class="key">${esc(t("Status"))}</div><div>${esc(displayValue(card.status_text, "-"))}</div>
</div>
${state.itscreen.error ? `<div class="banner error">${esc(state.itscreen.error)}${itscreenResponseDetails() ? `: ${esc(itscreenResponseDetails())}` : ""}</div>` : ""} ${state.itscreen.error ? `<div class="banner error">${esc(state.itscreen.error)}${itscreenResponseDetails() ? `: ${esc(itscreenResponseDetails())}` : ""}</div>` : ""}
${!state.itscreen.registrationLoadedAt && !state.itscreen.error ? `<div class="emptyInline">${esc(t("Loading It-screen status..."))}</div>` : ` ${!state.itscreen.registrationLoadedAt && !state.itscreen.error ? `<div class="emptyInline">${esc(t("Loading It-screen status..."))}</div>` : `
<div class="list"> <div class="list">
@ -1861,6 +1871,7 @@
<div class="listTitle">${esc(t("Client update"))}</div> <div class="listTitle">${esc(t("Client update"))}</div>
<div id="itscreenClientUpdate">${renderClientUpdate()}</div> <div id="itscreenClientUpdate">${renderClientUpdate()}</div>
</div> </div>
<div class="serviceProfileAside">
<div class="list"> <div class="list">
<div class="listTitle">${esc(t("Flags"))}</div> <div class="listTitle">${esc(t("Flags"))}</div>
<div class="pillRow"> <div class="pillRow">
@ -1869,9 +1880,15 @@
${boolPill("Active", !!card.active)} ${boolPill("Active", !!card.active)}
</div> </div>
</div> </div>
${renderStageVersion(card, false, {
section: t("Client update system module"),
button: t("System module"),
hint: t("Technical module that checks, verifies and safely installs client releases.")
})}
</div>
${renderServiceActions(card)} ${renderServiceActions(card)}
${warnings.length ? `<div class="list"><div class="listTitle">${esc(t("Warnings"))}</div><ul class="msgList">${warnings.map((x) => `<li>${esc(translateUiText(x))}</li>`).join("")}</ul></div>` : ""} ${warnings.length ? `<div class="list serviceAlertSection"><div class="listTitle">${esc(t("Warnings"))}</div><ul class="msgList">${warnings.map((x) => `<li>${esc(translateUiText(x))}</li>`).join("")}</ul></div>` : ""}
${errors.length ? `<div class="list"><div class="listTitle">${esc(t("Errors"))}</div><ul class="msgList">${errors.map((x) => `<li>${esc(translateUiText(x))}</li>`).join("")}</ul></div>` : ""} ${errors.length ? `<div class="list serviceAlertSection"><div class="listTitle">${esc(t("Errors"))}</div><ul class="msgList">${errors.map((x) => `<li>${esc(translateUiText(x))}</li>`).join("")}</ul></div>` : ""}
</article> </article>
`; `;
} }
@ -2473,7 +2490,7 @@
const versionLabel = labels.button || t("Version"); const versionLabel = labels.button || t("Version");
const sectionLabel = labels.section || t("Stage version"); const sectionLabel = labels.section || t("Stage version");
const versionButton = `<button class="actionBtn secondary" type="button" onclick="window.__stageVersion('${esc(card.id)}')">${esc(versionLabel)}: ${esc(release.current || t("Unknown"))}</button>`; const versionButton = `<button class="actionBtn secondary" type="button" onclick="window.__stageVersion('${esc(card.id)}')">${esc(versionLabel)}: ${esc(release.current || t("Unknown"))}</button>`;
return `<div class="list"> return `<div class="list serviceReleaseSection">
${compact ? renderPanelTitle(t(card.title), `service:${card.id}`, "", versionButton) : `<div class="listTitle">${esc(sectionLabel)}</div> ${compact ? renderPanelTitle(t(card.title), `service:${card.id}`, "", versionButton) : `<div class="listTitle">${esc(sectionLabel)}</div>
<div class="meta compactMeta">${renderKeyValueRows([ <div class="meta compactMeta">${renderKeyValueRows([
{ label: t("Installed"), value: release.current || t("Unknown") }, { label: t("Installed"), value: release.current || t("Unknown") },
@ -2502,14 +2519,10 @@
function renderServiceCard(card) { function renderServiceCard(card) {
const content = renderServiceCardContent(card); const content = renderServiceCardContent(card);
if (card.id === "itscreen") return content;
// All specialized cards retain their existing renderer and share one release control. // All specialized cards retain their existing renderer and share one release control.
const end = content.lastIndexOf("</article>"); const end = content.lastIndexOf("</article>");
const stageLabels = card.id === "itscreen" ? { return end < 0 ? content : content.slice(0, end) + renderStageVersion(card) + content.slice(end);
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) { function renderServiceCardContent(card) {
@ -2527,18 +2540,14 @@
const showMqttBridgeTest = card.id === "mqtt_bridge"; const showMqttBridgeTest = card.id === "mqtt_bridge";
return ` return `
<article class="panel card serviceCard"> <article class="panel card serviceCard serviceProfileCard">
<div class="cardTop"> <div class="cardTop">
<div> <div>
${renderPanelTitle(t(card.title), `service:${card.id}`, card.subtitle ? translateUiText(card.subtitle) : "")} ${renderPanelTitle(t(card.title), `service:${card.id}`, card.subtitle ? translateUiText(card.subtitle) : "")}
<div class="badge"><span class="dot ${tone}"></span>${esc(translateStatusValue(card.status_text || card.state || "Unknown"))}</div> <div class="badge"><span class="dot ${tone}"></span>${esc(translateStatusValue(card.status_text || card.state || "Unknown"))}</div>
</div> </div>
</div> </div>
<div class="meta"> ${renderServiceSummary(card)}
<div class="key">${esc(t("ID"))}</div><div>${esc(card.id)}</div>
<div class="key">${esc(t("State"))}</div><div>${esc(displayValue(card.state, "-"))}</div>
<div class="key">${esc(t("Status"))}</div><div>${esc(displayValue(card.status_text, "-"))}</div>
</div>
${details.length ? `<div class="list"><div class="listTitle">${esc(t("Details"))}</div><div class="meta compactMeta">${renderKeyValueRows(details)}</div></div>` : ""} ${details.length ? `<div class="list"><div class="listTitle">${esc(t("Details"))}</div><div class="meta compactMeta">${renderKeyValueRows(details)}</div></div>` : ""}
${showMqttSelfTest ? renderMqttSelfTestPanel() : ""} ${showMqttSelfTest ? renderMqttSelfTestPanel() : ""}
${showMqttBridgeTest ? renderMqttBridgeTestPanel() : ""} ${showMqttBridgeTest ? renderMqttBridgeTestPanel() : ""}
@ -2551,8 +2560,8 @@
</div> </div>
</div> </div>
${renderServiceActions(card)} ${renderServiceActions(card)}
${warnings.length ? `<div class="list"><div class="listTitle">${esc(t("Warnings"))}</div><ul class="msgList">${warnings.map((x) => `<li>${esc(translateUiText(x))}</li>`).join("")}</ul></div>` : ""} ${warnings.length ? `<div class="list serviceAlertSection"><div class="listTitle">${esc(t("Warnings"))}</div><ul class="msgList">${warnings.map((x) => `<li>${esc(translateUiText(x))}</li>`).join("")}</ul></div>` : ""}
${errors.length ? `<div class="list"><div class="listTitle">${esc(t("Errors"))}</div><ul class="msgList">${errors.map((x) => `<li>${esc(translateUiText(x))}</li>`).join("")}</ul></div>` : ""} ${errors.length ? `<div class="list serviceAlertSection"><div class="listTitle">${esc(t("Errors"))}</div><ul class="msgList">${errors.map((x) => `<li>${esc(translateUiText(x))}</li>`).join("")}</ul></div>` : ""}
</article> </article>
`; `;
} }

View File

@ -23,7 +23,7 @@
} catch (error) {} } catch (error) {}
})(); })();
</script> </script>
<link rel="stylesheet" href="/console.css?v=3.1.35&amp;rev=edge-runtime-profile-1"> <link rel="stylesheet" href="/console.css?v=3.1.36&amp;rev=edge-runtime-profile-1">
</head> </head>
<body> <body>
<main class="shell"> <main class="shell">
@ -109,7 +109,7 @@
</main> </main>
<div id="menuBackdrop" class="menuBackdrop" hidden></div> <div id="menuBackdrop" class="menuBackdrop" hidden></div>
<div id="toastStack" class="toastStack" aria-live="polite" aria-atomic="true"></div> <div id="toastStack" class="toastStack" aria-live="polite" aria-atomic="true"></div>
<script src="/console.i18n.js?v=3.1.35&amp;rev=edge-runtime-profile-1"></script> <script src="/console.i18n.js?v=3.1.36&amp;rev=edge-runtime-profile-1"></script>
<script src="/console.js?v=3.1.35&amp;rev=edge-runtime-profile-1"></script> <script src="/console.js?v=3.1.36&amp;rev=edge-runtime-profile-1"></script>
</body> </body>
</html> </html>

View File

@ -1,3 +1,3 @@
{ {
"version": "3.1.35" "version": "3.1.36"
} }