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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
fix(portal): make hosted account states intentional
Richard Courtman648701a83873
diff --git a/internal/cloudcp/portal/dist/build_manifest.json b/internal/cloudcp/portal/dist/build_manifest.jsonindex 29da1b9e25..61bdcd2344 100644--- a/internal/cloudcp/portal/dist/build_manifest.json+++ b/internal/cloudcp/portal/dist/build_manifest.json@@ -1,5 +1,5 @@{- "source_hash": "f7ebee392040465797d0eeeae892c4809c1cbdde04e746c84ea4369fde2ae34a",+ "source_hash": "918ada89ef87e6fc50df48b964eb2ebce6fc24b6d151c2823c062761fa33748f","build_inputs": ["package.json","tsconfig.json",diff --git a/internal/cloudcp/portal/dist/portal_app.css b/internal/cloudcp/portal/dist/portal_app.cssindex 70fb7d87b8..a2978070a0 100644--- a/internal/cloudcp/portal/dist/portal_app.css+++ b/internal/cloudcp/portal/dist/portal_app.css@@ -58,7 +58,7 @@ header .logout-btn:hover {}.account-header {display: flex;- align-items: center;+ align-items: flex-start;gap: 12px;margin-bottom: 16px;}@@ -67,6 +67,20 @@ header .logout-btn:hover {font-size: 20px;font-weight: 700;}+.account-heading {+ min-width: 0;+}+.account-heading-row {+ display: flex;+ align-items: center;+ gap: 12px;+ flex-wrap: wrap;+}+.account-summary {+ margin: 6px 0 0;+ font-size: 13px;+ color: #64748b;+}.badge {font-size: 11px;font-weight: 600;@@ -201,6 +215,9 @@ header .logout-btn:hover {background: #f8fafc;border-color: #94a3b8;}+.btn-secondary-quiet {+ color: #475569;+}.btn-danger {background: #fff;color: #dc2626;@@ -402,6 +419,15 @@ header .logout-btn:hover {font-size: 15px;color: #0f172a;}+.intro-guidance {+ margin-top: 16px;+ padding: 12px 14px;+ background: rgba(255, 255, 255, .9);+ border: 1px solid #dbe4f0;+ border-radius: 12px;+ font-size: 13px;+ color: #475569;+}.service-section {margin-top: 40px;}@@ -626,6 +652,10 @@ header .logout-btn:hover {.empty-state-spaced {margin-top: 48px;}+.empty-state-account {+ text-align: left;+ padding: 20px 22px;+}.empty-state-self-hosted p + p {margin-top: 12px;}diff --git a/internal/cloudcp/portal/dist/portal_app.js b/internal/cloudcp/portal/dist/portal_app.jsindex 320ff5d62c..887b42211c 100644--- a/internal/cloudcp/portal/dist/portal_app.js+++ b/internal/cloudcp/portal/dist/portal_app.js@@ -1370,6 +1370,9 @@function hasHostedAccounts(bootstrap) {return Array.isArray(bootstrap.accounts) && bootstrap.accounts.length > 0;}+ function listAccounts(bootstrap) {+ return Array.isArray(bootstrap.accounts) ? bootstrap.accounts : [];+ }function escapeHTML(value) {return String(value || "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");}@@ -1388,19 +1391,50 @@if (role === "tech") return '<span class="badge badge-role">Tech</span>';return "";}+ function formatRoleLabel(role) {+ if (role === "owner") return "Owner";+ if (role === "admin") return "Admin";+ if (role === "tech") return "Tech";+ if (role === "read_only") return "Read-only";+ return "Member";+ }+ function formatAccountAccessLabel(accounts) {+ if (accounts.length === 1) {+ if (accounts[0].kind === "msp") return "MSP operator";+ if (accounts[0].kind === "cloud" || accounts[0].kind === "individual") return "Pulse Cloud";+ }+ return "Hosted access";+ }+ function totalWorkspaceCount(accounts) {+ return accounts.reduce(function(total, account) {+ return total + (Array.isArray(account.workspaces) ? account.workspaces.length : 0);+ }, 0);+ }+ function totalActiveWorkspaceCount(accounts) {+ return accounts.reduce(function(total, account) {+ return total + (Array.isArray(account.workspaces) ? account.workspaces.filter(function(workspace) {+ return workspace.state === "active";+ }).length : 0);+ }, 0);+ }+ function formatAccountSummary(account) {+ var workspaceCount = Array.isArray(account.workspaces) ? account.workspaces.length : 0;+ var workspaceLabel = workspaceCount === 1 ? "1 workspace" : String(workspaceCount) + " workspaces";+ return account.kind_label + " account \xB7 " + formatRoleLabel(account.role) + " \xB7 " + workspaceLabel;+ }function renderWorkspaceCard(account, workspace, accountAPIBasePath) {var state = String(workspace.state || "");var safeState = escapeHTML(state);var createdLabel = formatWorkspaceDate(workspace.created_at);var openAction = "";if (state === "active") {- openAction = '<form method="POST" action="' + escapeAttr(accountAPIBasePath + "/" + account.id + "/tenants/" + workspace.id + "/handoff") + '"><button type="submit" class="btn-primary">Open \u2192</button></form>';+ openAction = '<form method="POST" action="' + escapeAttr(accountAPIBasePath + "/" + account.id + "/tenants/" + workspace.id + "/handoff") + '"><button type="submit" class="btn-primary">Open workspace</button></form>';} else {openAction = '<span class="workspace-state-label">' + safeState + "</span>";}var manageAction = "";if (account.can_manage && (state === "active" || state === "suspended" || state === "failed")) {- manageAction = '<button type="button" class="btn-danger" data-action="workspace-manage" data-account-id="' + escapeAttr(account.id) + '" data-workspace-id="' + escapeAttr(workspace.id) + '" data-workspace-state="' + escapeAttr(state) + '" data-workspace-name="' + escapeAttr(workspace.display_name) + '">\u22EF</button>';+ manageAction = '<button type="button" class="btn-secondary btn-secondary-quiet" data-action="workspace-manage" data-account-id="' + escapeAttr(account.id) + '" data-workspace-id="' + escapeAttr(workspace.id) + '" data-workspace-state="' + escapeAttr(state) + '" data-workspace-name="' + escapeAttr(workspace.display_name) + '">Manage</button>';}var createdMeta = createdLabel ? '<span class="ws-created">Created ' + escapeHTML(createdLabel) + "</span>" : "";return '<div class="workspace-card"><div class="ws-info"><span class="ws-name">' + escapeHTML(workspace.display_name) + '</span><div class="ws-meta">' + (workspace.healthy ? '<span class="badge badge-healthy">Healthy</span>' : '<span class="badge badge-unhealthy">Checking</span>') + '<span class="badge badge-' + safeState + '">' + safeState + "</span>" + createdMeta + '</div></div><div class="ws-actions">' + openAction + manageAction + "</div></div>";@@ -1409,7 +1443,7 @@var workspaces = Array.isArray(account.workspaces) ? account.workspaces : [];var workspaceHTML = "";if (workspaces.length === 0) {- workspaceHTML = '<div class="empty-state"><p>No workspaces yet. Create one to get started.</p></div>';+ workspaceHTML = '<div class="empty-state empty-state-account"><p class="empty-state-title">' + (account.kind === "msp" ? "No client workspaces yet" : "No hosted workspaces yet") + "</p><p>" + (account.kind === "msp" ? "Create a workspace when you are ready to onboard a customer environment." : "This account is ready for hosted access, but no workspace has been provisioned yet.") + "</p></div>";} else {workspaceHTML = '<div class="workspace-list">' + workspaces.map(function(workspace) {return renderWorkspaceCard(account, workspace, accountAPIBasePath);@@ -1425,7 +1459,7 @@addWorkspaceForm = '<div class="add-workspace-form" id="add-ws-form-' + escapeAttr(account.id) + '"><label for="ws-name-' + escapeAttr(account.id) + '">Workspace name (e.g. client name)</label><input type="text" id="ws-name-' + escapeAttr(account.id) + '" placeholder="Acme Corp" maxlength="80" autocomplete="off"><div class="form-actions"><button type="button" class="btn-primary" data-action="create-workspace" data-account-id="' + escapeAttr(account.id) + '">Create workspace</button><button type="button" class="btn-secondary" data-action="toggle-add-workspace" data-account-id="' + escapeAttr(account.id) + '">Cancel</button><div class="spinner" id="ws-spinner-' + escapeAttr(account.id) + '" hidden></div></div></div>';}}- return '<section class="account-section"><div class="account-header"><h2>' + escapeHTML(account.name) + '</h2><span class="badge badge-' + escapeHTML(account.kind) + '">' + escapeHTML(account.kind_label) + "</span>" + roleBadgeHTML(account.role) + "</div>" + workspaceHTML + actions + teamSection + addWorkspaceForm + "</section>";+ return '<section class="account-section"><div class="account-header"><div class="account-heading"><div class="account-heading-row"><h2>' + escapeHTML(account.name) + '</h2><span class="badge badge-' + escapeHTML(account.kind) + '">' + escapeHTML(account.kind_label) + "</span>" + roleBadgeHTML(account.role) + '</div><p class="account-summary">' + escapeHTML(formatAccountSummary(account)) + "</p></div></div>" + workspaceHTML + actions + teamSection + addWorkspaceForm + "</section>";}function renderHeaderHTML(context) {if (context.bootstrap.authenticated) {@@ -1443,14 +1477,18 @@}).join("");}function renderAuthenticatedIntroHTML(context) {+ var accounts = listAccounts(context.bootstrap);if (!hasHostedAccounts(context.bootstrap)) {return '<section class="intro-card intro-card-self-hosted"><h1>Pulse Account</h1><p>This account currently uses Pulse Account for self-hosted commercial services. When you own hosted Cloud workspaces or MSP access, they will appear here in the same account shell.</p><div class="overview-grid"><div class="overview-stat"><span class="overview-label">Signed in as</span><strong>' + escapeHTML(context.bootstrap.email || "") + '</strong></div><div class="overview-stat"><span class="overview-label">Hosted access</span><strong>None on this account</strong></div><div class="overview-stat"><span class="overview-label">Self-hosted services</span><strong>Available below</strong></div></div></section>';}- return '<section class="intro-card"><h1>Pulse Account</h1><p>Manage Cloud workspaces, MSP access, and self-hosted commercial account services from one account surface. Hosted workspace lifecycle lives here today, and the self-hosted billing, license recovery, refund, and privacy tools below now share the same Pulse Account shell instead of staying fragmented across public utility pages.</p></section>';+ var totalWorkspaces = totalWorkspaceCount(accounts);+ var activeWorkspaces = totalActiveWorkspaceCount(accounts);+ var accessLabel = formatAccountAccessLabel(accounts);+ return '<section class="intro-card"><h1>Pulse Account</h1><p>Hosted access is active on this account. Open workspaces here, manage team and billing at the account level, and keep self-hosted commercial tools in the same account surface instead of splitting them across public utility pages.</p><div class="overview-grid"><div class="overview-stat"><span class="overview-label">Signed in as</span><strong>' + escapeHTML(context.bootstrap.email || "") + '</strong></div><div class="overview-stat"><span class="overview-label">Account access</span><strong>' + escapeHTML(accessLabel) + '</strong></div><div class="overview-stat"><span class="overview-label">Hosted workspaces</span><strong>' + escapeHTML(String(totalWorkspaces)) + '</strong></div><div class="overview-stat"><span class="overview-label">Active now</span><strong>' + escapeHTML(String(activeWorkspaces)) + '</strong></div></div><div class="intro-guidance">Use <strong>Open workspace</strong> to enter a hosted Pulse runtime. Team, workspace lifecycle, and billing controls stay with each account card below.</div></section>';}function renderAuthenticatedPortalHTML(context) {var hostedAccounts = hasHostedAccounts(context.bootstrap);- return renderAuthenticatedIntroHTML(context) + '<div id="accounts-root">' + renderAccountsHTML(context) + '</div><section class="service-section"><div class="service-header"><h2>' + (hostedAccounts ? "Other account services" : "Self-hosted account services") + '</h2><div class="service-note">' + (hostedAccounts ? "Self-hosted commercial account actions now live here. The public utility pages remain as compatibility entry points, not the primary account surface." : "Use these tools for subscription, license, refund, and privacy actions on self-hosted commercial accounts. The public utility pages remain as compatibility entry points only.") + '</div></div><div class="service-grid"><button class="service-card service-card-button" type="button" id="open-manage-service" data-account-service-action="open-service-panel" data-account-service-panel="manage-service-panel" data-account-service-focus="manage-inline-email"><h3>Manage subscriptions</h3><p>Open Stripe billing access for existing self-hosted subscriptions without leaving the Pulse Account shell.</p></button><button class="service-card service-card-button" type="button" id="open-retrieve-service" data-account-service-action="open-service-panel" data-account-service-panel="retrieve-service-panel" data-account-service-focus="retrieve-inline-email"><h3>Retrieve licenses</h3><p>Recover the latest active self-hosted license and invoice link for a commercial email address.</p></button><button class="service-card service-card-button" type="button" id="open-refund-service" data-account-service-action="open-service-panel" data-account-service-panel="refund-service-panel" data-account-service-focus="refund-inline-email"><h3>Refund requests</h3><p>Request an immediate self-serve refund for eligible self-hosted purchases with explicit revocation confirmation.</p></button><button class="service-card service-card-button" type="button" id="open-data-service" data-account-service-action="open-service-panel" data-account-service-panel="data-service-panel" data-account-service-focus="data-export-email"><h3>Data and privacy</h3><p>Request commercial data export or deletion without leaving the account shell.</p></button></div><div class="service-panel" id="manage-service-panel"><div id="manage-service-root"></div></div><div class="service-panel" id="retrieve-service-panel"><div id="retrieve-service-root"></div></div><div class="service-panel" id="refund-service-panel"><div id="refund-service-root"></div></div><div class="service-panel" id="data-service-panel"><h3>Data and privacy</h3><p>Request export or deletion of the commercial data tied to an email address. Payment data held directly by Stripe still requires support handling.</p><div class="subsection"><div id="data-export-root"></div></div><div class="subsection"><div id="data-delete-root"></div></div><div class="helper-text">Payment-card data stays with Stripe. For Stripe deletion support, contact <a href="mailto:' + escapeAttr(context.bootstrap.support_email || "") + '">' + escapeHTML(context.bootstrap.support_email || "") + "</a>.</div></div></section>";+ return renderAuthenticatedIntroHTML(context) + '<div id="accounts-root">' + renderAccountsHTML(context) + '</div><section class="service-section"><div class="service-header"><h2>' + (hostedAccounts ? "Self-hosted licenses and billing" : "Self-hosted account services") + '</h2><div class="service-note">' + (hostedAccounts ? "These tools stay available on the same account for self-hosted subscriptions, license recovery, refunds, and privacy actions. Hosted workspace administration stays above." : "Use these tools for subscription, license, refund, and privacy actions on self-hosted commercial accounts. The public utility pages remain as compatibility entry points only.") + '</div></div><div class="service-grid"><button class="service-card service-card-button" type="button" id="open-manage-service" data-account-service-action="open-service-panel" data-account-service-panel="manage-service-panel" data-account-service-focus="manage-inline-email"><h3>Manage subscriptions</h3><p>Open Stripe billing access for existing self-hosted subscriptions without leaving the Pulse Account shell.</p></button><button class="service-card service-card-button" type="button" id="open-retrieve-service" data-account-service-action="open-service-panel" data-account-service-panel="retrieve-service-panel" data-account-service-focus="retrieve-inline-email"><h3>Retrieve licenses</h3><p>Recover the latest active self-hosted license and invoice link for a commercial email address.</p></button><button class="service-card service-card-button" type="button" id="open-refund-service" data-account-service-action="open-service-panel" data-account-service-panel="refund-service-panel" data-account-service-focus="refund-inline-email"><h3>Refund requests</h3><p>Request an immediate self-serve refund for eligible self-hosted purchases with explicit revocation confirmation.</p></button><button class="service-card service-card-button" type="button" id="open-data-service" data-account-service-action="open-service-panel" data-account-service-panel="data-service-panel" data-account-service-focus="data-export-email"><h3>Data and privacy</h3><p>Request commercial data export or deletion without leaving the account shell.</p></button></div><div class="service-panel" id="manage-service-panel"><div id="manage-service-root"></div></div><div class="service-panel" id="retrieve-service-panel"><div id="retrieve-service-root"></div></div><div class="service-panel" id="refund-service-panel"><div id="refund-service-root"></div></div><div class="service-panel" id="data-service-panel"><h3>Data and privacy</h3><p>Request export or deletion of the commercial data tied to an email address. Payment data held directly by Stripe still requires support handling.</p><div class="subsection"><div id="data-export-root"></div></div><div class="subsection"><div id="data-delete-root"></div></div><div class="helper-text">Payment-card data stays with Stripe. For Stripe deletion support, contact <a href="mailto:' + escapeAttr(context.bootstrap.support_email || "") + '">' + escapeHTML(context.bootstrap.support_email || "") + "</a>.</div></div></section>";}function renderSignedOutPortalHTML(context) {var statusHTML = "";diff --git a/internal/cloudcp/portal/frontend/src/shell_view.test.ts b/internal/cloudcp/portal/frontend/src/shell_view.test.tsindex 6854c94204..ee6c88ce45 100644--- a/internal/cloudcp/portal/frontend/src/shell_view.test.ts+++ b/internal/cloudcp/portal/frontend/src/shell_view.test.ts@@ -115,12 +115,19 @@ describe('shell view', function() {);expect(html).toContain('<h1>Pulse Account</h1>');+ expect(html).toContain('Hosted access is active on this account.');+ expect(html).toContain('MSP operator');+ expect(html).toContain('Hosted workspaces');expect(html).toContain('id="accounts-root"');expect(html).toContain('Acme MSP');+ expect(html).toContain('MSP account · Owner · 2 workspaces');expect(html).toContain('Alpha Workspace');expect(html).toContain('/api/accounts/acct_1/tenants/ws_active/handoff');+ expect(html).toContain('Open workspace');+ expect(html).toContain('Manage</button>');expect(html).toContain('data-action="workspace-manage"');expect(html).toContain('service-card-button');+ expect(html).toContain('Self-hosted licenses and billing');expect(html).toContain('id="open-retrieve-service"');expect(html).toContain('id="data-service-panel"');});diff --git a/internal/cloudcp/portal/frontend/src/shell_view.ts b/internal/cloudcp/portal/frontend/src/shell_view.tsindex 6f479f9373..85aeb2e66e 100644--- a/internal/cloudcp/portal/frontend/src/shell_view.ts+++ b/internal/cloudcp/portal/frontend/src/shell_view.ts@@ -16,6 +16,10 @@ function hasHostedAccounts(bootstrap: PortalBootstrapData): boolean {return Array.isArray(bootstrap.accounts) && bootstrap.accounts.length > 0;}+function listAccounts(bootstrap: PortalBootstrapData): PortalAccountSummary[] {+ return Array.isArray(bootstrap.accounts) ? bootstrap.accounts : [];+}+function escapeHTML(value: unknown): string {return String(value || '').replace(/&/g, '&')@@ -43,6 +47,42 @@ function roleBadgeHTML(role: string): string {return '';}+function formatRoleLabel(role: string): string {+ if (role === 'owner') return 'Owner';+ if (role === 'admin') return 'Admin';+ if (role === 'tech') return 'Tech';+ if (role === 'read_only') return 'Read-only';+ return 'Member';+}++function formatAccountAccessLabel(accounts: PortalAccountSummary[]): string {+ if (accounts.length === 1) {+ if (accounts[0].kind === 'msp') return 'MSP operator';+ if (accounts[0].kind === 'cloud' || accounts[0].kind === 'individual') return 'Pulse Cloud';+ }+ return 'Hosted access';+}++function totalWorkspaceCount(accounts: PortalAccountSummary[]): number {+ return accounts.reduce(function(total, account) {+ return total + (Array.isArray(account.workspaces) ? account.workspaces.length : 0);+ }, 0);+}++function totalActiveWorkspaceCount(accounts: PortalAccountSummary[]): number {+ return accounts.reduce(function(total, account) {+ return total + (Array.isArray(account.workspaces)+ ? account.workspaces.filter(function(workspace) { return workspace.state === 'active'; }).length+ : 0);+ }, 0);+}++function formatAccountSummary(account: PortalAccountSummary): string {+ var workspaceCount = Array.isArray(account.workspaces) ? account.workspaces.length : 0;+ var workspaceLabel = workspaceCount === 1 ? '1 workspace' : String(workspaceCount) + ' workspaces';+ return account.kind_label + ' account · ' + formatRoleLabel(account.role) + ' · ' + workspaceLabel;+}+function renderWorkspaceCard(account: PortalAccountSummary, workspace: PortalWorkspaceSummary, accountAPIBasePath: string): string {var state = String(workspace.state || '');var safeState = escapeHTML(state);@@ -53,7 +93,7 @@ function renderWorkspaceCard(account: PortalAccountSummary, workspace: PortalWor'<form method="POST" action="' +escapeAttr(accountAPIBasePath + '/' + account.id + '/tenants/' + workspace.id + '/handoff') +'">' +- '<button type="submit" class="btn-primary">Open →</button>' ++ '<button type="submit" class="btn-primary">Open workspace</button>' +'</form>';} else {openAction = '<span class="workspace-state-label">' + safeState + '</span>';@@ -62,7 +102,7 @@ function renderWorkspaceCard(account: PortalAccountSummary, workspace: PortalWorvar manageAction = '';if (account.can_manage && (state === 'active' || state === 'suspended' || state === 'failed')) {manageAction =- '<button type="button" class="btn-danger" data-action="workspace-manage" data-account-id="' ++ '<button type="button" class="btn-secondary btn-secondary-quiet" data-action="workspace-manage" data-account-id="' +escapeAttr(account.id) +'" data-workspace-id="' +escapeAttr(workspace.id) +@@ -70,7 +110,7 @@ function renderWorkspaceCard(account: PortalAccountSummary, workspace: PortalWorescapeAttr(state) +'" data-workspace-name="' +escapeAttr(workspace.display_name) +- '">⋯</button>';+ '">Manage</button>';}var createdMeta = createdLabel ? '<span class="ws-created">Created ' + escapeHTML(createdLabel) + '</span>' : '';@@ -98,7 +138,17 @@ function renderAccountSection(account: PortalAccountSummary, accountAPIBasePath:var workspaces = Array.isArray(account.workspaces) ? account.workspaces : [];var workspaceHTML = '';if (workspaces.length === 0) {- workspaceHTML = '<div class="empty-state"><p>No workspaces yet. Create one to get started.</p></div>';+ workspaceHTML =+ '<div class="empty-state empty-state-account">' ++ '<p class="empty-state-title">' ++ (account.kind === 'msp' ? 'No client workspaces yet' : 'No hosted workspaces yet') ++ '</p>' ++ '<p>' ++ (account.kind === 'msp'+ ? 'Create a workspace when you are ready to onboard a customer environment.'+ : 'This account is ready for hosted access, but no workspace has been provisioned yet.') ++ '</p>' ++ '</div>';} else {workspaceHTML ='<div class="workspace-list">' +@@ -194,9 +244,14 @@ function renderAccountSection(account: PortalAccountSummary, accountAPIBasePath:return ('<section class="account-section">' +'<div class="account-header">' +- '<h2>' + escapeHTML(account.name) + '</h2>' +- '<span class="badge badge-' + escapeHTML(account.kind) + '">' + escapeHTML(account.kind_label) + '</span>' +- roleBadgeHTML(account.role) ++ '<div class="account-heading">' ++ '<div class="account-heading-row">' ++ '<h2>' + escapeHTML(account.name) + '</h2>' ++ '<span class="badge badge-' + escapeHTML(account.kind) + '">' + escapeHTML(account.kind_label) + '</span>' ++ roleBadgeHTML(account.role) ++ '</div>' ++ '<p class="account-summary">' + escapeHTML(formatAccountSummary(account)) + '</p>' ++ '</div>' +'</div>' +workspaceHTML +actions +@@ -237,6 +292,7 @@ export function renderAccountsHTML(context: ShellViewContext): string {}function renderAuthenticatedIntroHTML(context: ShellViewContext): string {+ var accounts = listAccounts(context.bootstrap);if (!hasHostedAccounts(context.bootstrap)) {return ('<section class="intro-card intro-card-self-hosted">' +@@ -260,10 +316,32 @@ function renderAuthenticatedIntroHTML(context: ShellViewContext): string {);}+ var totalWorkspaces = totalWorkspaceCount(accounts);+ var activeWorkspaces = totalActiveWorkspaceCount(accounts);+ var accessLabel = formatAccountAccessLabel(accounts);return ('<section class="intro-card">' +'<h1>Pulse Account</h1>' +- '<p>Manage Cloud workspaces, MSP access, and self-hosted commercial account services from one account surface. Hosted workspace lifecycle lives here today, and the self-hosted billing, license recovery, refund, and privacy tools below now share the same Pulse Account shell instead of staying fragmented across public utility pages.</p>' ++ '<p>Hosted access is active on this account. Open workspaces here, manage team and billing at the account level, and keep self-hosted commercial tools in the same account surface instead of splitting them across public utility pages.</p>' ++ '<div class="overview-grid">' ++ '<div class="overview-stat">' ++ '<span class="overview-label">Signed in as</span>' ++ '<strong>' + escapeHTML(context.bootstrap.email || '') + '</strong>' ++ '</div>' ++ '<div class="overview-stat">' ++ '<span class="overview-label">Account access</span>' ++ '<strong>' + escapeHTML(accessLabel) + '</strong>' ++ '</div>' ++ '<div class="overview-stat">' ++ '<span class="overview-label">Hosted workspaces</span>' ++ '<strong>' + escapeHTML(String(totalWorkspaces)) + '</strong>' ++ '</div>' ++ '<div class="overview-stat">' ++ '<span class="overview-label">Active now</span>' ++ '<strong>' + escapeHTML(String(activeWorkspaces)) + '</strong>' ++ '</div>' ++ '</div>' ++ '<div class="intro-guidance">Use <strong>Open workspace</strong> to enter a hosted Pulse runtime. Team, workspace lifecycle, and billing controls stay with each account card below.</div>' +'</section>');}@@ -275,10 +353,10 @@ export function renderAuthenticatedPortalHTML(context: ShellViewContext): string'<div id="accounts-root">' + renderAccountsHTML(context) + '</div>' +'<section class="service-section">' +'<div class="service-header">' +- '<h2>' + (hostedAccounts ? 'Other account services' : 'Self-hosted account services') + '</h2>' ++ '<h2>' + (hostedAccounts ? 'Self-hosted licenses and billing' : 'Self-hosted account services') + '</h2>' +'<div class="service-note">' +(hostedAccounts- ? 'Self-hosted commercial account actions now live here. The public utility pages remain as compatibility entry points, not the primary account surface.'+ ? 'These tools stay available on the same account for self-hosted subscriptions, license recovery, refunds, and privacy actions. Hosted workspace administration stays above.': 'Use these tools for subscription, license, refund, and privacy actions on self-hosted commercial accounts. The public utility pages remain as compatibility entry points only.') +'</div>' +'</div>' +diff --git a/internal/cloudcp/portal/frontend/src/styles.css b/internal/cloudcp/portal/frontend/src/styles.cssindex cc58eea16c..f5cbae514f 100644--- a/internal/cloudcp/portal/frontend/src/styles.css+++ b/internal/cloudcp/portal/frontend/src/styles.css@@ -8,8 +8,11 @@header .logout-btn:hover { border-color: #94a3b8; color: #f8fafc; }.main { max-width: 860px; margin: 32px auto; padding: 0 16px 48px; }.account-section { margin-bottom: 40px; }- .account-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }+ .account-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }.account-header h2 { margin: 0; font-size: 20px; font-weight: 700; }+ .account-heading { min-width: 0; }+ .account-heading-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }+ .account-summary { margin: 6px 0 0; font-size: 13px; color: #64748b; }.badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.5px; }.badge-msp { background: #dbeafe; color: #1e40af; }.badge-cloud { background: #dcfce7; color: #166534; }@@ -34,6 +37,7 @@.btn-primary:hover { background: #1e40af; }.btn-secondary { background: #fff; color: #334155; border: 1px solid #cbd5e1; border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer; }.btn-secondary:hover { background: #f8fafc; border-color: #94a3b8; }+ .btn-secondary-quiet { color: #475569; }.btn-danger { background: #fff; color: #dc2626; border: 1px solid #fca5a5; border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; }.btn-danger:hover { background: #fef2f2; }.btn-compact { padding: 8px 14px; font-size: 13px; }@@ -67,6 +71,7 @@.overview-stat { background: rgba(255,255,255,.9); border: 1px solid #dbe4f0; border-radius: 12px; padding: 14px 16px; }.overview-label { display: block; font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }.overview-stat strong { display: block; font-size: 15px; color: #0f172a; }+ .intro-guidance { margin-top: 16px; padding: 12px 14px; background: rgba(255,255,255,.9); border: 1px solid #dbe4f0; border-radius: 12px; font-size: 13px; color: #475569; }.service-section { margin-top: 40px; }.service-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }.service-header h2 { margin: 0; font-size: 20px; font-weight: 700; }@@ -107,6 +112,7 @@.empty-state { background: #fff; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 32px; text-align: center; color: #64748b; }.empty-state p { margin: 0; font-size: 15px; }.empty-state-spaced { margin-top: 48px; }+ .empty-state-account { text-align: left; padding: 20px 22px; }.empty-state-self-hosted p + p { margin-top: 12px; }.empty-state-title { font-weight: 700; color: #0f172a; }.support-copy { margin-top: 12px; font-size: 13px; }diff --git a/internal/cloudcp/routes_auth_test.go b/internal/cloudcp/routes_auth_test.goindex 848055301f..f755d387ee 100644--- a/internal/cloudcp/routes_auth_test.go+++ b/internal/cloudcp/routes_auth_test.go@@ -440,8 +440,9 @@ func TestRegisterRoutes_PortalPageSessionModes(t *testing.T) {`id="pulse-account-bootstrap"`,`id="portal-app-root"`,`"authenticated":true`,- "Other account services",- "self-hosted billing, license recovery, refund, and privacy tools below now share the same Pulse Account shell",+ "Hosted access is active on this account.",+ "Self-hosted licenses and billing",+ "Hosted workspace administration stays above.",} {if !strings.Contains(authRec.Body.String(), needle) {t.Fatalf("expected authenticated portal page to contain %q, body=%q", needle, authRec.Body.String())