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.

606 B
Raw Blame
import type { PortalBootstrapData, PortalShellSection } from './types';

export function preferredPortalShellSection(
  bootstrap: Pick<PortalBootstrapData, 'authenticated' | 'has_self_hosted_commercial' | 'accounts'>
): PortalShellSection {
  var accounts = Array.isArray(bootstrap.accounts) ? bootstrap.accounts : [];
  var hasHostedAccounts = accounts.length > 0;
  var hasSelfHostedCommercial = bootstrap.has_self_hosted_commercial === true || !hasHostedAccounts;

  if (hasHostedAccounts) {
    return 'workspaces';
  }
  if (hasSelfHostedCommercial) {
    return 'billing';
  }
  return 'billing';
}