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.

Route paid self-hosted feature handoffs to Plans

rcourtman78c7c874fa95
diff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.md
index 4f7d90594b..36df791426 100644
--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md
+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md
@@ -509,9 +509,10 @@ Community limit enforcement.
## Current State
-`frontend-modern/src/utils/pricingHandoff.ts` now routes pro-feature paywall
-keys (`ai_alerts`, `ai_autofix`, `relay`, `rbac`, `audit_logging`,
-`advanced_sso`, `agent_profiles`, `long_term_metrics`) to the
+`frontend-modern/src/utils/pricingHandoff.ts` now routes displayable paid
+self-hosted feature keys (`relay`, `mobile_app`, `push_notifications`,
+`ai_alerts`, `ai_autofix`, `long_term_metrics`, `advanced_sso`, `rbac`,
+`audit_logging`, `advanced_reporting`, `agent_profiles`) to the
self-hosted billing plan page instead of the Pulse Account purchase-start
handoff. The purchase-start handoff requires a `PublicURL` and fails on local
instances; routing these keys to the in-product billing plan keeps upgrades
diff --git a/frontend-modern/src/utils/__tests__/pricingHandoff.test.ts b/frontend-modern/src/utils/__tests__/pricingHandoff.test.ts
index 6c7b7334a2..5bb679a78e 100644
--- a/frontend-modern/src/utils/__tests__/pricingHandoff.test.ts
+++ b/frontend-modern/src/utils/__tests__/pricingHandoff.test.ts
@@ -1,4 +1,5 @@
import { describe, expect, it } from 'vitest';
+import { SELF_HOSTED_FEATURE_CATALOG } from '@/utils/selfHostedFeatureCatalog.generated';
import {
getSelfHostedPurchaseStartUrl,
getSelfHostedBillingHref,
@@ -40,10 +41,43 @@ describe('pricingHandoff', () => {
expect(getUpgradeFallbackDestination('cloud')).toBe('/cloud');
});
- it('routes Pro feature upgrades to the in-product billing plan page', () => {
+ it('routes paid self-hosted feature upgrades to the in-product billing plan page', () => {
expect(getUpgradeFallbackDestination('relay')).toBe(SELF_HOSTED_PRO_BILLING_PLAN_HREF);
+ expect(getUpgradeFallbackDestination('mobile_app')).toBe(SELF_HOSTED_PRO_BILLING_PLAN_HREF);
+ expect(getUpgradeFallbackDestination('push_notifications')).toBe(
+ SELF_HOSTED_PRO_BILLING_PLAN_HREF,
+ );
expect(getUpgradeFallbackDestination('ai_alerts')).toBe(SELF_HOSTED_PRO_BILLING_PLAN_HREF);
expect(getUpgradeFallbackDestination('rbac')).toBe(SELF_HOSTED_PRO_BILLING_PLAN_HREF);
+ expect(getUpgradeFallbackDestination('advanced_reporting')).toBe(
+ SELF_HOSTED_PRO_BILLING_PLAN_HREF,
+ );
+ });
+
+ it('keeps all displayable paid self-hosted catalog features on the owned Plans surface', () => {
+ const paidCatalogFeatureKeys = SELF_HOSTED_FEATURE_CATALOG.filter(
+ (entry) =>
+ entry.displayableInSelfHostedPlan &&
+ !entry.includedIn.community &&
+ (entry.includedIn.relay || entry.includedIn.pro),
+ ).map((entry) => entry.key);
+
+ expect(paidCatalogFeatureKeys).toEqual([
+ 'relay',
+ 'mobile_app',
+ 'push_notifications',
+ 'ai_alerts',
+ 'ai_autofix',
+ 'long_term_metrics',
+ 'advanced_sso',
+ 'rbac',
+ 'audit_logging',
+ 'advanced_reporting',
+ 'agent_profiles',
+ ]);
+ for (const key of paidCatalogFeatureKeys) {
+ expect(getUpgradeFallbackDestination(key)).toBe(SELF_HOSTED_PRO_BILLING_PLAN_HREF);
+ }
});
it('does not keep retired trial-expired as an owned in-product billing intent', () => {
diff --git a/frontend-modern/src/utils/pricingHandoff.ts b/frontend-modern/src/utils/pricingHandoff.ts
index c07c906f4f..7f12797696 100644
--- a/frontend-modern/src/utils/pricingHandoff.ts
+++ b/frontend-modern/src/utils/pricingHandoff.ts
@@ -54,14 +54,18 @@ const IN_PRODUCT_PRICING_DESTINATIONS: Record<string, string> = {
max_monitored_systems: SELF_HOSTED_PRO_BILLING_USAGE_COUNTING_RULES_HREF,
trial_expired: SELF_HOSTED_PRO_BILLING_PLAN_HREF,
cloud: '/cloud',
- // Pro-feature keys: route to billing plan page instead of the Pulse Account
- // purchase-start handoff, which fails for local instances without PublicURL.
+ // Paid self-hosted feature keys: route to the owned billing plan page instead
+ // of the Pulse Account purchase-start handoff, which fails for local instances
+ // without PublicURL.
+ mobile_app: SELF_HOSTED_PRO_BILLING_PLAN_HREF,
+ push_notifications: SELF_HOSTED_PRO_BILLING_PLAN_HREF,
ai_alerts: SELF_HOSTED_PRO_BILLING_PLAN_HREF,
ai_autofix: SELF_HOSTED_PRO_BILLING_PLAN_HREF,
relay: SELF_HOSTED_PRO_BILLING_PLAN_HREF,
rbac: SELF_HOSTED_PRO_BILLING_PLAN_HREF,
audit_logging: SELF_HOSTED_PRO_BILLING_PLAN_HREF,
advanced_sso: SELF_HOSTED_PRO_BILLING_PLAN_HREF,
+ advanced_reporting: SELF_HOSTED_PRO_BILLING_PLAN_HREF,
agent_profiles: SELF_HOSTED_PRO_BILLING_PLAN_HREF,
long_term_metrics: SELF_HOSTED_PRO_BILLING_PLAN_HREF,
};