Recompose Health service cards for wide screens
This commit is contained in:
parent
d3c815a4c8
commit
3edce30416
|
|
@ -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%).
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
"version": "1.0.1"
|
||||
},
|
||||
"stage_ui": {
|
||||
"version": "3.1.35"
|
||||
"version": "3.1.36"
|
||||
},
|
||||
"stage_avahi": {
|
||||
"version": "1.0.0"
|
||||
|
|
|
|||
|
|
@ -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.35"
|
||||
UI_VERSION = "V 3.1.36"
|
||||
STORAGE_HEALTH_COMMAND = "/usr/local/sbin/iomatex-storage-health"
|
||||
ZONEINFO_ROOT = "/usr/share/zoneinfo"
|
||||
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
||||
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, /\.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: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');
|
||||
|
|
|
|||
|
|
@ -391,6 +391,38 @@ h1{margin:0;font-size:34px;line-height:1.02;font-weight:650;letter-spacing:-.03e
|
|||
.cards > .card{height:100%}
|
||||
.cardTop{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
|
||||
.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}
|
||||
.cardSubtitle{margin:6px 0 0;color:var(--muted);font-size:13px}
|
||||
.badge{
|
||||
|
|
@ -1638,6 +1670,9 @@ html[dir="rtl"] .timezoneOption{text-align:right}
|
|||
.identityPanel{min-width:0}
|
||||
.gboxHero{grid-template-columns: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){
|
||||
.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))}
|
||||
.brandDevice{width:min(70vw, 260px);max-height:180px}
|
||||
.wideCard,.displayCard,.accessPointCard{grid-column:auto}
|
||||
.healthServiceGrid .itscreenServiceCard{grid-column:auto;grid-template-columns:1fr}
|
||||
.audioDeviceGrid{grid-template-columns:1fr}
|
||||
.displayDetailsRow{grid-template-columns:1fr;align-items:start}
|
||||
.displayModePanel{
|
||||
|
|
|
|||
|
|
@ -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.35";
|
||||
const UI_VERSION = "V 3.1.36";
|
||||
const ITSCREEN_LOG_INITIAL_LINES = 50;
|
||||
const ITSCREEN_LOG_BUFFER_LIMIT = 300;
|
||||
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) {
|
||||
const payload = itscreenRegistration();
|
||||
const tone = statusTone(card);
|
||||
|
|
@ -1837,18 +1851,14 @@
|
|||
const registrationRequired = !!(state.itscreen.registrationLoadedAt && payload && !payload.registered && !state.itscreen.error);
|
||||
|
||||
return `
|
||||
<article class="panel card serviceCard">
|
||||
<article class="panel card serviceCard serviceProfileCard itscreenServiceCard">
|
||||
<div class="cardTop">
|
||||
<div>
|
||||
${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>
|
||||
</div>
|
||||
<div class="meta">
|
||||
<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>
|
||||
${renderServiceSummary(card)}
|
||||
${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>` : `
|
||||
<div class="list">
|
||||
|
|
@ -1861,17 +1871,24 @@
|
|||
<div class="listTitle">${esc(t("Client update"))}</div>
|
||||
<div id="itscreenClientUpdate">${renderClientUpdate()}</div>
|
||||
</div>
|
||||
<div class="list">
|
||||
<div class="listTitle">${esc(t("Flags"))}</div>
|
||||
<div class="pillRow">
|
||||
${boolPill("Installed", !!card.installed)}
|
||||
${boolPill("Configured", !!card.configured)}
|
||||
${boolPill("Active", !!card.active)}
|
||||
<div class="serviceProfileAside">
|
||||
<div class="list">
|
||||
<div class="listTitle">${esc(t("Flags"))}</div>
|
||||
<div class="pillRow">
|
||||
${boolPill("Installed", !!card.installed)}
|
||||
${boolPill("Configured", !!card.configured)}
|
||||
${boolPill("Active", !!card.active)}
|
||||
</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)}
|
||||
${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>` : ""}
|
||||
${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>` : ""}
|
||||
${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 serviceAlertSection"><div class="listTitle">${esc(t("Errors"))}</div><ul class="msgList">${errors.map((x) => `<li>${esc(translateUiText(x))}</li>`).join("")}</ul></div>` : ""}
|
||||
</article>
|
||||
`;
|
||||
}
|
||||
|
|
@ -2473,7 +2490,7 @@
|
|||
const versionLabel = labels.button || t("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>`;
|
||||
return `<div class="list">
|
||||
return `<div class="list serviceReleaseSection">
|
||||
${compact ? renderPanelTitle(t(card.title), `service:${card.id}`, "", versionButton) : `<div class="listTitle">${esc(sectionLabel)}</div>
|
||||
<div class="meta compactMeta">${renderKeyValueRows([
|
||||
{ label: t("Installed"), value: release.current || t("Unknown") },
|
||||
|
|
@ -2502,14 +2519,10 @@
|
|||
|
||||
function renderServiceCard(card) {
|
||||
const content = renderServiceCardContent(card);
|
||||
if (card.id === "itscreen") return content;
|
||||
// All specialized cards retain their existing renderer and share one release control.
|
||||
const end = content.lastIndexOf("</article>");
|
||||
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);
|
||||
return end < 0 ? content : content.slice(0, end) + renderStageVersion(card) + content.slice(end);
|
||||
}
|
||||
|
||||
function renderServiceCardContent(card) {
|
||||
|
|
@ -2527,18 +2540,14 @@
|
|||
const showMqttBridgeTest = card.id === "mqtt_bridge";
|
||||
|
||||
return `
|
||||
<article class="panel card serviceCard">
|
||||
<article class="panel card serviceCard serviceProfileCard">
|
||||
<div class="cardTop">
|
||||
<div>
|
||||
${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>
|
||||
</div>
|
||||
<div class="meta">
|
||||
<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>
|
||||
${renderServiceSummary(card)}
|
||||
${details.length ? `<div class="list"><div class="listTitle">${esc(t("Details"))}</div><div class="meta compactMeta">${renderKeyValueRows(details)}</div></div>` : ""}
|
||||
${showMqttSelfTest ? renderMqttSelfTestPanel() : ""}
|
||||
${showMqttBridgeTest ? renderMqttBridgeTestPanel() : ""}
|
||||
|
|
@ -2551,8 +2560,8 @@
|
|||
</div>
|
||||
</div>
|
||||
${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>` : ""}
|
||||
${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>` : ""}
|
||||
${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 serviceAlertSection"><div class="listTitle">${esc(t("Errors"))}</div><ul class="msgList">${errors.map((x) => `<li>${esc(translateUiText(x))}</li>`).join("")}</ul></div>` : ""}
|
||||
</article>
|
||||
`;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
} catch (error) {}
|
||||
})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/console.css?v=3.1.35&rev=edge-runtime-profile-1">
|
||||
<link rel="stylesheet" href="/console.css?v=3.1.36&rev=edge-runtime-profile-1">
|
||||
</head>
|
||||
<body>
|
||||
<main class="shell">
|
||||
|
|
@ -109,7 +109,7 @@
|
|||
</main>
|
||||
<div id="menuBackdrop" class="menuBackdrop" hidden></div>
|
||||
<div id="toastStack" class="toastStack" aria-live="polite" aria-atomic="true"></div>
|
||||
<script src="/console.i18n.js?v=3.1.35&rev=edge-runtime-profile-1"></script>
|
||||
<script src="/console.js?v=3.1.35&rev=edge-runtime-profile-1"></script>
|
||||
<script src="/console.i18n.js?v=3.1.36&rev=edge-runtime-profile-1"></script>
|
||||
<script src="/console.js?v=3.1.36&rev=edge-runtime-profile-1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
"version": "3.1.35"
|
||||
"version": "3.1.36"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue