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.

Make self-hosted support billing-only

rcourtmanebfc4fd3c092
diff --git a/docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md b/docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md
index 8c8bd5e907..317c8276e4 100644
--- a/docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md
+++ b/docs/release-control/v6/internal/PULSE_ACCOUNT_PORTAL_SPEC.md
@@ -189,6 +189,10 @@ Core rules:
license, refund, and privacy panels should appear only when that exact
billing job is active, and opening one on phone widths must reveal the
active panel in-frame.
+27. `Support` must stay honest to account shape. Self-hosted-only accounts
+ must reduce `Support` to the billing escalation path only; hosted
+ workspace or access failure routes and task buttons must not render
+ without hosted accounts.
## Screen Model
@@ -227,7 +231,9 @@ Each signed-in state should render:
task panel should stay hidden until the user opens that exact billing job.
6. a `Support` area that is present only as an escalation path
`Support` should collapse to failed-path routing plus the minimum escalation
- packet needed for handoff.
+ packet needed for handoff. Self-hosted-only accounts must collapse further
+ to the self-hosted billing escalation path only and must not surface hosted
+ workspace or access routes.
7. explicit action groups, not anonymous menu affordances
8. explicit unavailable-state panels for top-level tasks that are not active
for the current account shape
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 63ff83af9b..643e170bd9 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -286,7 +286,11 @@ surface, and invite, role-change, or remove controls only appear when the
matching access job is active. `Billing` follows the same shared runtime
contract: hosted billing remains the default primary path, self-hosted billing
jobs open one panel at a time, and the runtime must reveal the active billing
-panel on phone-width layouts instead of leaving it offscreen.
+panel on phone-width layouts instead of leaving it offscreen. `Support`
+follows the same account-shape runtime contract: self-hosted-only accounts
+expose only the billing escalation path and billing-specific handoff packet,
+and hosted workspace/access escalation controls must not render when no hosted
+account exists.
plus a package-local `tsc --noEmit` gate, so future account-shell work should
extend the typed source boundary instead of reviving opaque global runtime
objects, document-wide render events, or untyped embedded asset edits.
diff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.md
index 47522f6b98..ac49356ca0 100644
--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md
+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md
@@ -841,7 +841,11 @@ controls appear only when that exact access job is active. `Billing` follows
the same task-first rule: hosted billing leads when present, the self-hosted
billing, license, refund, and privacy paths reduce to explicit job pickers,
and the active self-hosted billing panel must stay hidden until that exact job
-is opened and then be revealed in-frame on narrow layouts. Until that
+is opened and then be revealed in-frame on narrow layouts. `Support` follows
+the same account-shape rule: self-hosted-only accounts reduce to the billing
+escalation path and billing-specific handoff packet only, and hosted
+workspace/access escalation routes must not render without hosted accounts.
+Until that
candidate lane lands, new
commercial account work must extend the governed Pulse account shape rather
than spawning additional one-off recovery or billing pages.
diff --git a/internal/cloudcp/portal/dist/build_manifest.json b/internal/cloudcp/portal/dist/build_manifest.json
index a5ba102707..ec47023374 100644
--- a/internal/cloudcp/portal/dist/build_manifest.json
+++ b/internal/cloudcp/portal/dist/build_manifest.json
@@ -1,5 +1,5 @@
{
- "source_hash": "527e64b3ea61ad459d0dab71d0debb325570ee48455668632561762f51c77250",
+ "source_hash": "698217e718b15814bb146c8cbd7f962fc317e246a1dde1a9be3df3abc4f7c897",
"build_inputs": [
"package.json",
"tsconfig.json",
diff --git a/internal/cloudcp/portal/dist/portal_app.js b/internal/cloudcp/portal/dist/portal_app.js
index 4ee57d20a9..6f3653dc73 100644
--- a/internal/cloudcp/portal/dist/portal_app.js
+++ b/internal/cloudcp/portal/dist/portal_app.js
@@ -1430,8 +1430,9 @@
event.preventDefault();
deps.setShellSection("billing");
deps.toggleBillingPanel(panelID);
- if (typeof target.blur === "function") {
- target.blur();
+ var targetElement = target;
+ if (typeof targetElement.blur === "function") {
+ targetElement.blur();
}
deps.focusElement(focusID);
if (panelID) {
@@ -2256,7 +2257,13 @@
return '<section class="billing-panel" id="' + escapeAttr(panelID) + '" hidden><div class="billing-task-header"><div><div class="account-panel-kicker">Billing task</div><h3>' + escapeHTML(title) + "</h3><p>" + escapeHTML(copy) + '</p></div><button type="button" class="btn-secondary btn-compact" data-account-billing-action="clear-billing-panel">Close panel</button></div><div class="billing-task-body">' + bodyHTML + "</div></section>";
}
function renderSupportSection(context) {
- return '<section class="portal-support-panel"><div class="account-panel-kicker">Support</div><h2>Escalation only</h2><p>Use support only when the Workspaces, Access, or Billing path has already stopped you.</p>' + renderSectionContextChips(["Escalation only", "Bring context", context.bootstrap.support_email ? "Email" : "Support"]) + '<div class="portal-support-layout"><div class="portal-support-route-grid"><div class="portal-support-route-card"><div class="account-panel-kicker">Hosted path</div><h3>Workspace or access path failed</h3><p>Go back to the hosted task first. Escalate only when the same workspace or access path still cannot finish the job.</p><div class="portal-support-points"><div class="portal-support-point"><strong>Start from the same task</strong><span>Use Workspaces for lifecycle issues and Access for roster issues before you escalate.</span></div><div class="portal-support-point"><strong>Keep the hosted context intact</strong><span>Include the account, workspace, and failed action so support inherits the same request.</span></div></div><div class="portal-support-actions"><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="workspaces">Open workspaces</button><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="access">Open access</button><a class="portal-support-link" href="mailto:' + escapeAttr(context.bootstrap.support_email || "") + '">' + escapeHTML(context.bootstrap.support_email || "") + '</a></div></div><div class="portal-support-route-card"><div class="account-panel-kicker">Billing path</div><h3>Billing path failed</h3><p>Use this route only after hosted billing or one self-hosted billing job has failed to complete cleanly.</p><div class="portal-support-points"><div class="portal-support-point"><strong>Name the billing job</strong><span>Say whether the failed path was hosted billing, licenses, refunds, or privacy.</span></div><div class="portal-support-point"><strong>Keep the request intact</strong><span>Bring the same account or billing email and the failed action instead of reopening the story.</span></div></div><div class="portal-support-actions"><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="billing">Open billing</button><a class="portal-support-link" href="mailto:' + escapeAttr(context.bootstrap.support_email || "") + '">' + escapeHTML(context.bootstrap.support_email || "") + '</a></div></div></div><div class="portal-support-runbook"><div class="account-panel-kicker">What to send</div><h3>Keep the escalation short</h3><p>Support should inherit the same request, not reconstruct it from scratch.</p><div class="portal-support-runbook-list"><div class="portal-support-runbook-step"><strong>1. Failed path</strong><span>Say whether the blocked path was Workspaces, Access, hosted billing, licenses, refunds, or privacy.</span></div><div class="portal-support-runbook-step"><strong>2. Account or email</strong><span>Include the hosted account and workspace when relevant, or the commercial billing email for self-hosted work.</span></div><div class="portal-support-runbook-step"><strong>3. Failed action</strong><span>Name the exact button, form, or billing step that failed and what happened next.</span></div></div></div></div></section>';
+ var hasHostedAccounts2 = !!(context.bootstrap.accounts || []).length;
+ var supportEmail = context.bootstrap.support_email || "";
+ var supportLead = hasHostedAccounts2 ? "Use support only when the Workspaces, Access, or Billing path has already stopped you." : "Use support only when the Billing path has already stopped you.";
+ var supportChips = hasHostedAccounts2 ? ["Escalation only", "Bring context", supportEmail ? "Email" : "Support"] : ["Escalation only", "Billing only", supportEmail ? "Email" : "Support"];
+ var routeCards = hasHostedAccounts2 ? '<div class="portal-support-route-card"><div class="account-panel-kicker">Hosted path</div><h3>Workspace or access path failed</h3><p>Go back to the hosted task first. Escalate only when the same workspace or access path still cannot finish the job.</p><div class="portal-support-points"><div class="portal-support-point"><strong>Start from the same task</strong><span>Use Workspaces for lifecycle issues and Access for roster issues before you escalate.</span></div><div class="portal-support-point"><strong>Keep the hosted context intact</strong><span>Include the account, workspace, and failed action so support inherits the same request.</span></div></div><div class="portal-support-actions"><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="workspaces">Open workspaces</button><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="access">Open access</button><a class="portal-support-link" href="mailto:' + escapeAttr(supportEmail) + '">' + escapeHTML(supportEmail) + '</a></div></div><div class="portal-support-route-card"><div class="account-panel-kicker">Billing path</div><h3>Billing path failed</h3><p>Use this route only after hosted billing or one self-hosted billing job has failed to complete cleanly.</p><div class="portal-support-points"><div class="portal-support-point"><strong>Name the billing job</strong><span>Say whether the failed path was hosted billing, licenses, refunds, or privacy.</span></div><div class="portal-support-point"><strong>Keep the request intact</strong><span>Bring the same account or billing email and the failed action instead of reopening the story.</span></div></div><div class="portal-support-actions"><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="billing">Open billing</button><a class="portal-support-link" href="mailto:' + escapeAttr(supportEmail) + '">' + escapeHTML(supportEmail) + "</a></div></div>" : '<div class="portal-support-route-card"><div class="account-panel-kicker">Billing path</div><h3>Self-hosted billing path failed</h3><p>Use this route only after a self-hosted billing, license, refund, or privacy job has failed to complete cleanly.</p><div class="portal-support-points"><div class="portal-support-point"><strong>Name the billing job</strong><span>Say whether the failed path was billing, licenses, refunds, or privacy.</span></div><div class="portal-support-point"><strong>Keep the purchase context intact</strong><span>Bring the same commercial email and the failed action instead of reopening the story.</span></div></div><div class="portal-support-actions"><button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="billing">Open billing</button><a class="portal-support-link" href="mailto:' + escapeAttr(supportEmail) + '">' + escapeHTML(supportEmail) + "</a></div></div>";
+ var runbookSteps = hasHostedAccounts2 ? '<div class="portal-support-runbook-step"><strong>1. Failed path</strong><span>Say whether the blocked path was Workspaces, Access, hosted billing, licenses, refunds, or privacy.</span></div><div class="portal-support-runbook-step"><strong>2. Account or email</strong><span>Include the hosted account and workspace when relevant, or the commercial billing email for self-hosted work.</span></div><div class="portal-support-runbook-step"><strong>3. Failed action</strong><span>Name the exact button, form, or billing step that failed and what happened next.</span></div>' : '<div class="portal-support-runbook-step"><strong>1. Billing job</strong><span>Say whether the blocked path was billing, licenses, refunds, or privacy.</span></div><div class="portal-support-runbook-step"><strong>2. Purchase email</strong><span>Include the commercial billing email used for the self-hosted purchase.</span></div><div class="portal-support-runbook-step"><strong>3. Failed action</strong><span>Name the exact button, form, or billing step that failed and what happened next.</span></div>';
+ return '<section class="portal-support-panel"><div class="account-panel-kicker">Support</div><h2>Escalation only</h2><p>' + escapeHTML(supportLead) + "</p>" + renderSectionContextChips(supportChips) + '<div class="portal-support-layout"><div class="portal-support-route-grid">' + routeCards + '</div><div class="portal-support-runbook"><div class="account-panel-kicker">What to send</div><h3>Keep the escalation short</h3><p>Support should inherit the same request, not reconstruct it from scratch.</p><div class="portal-support-runbook-list">' + runbookSteps + "</div></div></div></section>";
}
function renderHeaderHTML(context) {
if (context.bootstrap.authenticated) {
diff --git a/internal/cloudcp/portal/frontend/src/shell_view.test.ts b/internal/cloudcp/portal/frontend/src/shell_view.test.ts
index 32e27c3b54..8b77efbb4c 100644
--- a/internal/cloudcp/portal/frontend/src/shell_view.test.ts
+++ b/internal/cloudcp/portal/frontend/src/shell_view.test.ts
@@ -364,6 +364,12 @@ describe('shell view', function() {
expect(html).toContain('Use this billing surface only for self-hosted subscriptions, licenses, refunds, and privacy requests.');
expect(html).toContain('No hosted billing attached');
expect(html).toContain('Billing');
+ expect(html).toContain('Use support only when the Billing path has already stopped you.');
+ expect(html).toContain('Self-hosted billing path failed');
+ expect(html).toContain('Purchase email');
+ expect(html).not.toContain('Workspace or access path failed');
+ expect(html).not.toContain('Open workspaces');
+ expect(html).not.toContain('Open access');
expect(html).not.toContain('Self-hosted commercial services');
});
diff --git a/internal/cloudcp/portal/frontend/src/shell_view.ts b/internal/cloudcp/portal/frontend/src/shell_view.ts
index 8a27a6d057..1a524127ad 100644
--- a/internal/cloudcp/portal/frontend/src/shell_view.ts
+++ b/internal/cloudcp/portal/frontend/src/shell_view.ts
@@ -1086,50 +1086,86 @@ function renderBillingTaskPanel(title: string, copy: string, panelID: string, bo
}
function renderSupportSection(context: ShellViewContext): string {
+ var hasHostedAccounts = !!((context.bootstrap.accounts || []).length);
+ var supportEmail = context.bootstrap.support_email || '';
+ var supportLead = hasHostedAccounts
+ ? 'Use support only when the Workspaces, Access, or Billing path has already stopped you.'
+ : 'Use support only when the Billing path has already stopped you.';
+ var supportChips = hasHostedAccounts
+ ? ['Escalation only', 'Bring context', supportEmail ? 'Email' : 'Support']
+ : ['Escalation only', 'Billing only', supportEmail ? 'Email' : 'Support'];
+ var routeCards = hasHostedAccounts
+ ? (
+ '<div class="portal-support-route-card">' +
+ '<div class="account-panel-kicker">Hosted path</div>' +
+ '<h3>Workspace or access path failed</h3>' +
+ '<p>Go back to the hosted task first. Escalate only when the same workspace or access path still cannot finish the job.</p>' +
+ '<div class="portal-support-points">' +
+ '<div class="portal-support-point"><strong>Start from the same task</strong><span>Use Workspaces for lifecycle issues and Access for roster issues before you escalate.</span></div>' +
+ '<div class="portal-support-point"><strong>Keep the hosted context intact</strong><span>Include the account, workspace, and failed action so support inherits the same request.</span></div>' +
+ '</div>' +
+ '<div class="portal-support-actions">' +
+ '<button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="workspaces">Open workspaces</button>' +
+ '<button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="access">Open access</button>' +
+ '<a class="portal-support-link" href="mailto:' + escapeAttr(supportEmail) + '">' + escapeHTML(supportEmail) + '</a>' +
+ '</div>' +
+ '</div>' +
+ '<div class="portal-support-route-card">' +
+ '<div class="account-panel-kicker">Billing path</div>' +
+ '<h3>Billing path failed</h3>' +
+ '<p>Use this route only after hosted billing or one self-hosted billing job has failed to complete cleanly.</p>' +
+ '<div class="portal-support-points">' +
+ '<div class="portal-support-point"><strong>Name the billing job</strong><span>Say whether the failed path was hosted billing, licenses, refunds, or privacy.</span></div>' +
+ '<div class="portal-support-point"><strong>Keep the request intact</strong><span>Bring the same account or billing email and the failed action instead of reopening the story.</span></div>' +
+ '</div>' +
+ '<div class="portal-support-actions">' +
+ '<button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="billing">Open billing</button>' +
+ '<a class="portal-support-link" href="mailto:' + escapeAttr(supportEmail) + '">' + escapeHTML(supportEmail) + '</a>' +
+ '</div>' +
+ '</div>'
+ )
+ : (
+ '<div class="portal-support-route-card">' +
+ '<div class="account-panel-kicker">Billing path</div>' +
+ '<h3>Self-hosted billing path failed</h3>' +
+ '<p>Use this route only after a self-hosted billing, license, refund, or privacy job has failed to complete cleanly.</p>' +
+ '<div class="portal-support-points">' +
+ '<div class="portal-support-point"><strong>Name the billing job</strong><span>Say whether the failed path was billing, licenses, refunds, or privacy.</span></div>' +
+ '<div class="portal-support-point"><strong>Keep the purchase context intact</strong><span>Bring the same commercial email and the failed action instead of reopening the story.</span></div>' +
+ '</div>' +
+ '<div class="portal-support-actions">' +
+ '<button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="billing">Open billing</button>' +
+ '<a class="portal-support-link" href="mailto:' + escapeAttr(supportEmail) + '">' + escapeHTML(supportEmail) + '</a>' +
+ '</div>' +
+ '</div>'
+ );
+ var runbookSteps = hasHostedAccounts
+ ? (
+ '<div class="portal-support-runbook-step"><strong>1. Failed path</strong><span>Say whether the blocked path was Workspaces, Access, hosted billing, licenses, refunds, or privacy.</span></div>' +
+ '<div class="portal-support-runbook-step"><strong>2. Account or email</strong><span>Include the hosted account and workspace when relevant, or the commercial billing email for self-hosted work.</span></div>' +
+ '<div class="portal-support-runbook-step"><strong>3. Failed action</strong><span>Name the exact button, form, or billing step that failed and what happened next.</span></div>'
+ )
+ : (
+ '<div class="portal-support-runbook-step"><strong>1. Billing job</strong><span>Say whether the blocked path was billing, licenses, refunds, or privacy.</span></div>' +
+ '<div class="portal-support-runbook-step"><strong>2. Purchase email</strong><span>Include the commercial billing email used for the self-hosted purchase.</span></div>' +
+ '<div class="portal-support-runbook-step"><strong>3. Failed action</strong><span>Name the exact button, form, or billing step that failed and what happened next.</span></div>'
+ );
return (
'<section class="portal-support-panel">' +
'<div class="account-panel-kicker">Support</div>' +
'<h2>Escalation only</h2>' +
- '<p>Use support only when the Workspaces, Access, or Billing path has already stopped you.</p>' +
- renderSectionContextChips(['Escalation only', 'Bring context', context.bootstrap.support_email ? 'Email' : 'Support']) +
+ '<p>' + escapeHTML(supportLead) + '</p>' +
+ renderSectionContextChips(supportChips) +
'<div class="portal-support-layout">' +
'<div class="portal-support-route-grid">' +
- '<div class="portal-support-route-card">' +
- '<div class="account-panel-kicker">Hosted path</div>' +
- '<h3>Workspace or access path failed</h3>' +
- '<p>Go back to the hosted task first. Escalate only when the same workspace or access path still cannot finish the job.</p>' +
- '<div class="portal-support-points">' +
- '<div class="portal-support-point"><strong>Start from the same task</strong><span>Use Workspaces for lifecycle issues and Access for roster issues before you escalate.</span></div>' +
- '<div class="portal-support-point"><strong>Keep the hosted context intact</strong><span>Include the account, workspace, and failed action so support inherits the same request.</span></div>' +
- '</div>' +
- '<div class="portal-support-actions">' +
- '<button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="workspaces">Open workspaces</button>' +
- '<button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="access">Open access</button>' +
- '<a class="portal-support-link" href="mailto:' + escapeAttr(context.bootstrap.support_email || '') + '">' + escapeHTML(context.bootstrap.support_email || '') + '</a>' +
- '</div>' +
- '</div>' +
- '<div class="portal-support-route-card">' +
- '<div class="account-panel-kicker">Billing path</div>' +
- '<h3>Billing path failed</h3>' +
- '<p>Use this route only after hosted billing or one self-hosted billing job has failed to complete cleanly.</p>' +
- '<div class="portal-support-points">' +
- '<div class="portal-support-point"><strong>Name the billing job</strong><span>Say whether the failed path was hosted billing, licenses, refunds, or privacy.</span></div>' +
- '<div class="portal-support-point"><strong>Keep the request intact</strong><span>Bring the same account or billing email and the failed action instead of reopening the story.</span></div>' +
- '</div>' +
- '<div class="portal-support-actions">' +
- '<button type="button" class="btn-secondary btn-compact" data-shell-action="activate-section" data-shell-section="billing">Open billing</button>' +
- '<a class="portal-support-link" href="mailto:' + escapeAttr(context.bootstrap.support_email || '') + '">' + escapeHTML(context.bootstrap.support_email || '') + '</a>' +
- '</div>' +
- '</div>' +
+ routeCards +
'</div>' +
'<div class="portal-support-runbook">' +
'<div class="account-panel-kicker">What to send</div>' +
'<h3>Keep the escalation short</h3>' +
'<p>Support should inherit the same request, not reconstruct it from scratch.</p>' +
'<div class="portal-support-runbook-list">' +
- '<div class="portal-support-runbook-step"><strong>1. Failed path</strong><span>Say whether the blocked path was Workspaces, Access, hosted billing, licenses, refunds, or privacy.</span></div>' +
- '<div class="portal-support-runbook-step"><strong>2. Account or email</strong><span>Include the hosted account and workspace when relevant, or the commercial billing email for self-hosted work.</span></div>' +
- '<div class="portal-support-runbook-step"><strong>3. Failed action</strong><span>Name the exact button, form, or billing step that failed and what happened next.</span></div>' +
+ runbookSteps +
'</div>' +
'</div>' +
'</div>' +