Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

style(portal): clarify workspace posture summaries

rcourtman4639c675dac3
diff --git a/internal/cloudcp/portal/dist/build_manifest.json b/internal/cloudcp/portal/dist/build_manifest.json
index ed04586d25..baf12c57a7 100644
--- a/internal/cloudcp/portal/dist/build_manifest.json
+++ b/internal/cloudcp/portal/dist/build_manifest.json
@@ -1,5 +1,5 @@
{
- "source_hash": "047990eb1f155757b8fa9c5b4f136fd0fa7a39e73920a3914b0ca1dbe5d03ddf",
+ "source_hash": "7fae320e9bf427de97b3833306df5b1904f33b905e4e7fe151e8a02886e71c89",
"build_inputs": [
"package.json",
"tsconfig.json",
diff --git a/internal/cloudcp/portal/dist/portal_app.css b/internal/cloudcp/portal/dist/portal_app.css
index b5c094d03c..9e26725eb2 100644
--- a/internal/cloudcp/portal/dist/portal_app.css
+++ b/internal/cloudcp/portal/dist/portal_app.css
@@ -648,7 +648,7 @@ header .logout-btn:hover,
}
.account-metric-strip {
display: grid;
- grid-template-columns: repeat(4, minmax(0, 1fr));
+ grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
gap: 12px;
}
.team-management-stats {
diff --git a/internal/cloudcp/portal/dist/portal_app.js b/internal/cloudcp/portal/dist/portal_app.js
index 0da1b97eb8..b5815e2075 100644
--- a/internal/cloudcp/portal/dist/portal_app.js
+++ b/internal/cloudcp/portal/dist/portal_app.js
@@ -1724,6 +1724,15 @@
}
return count;
}
+ function countReadyWorkspaces(workspaces) {
+ var count = 0;
+ for (var i = 0; i < workspaces.length; i += 1) {
+ if (String(workspaces[i].state || "") === "active" && workspaceHealthState(workspaces[i]) === "healthy") {
+ count += 1;
+ }
+ }
+ return count;
+ }
function healthBadgeHTML(workspace) {
var status = workspaceHealthState(workspace);
if (status === "healthy") {
@@ -1810,10 +1819,12 @@
}
function renderAccountOverviewSection(account) {
var workspaces = Array.isArray(account.workspaces) ? account.workspaces : [];
+ var totalCount = workspaces.length;
+ var readyCount = countReadyWorkspaces(workspaces);
var healthyCount = countWorkspacesByHealth(workspaces, "healthy");
var checkingCount = countWorkspacesByHealth(workspaces, "checking");
var unhealthyCount = countWorkspacesByHealth(workspaces, "unhealthy");
- var activeCount = countWorkspacesByState(workspaces, "active");
+ var suspendedCount = countWorkspacesByState(workspaces, "suspended");
var postureTitle = unhealthyCount > 0 ? "Hosted posture needs review" : checkingCount > 0 ? "Hosted posture is still settling" : "Hosted posture is stable";
var postureCopy = unhealthyCount > 0 ? "One or more workspaces still need attention before the hosted fleet is trustworthy." : checkingCount > 0 ? "The hosted fleet is mostly healthy, but some workspaces are still waiting on a completed health check." : "The hosted fleet is healthy and ready for routine operator work.";
var nextStepTitle = unhealthyCount > 0 ? "Start in Workspaces" : checkingCount > 0 ? "Review pending checks" : "Fleet is clear";
@@ -1822,13 +1833,14 @@
var nextStepActions = '<div class="overview-next-actions"><button class="btn-primary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="workspaces">Open workspaces</button><button class="btn-secondary btn-compact" type="button" data-shell-action="activate-section" data-shell-section="' + (account.can_manage ? "team" : "services") + '">' + (account.can_manage ? "Review team access" : "Open account services") + "</button></div>";
return '<section class="account-content-panel account-content-panel-overview"><div class="account-stage-header account-stage-header-overview"><div><div class="account-panel-kicker">Overview</div><h3>Hosted posture</h3><p>Start here to judge fleet posture, pick the next operator action, and keep commercial account work separate from hosted operations.</p></div></div><div class="account-command-deck"><div class="account-overview-card"><div class="account-overview-lead"><div class="account-panel-kicker">Fleet posture</div><h3>' + escapeHTML(postureTitle) + "</h3><p>" + escapeHTML(postureCopy) + '</p><div class="account-overview-callout">' + escapeHTML(
account.kind === "msp" ? "Use this console to run client workspaces, account billing, and operator access from one place." : "Use this console to run hosted workspaces, account billing, and operator access from one place."
- ) + '</div></div><div class="account-metric-strip"><div class="account-stat-card account-stat-card-inline"><span class="account-stat-label">Active workspaces</span><span class="account-stat-value">' + String(activeCount) + '</span></div><div class="account-stat-card account-stat-card-inline"><span class="account-stat-label">Healthy</span><span class="account-stat-value account-stat-healthy">' + String(healthyCount) + '</span></div><div class="account-stat-card account-stat-card-inline"><span class="account-stat-label">Checking</span><span class="account-stat-value account-stat-checking">' + String(checkingCount) + '</span></div><div class="account-stat-card account-stat-card-inline"><span class="account-stat-label">Needs attention</span><span class="account-stat-value account-stat-unhealthy">' + String(unhealthyCount) + '</span></div></div></div><div class="account-overview-secondary"><div class="overview-side-card overview-side-card-primary"><div class="account-panel-kicker">Next move</div><h4>' + escapeHTML(nextStepTitle) + "</h4><p>" + escapeHTML(nextStepCopy) + "</p>" + nextStepChecklist + nextStepActions + "</div>" + renderAttentionPanel(workspaces) + "</div></div></section>";
+ ) + '</div></div><div class="account-metric-strip"><div class="account-stat-card account-stat-card-inline"><span class="account-stat-label">Total</span><span class="account-stat-value">' + String(totalCount) + '</span></div><div class="account-stat-card account-stat-card-inline"><span class="account-stat-label">Ready now</span><span class="account-stat-value account-stat-healthy">' + String(readyCount) + '</span></div><div class="account-stat-card account-stat-card-inline"><span class="account-stat-label">Checking</span><span class="account-stat-value account-stat-checking">' + String(checkingCount) + '</span></div><div class="account-stat-card account-stat-card-inline"><span class="account-stat-label">Needs attention</span><span class="account-stat-value account-stat-unhealthy">' + String(unhealthyCount) + '</span></div><div class="account-stat-card account-stat-card-inline"><span class="account-stat-label">Suspended</span><span class="account-stat-value">' + String(suspendedCount) + '</span></div></div></div><div class="account-overview-secondary"><div class="overview-side-card overview-side-card-primary"><div class="account-panel-kicker">Next move</div><h4>' + escapeHTML(nextStepTitle) + "</h4><p>" + escapeHTML(nextStepCopy) + "</p>" + nextStepChecklist + nextStepActions + "</div>" + renderAttentionPanel(workspaces) + "</div></div></section>";
}
function renderAccountWorkspaceSection(account, accountAPIBasePath) {
var workspaces = Array.isArray(account.workspaces) ? account.workspaces : [];
- var healthyCount = countWorkspacesByHealth(workspaces, "healthy");
+ var readyCount = countReadyWorkspaces(workspaces);
var checkingCount = countWorkspacesByHealth(workspaces, "checking");
var unhealthyCount = countWorkspacesByHealth(workspaces, "unhealthy");
+ var suspendedCount = countWorkspacesByState(workspaces, "suspended");
var workspaceManagement = "";
var addWorkspaceForm = "";
var workspaceHeaderActions = "";
@@ -1851,7 +1863,7 @@
workspaceDeskActions += '<button type="button" class="btn-secondary btn-compact" data-action="toggle-team" data-account-id="' + escapeAttr(account.id) + '" data-shell-target="team">Manage team</button>';
workspaceManagement = '<section class="workspace-management-panel" id="workspace-management-' + escapeAttr(account.id) + '"><div class="workspace-management-header"><div><div class="account-panel-kicker">Workspace management</div><h3>Review one workspace at a time</h3><p>Select a workspace from the fleet to review its lifecycle state and run explicit management actions.</p></div><button type="button" class="btn-secondary btn-compact" id="workspace-management-close-' + escapeAttr(account.id) + '" data-action="clear-workspace-selection" data-account-id="' + escapeAttr(account.id) + '">Done</button></div><div class="workspace-management-empty" id="workspace-management-empty-' + escapeAttr(account.id) + '"><div class="workspace-management-empty-copy">Pick a workspace to open its operator desk.</div><div class="workspace-management-empty-grid"><div class="workspace-management-empty-card"><div class="account-panel-kicker">Account desk</div><h4>Keep account actions close</h4><p>Workspace review happens here while billing, team, and create-workspace actions stay within reach.</p><div class="workspace-management-empty-actions">' + workspaceDeskActions + "</div>" + addWorkspaceForm + '</div><div class="workspace-management-empty-card workspace-management-empty-card-muted"><div class="account-panel-kicker">Desk flow</div><div class="workspace-management-empty-checklist"><div class="workspace-management-empty-check"><strong>Pick the workspace</strong><span>Select a fleet row to load its health, lifecycle, and next management action.</span></div><div class="workspace-management-empty-check"><strong>Read posture first</strong><span>Treat checking or needs-attention workspaces as review work, not routine operations.</span></div><div class="workspace-management-empty-check"><strong>Escalate account changes separately</strong><span>Billing and team changes stay account-wide even when you are focused on one workspace.</span></div></div></div></div></div><div class="workspace-management-content" id="workspace-management-content-' + escapeAttr(account.id) + '" hidden><div class="workspace-management-meta" id="workspace-management-meta-' + escapeAttr(account.id) + '"></div><h4 id="workspace-management-title-' + escapeAttr(account.id) + '"></h4><p class="workspace-management-summary" id="workspace-management-summary-' + escapeAttr(account.id) + '"></p><div class="workspace-management-facts"><div class="workspace-management-fact"><span>Health</span><strong id="workspace-management-health-' + escapeAttr(account.id) + '"></strong></div><div class="workspace-management-fact"><span>Lifecycle</span><strong id="workspace-management-lifecycle-' + escapeAttr(account.id) + '"></strong></div><div class="workspace-management-fact"><span>Created</span><strong id="workspace-management-created-' + escapeAttr(account.id) + '"></strong></div></div><div class="workspace-management-guidance" id="workspace-management-guidance-' + escapeAttr(account.id) + '"></div><div class="workspace-management-actions"><button type="button" class="btn-danger" id="workspace-management-action-' + escapeAttr(account.id) + '" data-action="workspace-action" data-account-id="' + escapeAttr(account.id) + '">Manage workspace</button></div></div></section>';
}
- var workspaceHTML = workspaces.length ? '<div class="workspace-list-wrap"><div class="workspace-list-toolbar"><div class="workspace-list-summary">Review the hosted fleet, open a workspace, and keep lifecycle actions explicit.</div><div class="workspace-list-stats"><span class="workspace-list-stat"><strong>' + String(workspaces.length) + '</strong> total</span><span class="workspace-list-stat"><strong>' + String(healthyCount) + '</strong> healthy</span><span class="workspace-list-stat"><strong>' + String(checkingCount) + '</strong> checking</span><span class="workspace-list-stat workspace-list-stat-attention"><strong>' + String(unhealthyCount) + '</strong> needs attention</span></div></div><div class="workspace-list-head"><span>Workspace</span><span>Health</span><span>Lifecycle</span><span>Actions</span></div><div class="workspace-list">' + workspaces.map(function(workspace) {
+ var workspaceHTML = workspaces.length ? '<div class="workspace-list-wrap"><div class="workspace-list-toolbar"><div class="workspace-list-summary">Review the hosted fleet, open a workspace, and keep lifecycle actions explicit.</div><div class="workspace-list-stats"><span class="workspace-list-stat"><strong>' + String(workspaces.length) + '</strong> total</span><span class="workspace-list-stat"><strong>' + String(readyCount) + '</strong> ready</span><span class="workspace-list-stat"><strong>' + String(checkingCount) + '</strong> checking</span><span class="workspace-list-stat workspace-list-stat-attention"><strong>' + String(unhealthyCount) + '</strong> needs attention</span><span class="workspace-list-stat"><strong>' + String(suspendedCount) + '</strong> suspended</span></div></div><div class="workspace-list-head"><span>Workspace</span><span>Health</span><span>Lifecycle</span><span>Actions</span></div><div class="workspace-list">' + workspaces.map(function(workspace) {
return renderWorkspaceCard(account, workspace, accountAPIBasePath);
}).join("") + "</div></div>" : '<div class="empty-state"><p>No hosted workspaces yet. Create one to get started.</p></div>';
return '<section class="account-content-panel account-content-panel-workspaces"><div class="account-stage-header"><div class="account-stage-header-row"><div><div class="account-panel-kicker">Workspace fleet</div><h3>Hosted fleet</h3><p>Use the fleet view to open workspaces, watch health posture, and keep management actions explicit.</p></div><div class="account-stage-header-actions">' + workspaceHeaderActions + '</div></div></div><div class="workspace-operations-shell"><div class="workspace-operations-main">' + workspaceHTML + '</div><div class="workspace-operations-detail">' + workspaceManagement + "</div></div></section>";
diff --git a/internal/cloudcp/portal/frontend/src/shell_view.test.ts b/internal/cloudcp/portal/frontend/src/shell_view.test.ts
index aed9ee9f3c..e525bd3c39 100644
--- a/internal/cloudcp/portal/frontend/src/shell_view.test.ts
+++ b/internal/cloudcp/portal/frontend/src/shell_view.test.ts
@@ -157,9 +157,10 @@ describe('shell view', function() {
expect(html).toContain('Alpha Workspace');
expect(html).toContain('Beta Workspace');
expect(html).toContain('Gamma Workspace');
- expect(html).toContain('Active workspaces');
+ expect(html).toContain('Ready now');
+ expect(html).toContain('Suspended');
expect(html).toContain('Needs attention');
- expect(html).toContain('Healthy</span>');
+ expect(html).toContain('ready</span>');
expect(html).toContain('Needs attention</span>');
expect(html).toContain('Checking</span>');
expect(html).toContain('Ready for operator work');
diff --git a/internal/cloudcp/portal/frontend/src/shell_view.ts b/internal/cloudcp/portal/frontend/src/shell_view.ts
index 56cc5ce7e6..23086b955f 100644
--- a/internal/cloudcp/portal/frontend/src/shell_view.ts
+++ b/internal/cloudcp/portal/frontend/src/shell_view.ts
@@ -91,6 +91,16 @@ function countWorkspacesByHealth(workspaces: PortalWorkspaceSummary[], status: '
return count;
}
+function countReadyWorkspaces(workspaces: PortalWorkspaceSummary[]): number {
+ var count = 0;
+ for (var i = 0; i < workspaces.length; i += 1) {
+ if (String(workspaces[i].state || '') === 'active' && workspaceHealthState(workspaces[i]) === 'healthy') {
+ count += 1;
+ }
+ }
+ return count;
+}
+
function healthBadgeHTML(workspace: PortalWorkspaceSummary): string {
var status = workspaceHealthState(workspace);
if (status === 'healthy') {
@@ -314,10 +324,12 @@ function renderWorkspaceCard(account: PortalAccountSummary, workspace: PortalWor
function renderAccountOverviewSection(account: PortalAccountSummary): string {
var workspaces = Array.isArray(account.workspaces) ? account.workspaces : [];
+ var totalCount = workspaces.length;
+ var readyCount = countReadyWorkspaces(workspaces);
var healthyCount = countWorkspacesByHealth(workspaces, 'healthy');
var checkingCount = countWorkspacesByHealth(workspaces, 'checking');
var unhealthyCount = countWorkspacesByHealth(workspaces, 'unhealthy');
- var activeCount = countWorkspacesByState(workspaces, 'active');
+ var suspendedCount = countWorkspacesByState(workspaces, 'suspended');
var postureTitle = unhealthyCount > 0
? 'Hosted posture needs review'
: checkingCount > 0
@@ -389,12 +401,12 @@ function renderAccountOverviewSection(account: PortalAccountSummary): string {
'</div>' +
'<div class="account-metric-strip">' +
'<div class="account-stat-card account-stat-card-inline">' +
- '<span class="account-stat-label">Active workspaces</span>' +
- '<span class="account-stat-value">' + String(activeCount) + '</span>' +
+ '<span class="account-stat-label">Total</span>' +
+ '<span class="account-stat-value">' + String(totalCount) + '</span>' +
'</div>' +
'<div class="account-stat-card account-stat-card-inline">' +
- '<span class="account-stat-label">Healthy</span>' +
- '<span class="account-stat-value account-stat-healthy">' + String(healthyCount) + '</span>' +
+ '<span class="account-stat-label">Ready now</span>' +
+ '<span class="account-stat-value account-stat-healthy">' + String(readyCount) + '</span>' +
'</div>' +
'<div class="account-stat-card account-stat-card-inline">' +
'<span class="account-stat-label">Checking</span>' +
@@ -404,6 +416,10 @@ function renderAccountOverviewSection(account: PortalAccountSummary): string {
'<span class="account-stat-label">Needs attention</span>' +
'<span class="account-stat-value account-stat-unhealthy">' + String(unhealthyCount) + '</span>' +
'</div>' +
+ '<div class="account-stat-card account-stat-card-inline">' +
+ '<span class="account-stat-label">Suspended</span>' +
+ '<span class="account-stat-value">' + String(suspendedCount) + '</span>' +
+ '</div>' +
'</div>' +
'</div>' +
'<div class="account-overview-secondary">' +
@@ -423,9 +439,10 @@ function renderAccountOverviewSection(account: PortalAccountSummary): string {
function renderAccountWorkspaceSection(account: PortalAccountSummary, accountAPIBasePath: string): string {
var workspaces = Array.isArray(account.workspaces) ? account.workspaces : [];
- var healthyCount = countWorkspacesByHealth(workspaces, 'healthy');
+ var readyCount = countReadyWorkspaces(workspaces);
var checkingCount = countWorkspacesByHealth(workspaces, 'checking');
var unhealthyCount = countWorkspacesByHealth(workspaces, 'unhealthy');
+ var suspendedCount = countWorkspacesByState(workspaces, 'suspended');
var workspaceManagement = '';
var addWorkspaceForm = '';
var workspaceHeaderActions = '';
@@ -572,9 +589,10 @@ function renderAccountWorkspaceSection(account: PortalAccountSummary, accountAPI
'<div class="workspace-list-summary">Review the hosted fleet, open a workspace, and keep lifecycle actions explicit.</div>' +
'<div class="workspace-list-stats">' +
'<span class="workspace-list-stat"><strong>' + String(workspaces.length) + '</strong> total</span>' +
- '<span class="workspace-list-stat"><strong>' + String(healthyCount) + '</strong> healthy</span>' +
+ '<span class="workspace-list-stat"><strong>' + String(readyCount) + '</strong> ready</span>' +
'<span class="workspace-list-stat"><strong>' + String(checkingCount) + '</strong> checking</span>' +
'<span class="workspace-list-stat workspace-list-stat-attention"><strong>' + String(unhealthyCount) + '</strong> needs attention</span>' +
+ '<span class="workspace-list-stat"><strong>' + String(suspendedCount) + '</strong> suspended</span>' +
'</div>' +
'</div>' +
'<div class="workspace-list-head">' +
diff --git a/internal/cloudcp/portal/frontend/src/styles.css b/internal/cloudcp/portal/frontend/src/styles.css
index 86db7aea7a..501efe4637 100644
--- a/internal/cloudcp/portal/frontend/src/styles.css
+++ b/internal/cloudcp/portal/frontend/src/styles.css
@@ -705,7 +705,7 @@ header .logout-btn:hover,
.account-metric-strip {
display: grid;
- grid-template-columns: repeat(4, minmax(0, 1fr));
+ grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
gap: 12px;
}