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): enrich navigation context

rcourtman12ea61d4c18e
diff --git a/internal/cloudcp/portal/dist/build_manifest.json b/internal/cloudcp/portal/dist/build_manifest.json
index f086d3da71..1e2febe0b1 100644
--- a/internal/cloudcp/portal/dist/build_manifest.json
+++ b/internal/cloudcp/portal/dist/build_manifest.json
@@ -1,5 +1,5 @@
{
- "source_hash": "c3c8a6b6f4d931167938c009ffbe5c332a770be6538c886eaea8d6d743dccc57",
+ "source_hash": "ab4a854ccc739eaaffbbfa650fe3ce3bbfcac6c02318be5e56c52f0733bc60ef",
"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 5c326d75d4..70a5944542 100644
--- a/internal/cloudcp/portal/dist/portal_app.css
+++ b/internal/cloudcp/portal/dist/portal_app.css
@@ -268,7 +268,7 @@ header .logout-btn:hover,
}
.portal-shell-layout {
display: grid;
- grid-template-columns: 188px minmax(0, 1fr);
+ grid-template-columns: 224px minmax(0, 1fr);
gap: 0;
align-items: start;
border: 1px solid var(--line);
@@ -290,8 +290,8 @@ header .logout-btn:hover,
.portal-shell-nav-header {
display: flex;
flex-direction: column;
- gap: 4px;
- padding: 12px 12px 10px;
+ gap: 5px;
+ padding: 14px 14px 12px;
border-bottom: 1px solid var(--nav-line);
}
.portal-shell-nav-eyebrow {
@@ -302,31 +302,31 @@ header .logout-btn:hover,
color: #78b6c0;
}
.portal-shell-nav-title {
- font-size: 16px;
+ font-size: 18px;
line-height: 1.02;
- letter-spacing: -0.03em;
+ letter-spacing: -0.04em;
font-weight: 800;
color: var(--nav-ink);
}
.portal-shell-nav-support {
- font-size: 10px;
- line-height: 1.4;
+ font-size: 11px;
+ line-height: 1.45;
color: var(--nav-copy);
}
.portal-shell-nav-group {
display: flex;
flex-direction: column;
- gap: 4px;
- padding: 8px;
+ gap: 6px;
+ padding: 10px;
}
.portal-shell-nav-link {
display: flex;
flex-direction: column;
- gap: 0;
+ gap: 5px;
width: 100%;
- padding: 9px 12px;
+ padding: 10px 12px;
border: none;
- border-radius: 10px;
+ border-radius: 12px;
background: transparent;
text-align: left;
cursor: pointer;
@@ -339,22 +339,48 @@ header .logout-btn:hover,
background: rgba(255, 255, 255, 0.05);
}
.portal-shell-nav-link.active {
- background: rgba(120, 182, 192, 0.14);
+ background: rgba(120, 182, 192, 0.16);
box-shadow: inset 2px 0 0 #78b6c0;
}
+.portal-shell-nav-row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+}
.portal-shell-nav-label {
display: block;
- font-size: 11px;
+ font-size: 13px;
font-weight: 700;
- letter-spacing: 0.01em;
+ letter-spacing: -0.01em;
color: var(--nav-ink);
}
+.portal-shell-nav-badge {
+ display: inline-flex;
+ align-items: center;
+ min-height: 20px;
+ padding: 0 7px;
+ border-radius: 999px;
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ background: rgba(255, 255, 255, 0.04);
+ font-size: 10px;
+ font-weight: 800;
+ letter-spacing: 0.06em;
+ text-transform: uppercase;
+ color: rgba(225, 232, 240, 0.92);
+ white-space: nowrap;
+}
.portal-shell-nav-copy {
- display: none;
- font-size: 12px;
- line-height: 1.45;
+ display: block;
+ font-size: 11px;
+ line-height: 1.4;
color: var(--nav-copy);
}
+.portal-shell-nav-link.active .portal-shell-nav-badge {
+ border-color: rgba(120, 182, 192, 0.28);
+ background: rgba(120, 182, 192, 0.16);
+ color: #dff6fa;
+}
.portal-shell-main {
min-width: 0;
padding: 0 0 24px;
diff --git a/internal/cloudcp/portal/dist/portal_app.js b/internal/cloudcp/portal/dist/portal_app.js
index 5f7d9f04fe..83e98e15ac 100644
--- a/internal/cloudcp/portal/dist/portal_app.js
+++ b/internal/cloudcp/portal/dist/portal_app.js
@@ -1721,6 +1721,16 @@
function hasHostedAccounts(accounts) {
return accounts.length > 0;
}
+ function collectWorkspaces(accounts) {
+ var results = [];
+ for (var i = 0; i < accounts.length; i += 1) {
+ var workspaces = Array.isArray(accounts[i].workspaces) ? accounts[i].workspaces : [];
+ for (var j = 0; j < workspaces.length; j += 1) {
+ results.push(workspaces[j]);
+ }
+ }
+ return results;
+ }
function countWorkspacesByState(workspaces, state) {
var count = 0;
for (var i = 0; i < workspaces.length; i += 1) {
@@ -1805,12 +1815,23 @@
var workspaceLabel = workspaceCountLabel((account.workspaces || []).length);
return '<section class="portal-account-context"><div class="portal-account-context-copy"><div class="portal-account-context-meta"><span class="account-eyebrow">' + escapeHTML(accountKindLabel(account)) + '</span><span class="portal-account-context-separator">/</span><span class="portal-account-context-access">' + escapeHTML(titleCase(account.role)) + ' access</span></div><div class="portal-account-context-row"><h2>' + escapeHTML(account.name) + '</h2><div class="portal-account-context-chips"><span class="account-context-chip">' + escapeHTML(account.kind_label) + '</span><span class="account-context-chip">' + escapeHTML(titleCase(account.role)) + '</span><span class="account-context-chip">' + escapeHTML(workspaceLabel) + "</span></div></div><p>" + escapeHTML(account.kind === "msp" ? "Operator workspace account" : "Hosted account operations") + "</p></div></section>";
}
- function shellSectionButton(section, activeSection, title, copy) {
- return '<button class="portal-shell-nav-link' + (activeSection === section ? " active" : "") + '" type="button" data-shell-action="activate-section" data-shell-section="' + section + '"><span class="portal-shell-nav-label">' + title + '</span><span class="portal-shell-nav-copy">' + copy + "</span></button>";
+ function shellSectionButton(section, activeSection, title, copy, badge) {
+ var badgeHTML = badge ? '<span class="portal-shell-nav-badge">' + escapeHTML(badge) + "</span>" : "";
+ return '<button class="portal-shell-nav-link' + (activeSection === section ? " active" : "") + '" type="button" data-shell-action="activate-section" data-shell-section="' + section + '"><span class="portal-shell-nav-row"><span class="portal-shell-nav-label">' + title + "</span>" + badgeHTML + '</span><span class="portal-shell-nav-copy">' + copy + "</span></button>";
}
function renderShellNavigation(accounts, supportEmail, activeSection) {
var hosted = hasHostedAccounts(accounts);
- return '<aside class="portal-shell-nav" aria-label="Pulse Account sections"><div class="portal-shell-nav-header"><div class="portal-shell-nav-eyebrow">Pulse Account</div><div class="portal-shell-nav-title">' + (hosted ? "Operator console" : "Account console") + '</div><div class="portal-shell-nav-support">' + (hosted ? "Hosted operations and account services" : "Commercial account services and support") + '</div></div><div class="portal-shell-nav-group">' + shellSectionButton("overview", activeSection, "Overview", hosted ? "Posture, accounts, and quick actions" : "Account summary and access state") + shellSectionButton("workspaces", activeSection, hosted ? "Workspaces" : "Hosted access", hosted ? "Hosted fleet and lifecycle actions" : "No hosted workspaces are attached yet") + shellSectionButton("team", activeSection, "Team", hosted ? "Access and operator roster" : "Account membership") + shellSectionButton("services", activeSection, "Account services", "Licenses, billing, refunds, and privacy") + shellSectionButton("support", activeSection, "Support", hosted ? "Escalation and account support" : supportEmail || "Support contact") + "</div></aside>";
+ var workspaces = collectWorkspaces(accounts);
+ var totalWorkspaces = workspaces.length;
+ var readyWorkspaces = countReadyWorkspaces(workspaces);
+ var canManage = false;
+ for (var i = 0; i < accounts.length; i += 1) {
+ if (accounts[i].can_manage) {
+ canManage = true;
+ break;
+ }
+ }
+ return '<aside class="portal-shell-nav" aria-label="Pulse Account sections"><div class="portal-shell-nav-header"><div class="portal-shell-nav-eyebrow">Pulse Account</div><div class="portal-shell-nav-title">' + (hosted ? "Operator console" : "Account console") + '</div><div class="portal-shell-nav-support">' + (hosted ? "Hosted operations and account services" : "Commercial account services and support") + '</div></div><div class="portal-shell-nav-group">' + shellSectionButton("overview", activeSection, "Overview", hosted ? "Posture, accounts, and quick actions" : "Account summary and access state", hosted ? String(totalWorkspaces) + " total" : "Summary") + shellSectionButton("workspaces", activeSection, hosted ? "Workspaces" : "Hosted access", hosted ? "Hosted fleet and lifecycle actions" : "No hosted workspaces are attached yet", hosted ? String(readyWorkspaces) + " ready" : "None") + shellSectionButton("team", activeSection, "Team", hosted ? "Access and operator roster" : "Account membership", canManage ? "Manage" : "View") + shellSectionButton("services", activeSection, "Account services", "Licenses, billing, refunds, and privacy", "4 desks") + shellSectionButton("support", activeSection, "Support", hosted ? "Escalation and account support" : supportEmail || "Support contact", supportEmail ? "Email" : "Help") + "</div></aside>";
}
function renderWorkspaceCard(account, workspace, accountAPIBasePath) {
var status = workspaceHealthState(workspace);
diff --git a/internal/cloudcp/portal/frontend/src/shell_view.test.ts b/internal/cloudcp/portal/frontend/src/shell_view.test.ts
index c0253c8a53..08f7b140d9 100644
--- a/internal/cloudcp/portal/frontend/src/shell_view.test.ts
+++ b/internal/cloudcp/portal/frontend/src/shell_view.test.ts
@@ -127,9 +127,13 @@ describe('shell view', function() {
expect(html).toContain('portal-shell-nav');
expect(html).toContain('Overview');
+ expect(html).toContain('3 total');
expect(html).toContain('Workspaces');
+ expect(html).toContain('1 ready');
expect(html).toContain('Account services');
+ expect(html).toContain('4 desks');
expect(html).toContain('Support');
+ expect(html).toContain('Manage');
expect(html).toContain('id="account-services-section"');
expect(html).toContain('Self-hosted licenses and billing');
expect(html).toContain('portal-account-context');
@@ -215,6 +219,8 @@ describe('shell view', function() {
expect(html).toContain('Pulse Account');
expect(html).toContain('Account console');
+ expect(html).toContain('Summary');
+ expect(html).toContain('None');
expect(html).toContain('Use these account tools for self-hosted licenses, billing, refunds, and privacy actions.');
expect(html).toContain('Choose one billing, license, refund, or privacy request and keep it contained here.');
expect(html).toContain('Account services');
diff --git a/internal/cloudcp/portal/frontend/src/shell_view.ts b/internal/cloudcp/portal/frontend/src/shell_view.ts
index ed7f102660..2deaa3bcc4 100644
--- a/internal/cloudcp/portal/frontend/src/shell_view.ts
+++ b/internal/cloudcp/portal/frontend/src/shell_view.ts
@@ -75,6 +75,17 @@ function countWorkspaces(accounts: PortalAccountSummary[]): number {
return total;
}
+function collectWorkspaces(accounts: PortalAccountSummary[]): PortalWorkspaceSummary[] {
+ var results: PortalWorkspaceSummary[] = [];
+ for (var i = 0; i < accounts.length; i += 1) {
+ var workspaces = Array.isArray(accounts[i].workspaces) ? accounts[i].workspaces : [];
+ for (var j = 0; j < workspaces.length; j += 1) {
+ results.push(workspaces[j]);
+ }
+ }
+ return results;
+}
+
function countWorkspacesByState(workspaces: PortalWorkspaceSummary[], state: string): number {
var count = 0;
for (var i = 0; i < workspaces.length; i += 1) {
@@ -247,10 +258,16 @@ function renderAccountContextStrip(account: PortalAccountSummary): string {
);
}
-function shellSectionButton(section: PortalShellSection, activeSection: PortalShellSection, title: string, copy: string): string {
+function shellSectionButton(section: PortalShellSection, activeSection: PortalShellSection, title: string, copy: string, badge?: string): string {
+ var badgeHTML = badge
+ ? '<span class="portal-shell-nav-badge">' + escapeHTML(badge) + '</span>'
+ : '';
return (
'<button class="portal-shell-nav-link' + (activeSection === section ? ' active' : '') + '" type="button" data-shell-action="activate-section" data-shell-section="' + section + '">' +
- '<span class="portal-shell-nav-label">' + title + '</span>' +
+ '<span class="portal-shell-nav-row">' +
+ '<span class="portal-shell-nav-label">' + title + '</span>' +
+ badgeHTML +
+ '</span>' +
'<span class="portal-shell-nav-copy">' + copy + '</span>' +
'</button>'
);
@@ -258,6 +275,16 @@ function shellSectionButton(section: PortalShellSection, activeSection: PortalSh
function renderShellNavigation(accounts: PortalAccountSummary[], supportEmail: string, activeSection: PortalShellSection): string {
var hosted = hasHostedAccounts(accounts);
+ var workspaces = collectWorkspaces(accounts);
+ var totalWorkspaces = workspaces.length;
+ var readyWorkspaces = countReadyWorkspaces(workspaces);
+ var canManage = false;
+ for (var i = 0; i < accounts.length; i += 1) {
+ if (accounts[i].can_manage) {
+ canManage = true;
+ break;
+ }
+ }
return (
'<aside class="portal-shell-nav" aria-label="Pulse Account sections">' +
'<div class="portal-shell-nav-header">' +
@@ -266,11 +293,11 @@ function renderShellNavigation(accounts: PortalAccountSummary[], supportEmail: s
'<div class="portal-shell-nav-support">' + (hosted ? 'Hosted operations and account services' : 'Commercial account services and support') + '</div>' +
'</div>' +
'<div class="portal-shell-nav-group">' +
- shellSectionButton('overview', activeSection, 'Overview', hosted ? 'Posture, accounts, and quick actions' : 'Account summary and access state') +
- shellSectionButton('workspaces', activeSection, hosted ? 'Workspaces' : 'Hosted access', hosted ? 'Hosted fleet and lifecycle actions' : 'No hosted workspaces are attached yet') +
- shellSectionButton('team', activeSection, 'Team', hosted ? 'Access and operator roster' : 'Account membership') +
- shellSectionButton('services', activeSection, 'Account services', 'Licenses, billing, refunds, and privacy') +
- shellSectionButton('support', activeSection, 'Support', hosted ? 'Escalation and account support' : (supportEmail || 'Support contact')) +
+ shellSectionButton('overview', activeSection, 'Overview', hosted ? 'Posture, accounts, and quick actions' : 'Account summary and access state', hosted ? String(totalWorkspaces) + ' total' : 'Summary') +
+ shellSectionButton('workspaces', activeSection, hosted ? 'Workspaces' : 'Hosted access', hosted ? 'Hosted fleet and lifecycle actions' : 'No hosted workspaces are attached yet', hosted ? String(readyWorkspaces) + ' ready' : 'None') +
+ shellSectionButton('team', activeSection, 'Team', hosted ? 'Access and operator roster' : 'Account membership', canManage ? 'Manage' : 'View') +
+ shellSectionButton('services', activeSection, 'Account services', 'Licenses, billing, refunds, and privacy', '4 desks') +
+ shellSectionButton('support', activeSection, 'Support', hosted ? 'Escalation and account support' : (supportEmail || 'Support contact'), supportEmail ? 'Email' : 'Help') +
'</div>' +
'</aside>'
);
diff --git a/internal/cloudcp/portal/frontend/src/styles.css b/internal/cloudcp/portal/frontend/src/styles.css
index a11e1a760b..137369d470 100644
--- a/internal/cloudcp/portal/frontend/src/styles.css
+++ b/internal/cloudcp/portal/frontend/src/styles.css
@@ -288,7 +288,7 @@ header .logout-btn:hover,
.portal-shell-layout {
display: grid;
- grid-template-columns: 188px minmax(0, 1fr);
+ grid-template-columns: 224px minmax(0, 1fr);
gap: 0;
align-items: start;
border: 1px solid var(--line);
@@ -312,8 +312,8 @@ header .logout-btn:hover,
.portal-shell-nav-header {
display: flex;
flex-direction: column;
- gap: 4px;
- padding: 12px 12px 10px;
+ gap: 5px;
+ padding: 14px 14px 12px;
border-bottom: 1px solid var(--nav-line);
}
@@ -326,34 +326,34 @@ header .logout-btn:hover,
}
.portal-shell-nav-title {
- font-size: 16px;
+ font-size: 18px;
line-height: 1.02;
- letter-spacing: -0.03em;
+ letter-spacing: -0.04em;
font-weight: 800;
color: var(--nav-ink);
}
.portal-shell-nav-support {
- font-size: 10px;
- line-height: 1.4;
+ font-size: 11px;
+ line-height: 1.45;
color: var(--nav-copy);
}
.portal-shell-nav-group {
display: flex;
flex-direction: column;
- gap: 4px;
- padding: 8px;
+ gap: 6px;
+ padding: 10px;
}
.portal-shell-nav-link {
display: flex;
flex-direction: column;
- gap: 0;
+ gap: 5px;
width: 100%;
- padding: 9px 12px;
+ padding: 10px 12px;
border: none;
- border-radius: 10px;
+ border-radius: 12px;
background: transparent;
text-align: left;
cursor: pointer;
@@ -369,25 +369,54 @@ header .logout-btn:hover,
}
.portal-shell-nav-link.active {
- background: rgba(120, 182, 192, 0.14);
+ background: rgba(120, 182, 192, 0.16);
box-shadow: inset 2px 0 0 #78b6c0;
}
+.portal-shell-nav-row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+}
+
.portal-shell-nav-label {
display: block;
- font-size: 11px;
+ font-size: 13px;
font-weight: 700;
- letter-spacing: 0.01em;
+ letter-spacing: -0.01em;
color: var(--nav-ink);
}
+.portal-shell-nav-badge {
+ display: inline-flex;
+ align-items: center;
+ min-height: 20px;
+ padding: 0 7px;
+ border-radius: 999px;
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ background: rgba(255, 255, 255, 0.04);
+ font-size: 10px;
+ font-weight: 800;
+ letter-spacing: 0.06em;
+ text-transform: uppercase;
+ color: rgba(225, 232, 240, 0.92);
+ white-space: nowrap;
+}
+
.portal-shell-nav-copy {
- display: none;
- font-size: 12px;
- line-height: 1.45;
+ display: block;
+ font-size: 11px;
+ line-height: 1.4;
color: var(--nav-copy);
}
+.portal-shell-nav-link.active .portal-shell-nav-badge {
+ border-color: rgba(120, 182, 192, 0.28);
+ background: rgba(120, 182, 192, 0.16);
+ color: #dff6fa;
+}
+
.portal-shell-main {
min-width: 0;
padding: 0 0 24px;