import { SidebarNavItem } from "@app/components/SidebarNav"; import { Env } from "@app/lib/types/env"; import { build } from "@server/build"; import { BellRing, Boxes, Building2, Cable, ChartLine, Combine, CreditCard, Fingerprint, Globe, GlobeIcon, GlobeLock, KeyRound, Laptop, LayoutGrid, Link as LinkIcon, Logs, MonitorUp, Plug, ReceiptText, ScanEye, Server, Settings, ShieldIcon, SquareMousePointer, TagIcon, TicketCheck, Unplug, User, UserCog, Users, Waypoints } from "lucide-react"; export type SidebarNavSection = { // Added from 'dev' branch heading: string; items: SidebarNavItem[]; }; export type OrgNavSectionsOptions = { isPrimaryOrg?: boolean; }; // Merged from 'user-management-and-resources' branch export const orgLangingNavItems: SidebarNavItem[] = [ { title: "sidebarAccount", href: "/{orgId}", icon: } ]; export const orgNavSections = ( env?: Env, options?: OrgNavSectionsOptions ): SidebarNavSection[] => [ { heading: "network", items: [ { title: "sidebarSites", href: "/{orgId}/settings/sites", icon: }, { title: "sidebarResources", icon: , items: [ { title: "sidebarProxyResources", href: "/{orgId}/settings/resources/public", icon: }, { title: "sidebarClientResources", href: "/{orgId}/settings/resources/private", icon: } ] }, { title: "sidebarClients", icon: , items: [ { href: "/{orgId}/settings/clients/user", title: "sidebarUserDevices", icon: }, { href: "/{orgId}/settings/clients/machine", title: "sidebarMachineClients", icon: } ] }, { title: "sidebarDomains", href: "/{orgId}/settings/domains", icon: }, ...(build === "saas" ? [ { title: "sidebarRemoteExitNodes", href: "/{orgId}/settings/remote-exit-nodes", icon: } ] : []) ] }, { heading: "accessControl", items: [ { title: "sidebarTeam", icon: , items: [ { title: "sidebarUsers", href: "/{orgId}/settings/access/users", icon: }, { title: "sidebarRoles", href: "/{orgId}/settings/access/roles", icon: }, { title: "sidebarInvitations", href: "/{orgId}/settings/access/invitations", icon: } ] }, ...(!env?.flags.disableEnterpriseFeatures ? [ { title: "sidebarPolicies", icon: , items: [ { title: "sidebarResourcePolicies", href: "/{orgId}/settings/policies/resources/public", icon: ( ) } ] } ] : []), // PaidFeaturesAlert ...(!env?.flags.disableEnterpriseFeatures && (build === "saas" || env?.app.identityProviderMode === "org" || (env?.app.identityProviderMode === undefined && build !== "oss")) ? [ { title: "sidebarIdentityProviders", href: "/{orgId}/settings/idp", icon: } ] : []), ...(!env?.flags.disableEnterpriseFeatures ? [ { title: "sidebarApprovals", href: "/{orgId}/settings/access/approvals", icon: } ] : []), { title: "sidebarShareableLinks", href: "/{orgId}/settings/share-links", icon: } ] }, { heading: "sidebarOrganization", items: [ { title: "sidebarLogsAndAnalytics", icon: , items: [ { title: "sidebarLogsAnalytics", href: "/{orgId}/settings/logs/analytics", icon: }, { title: "sidebarLogsRequest", href: "/{orgId}/settings/logs/request", icon: ( ) }, ...(!env?.flags.disableEnterpriseFeatures ? [ { title: "sidebarLogsAccess", href: "/{orgId}/settings/logs/access", icon: }, { title: "sidebarLogsAction", href: "/{orgId}/settings/logs/action", icon: }, { title: "sidebarLogsConnection", href: "/{orgId}/settings/logs/connection", icon: }, { title: "sidebarLogsStreaming", href: "/{orgId}/settings/logs/streaming", icon: } ] : []) ] }, { title: "sidebarManagement", icon: , items: [ ...(!env?.flags.disableEnterpriseFeatures ? [ { title: "sidebarAlerting", href: "/{orgId}/settings/alerting", icon: ( ) }, { title: "sidebarProvisioning", href: "/{orgId}/settings/provisioning", icon: } ] : []), { title: "sidebarBluePrints", href: "/{orgId}/settings/blueprints", icon: }, { title: "sidebarApiKeys", href: "/{orgId}/settings/api-keys", icon: }, ...(!env?.flags.disableEnterpriseFeatures ? [ { title: "labels", href: "/{orgId}/settings/labels", icon: } ] : []) ] }, ...(build === "saas" && options?.isPrimaryOrg ? [ { title: "sidebarBillingAndLicenses", icon: , items: [ { title: "sidebarBilling", href: "/{orgId}/settings/billing", icon: ( ) }, { title: "sidebarEnterpriseLicenses", href: "/{orgId}/settings/license", icon: ( ) } ] } ] : []), { title: "sidebarSettings", href: "/{orgId}/settings/general", icon: } ] } ]; export const adminNavSections = (env?: Env): SidebarNavSection[] => [ { heading: "sidebarAdmin", items: [ { title: "sidebarAllUsers", href: "/admin/users", icon: }, { title: "sidebarApiKeys", href: "/admin/api-keys", icon: }, ...(build === "oss" || env?.app.identityProviderMode === "global" || env?.app.identityProviderMode === undefined ? [ { title: "sidebarIdentityProviders", href: "/admin/idp", icon: } ] : []), ...(build == "enterprise" ? [ { title: "sidebarLicense", href: "/admin/license", icon: } ] : []) ] } ]; export type CommandBarNavSection = { // Added from 'dev' branch heading: string; items: CommandBarNavItem[]; }; export type CommandBarNavItem = { href?: string; title: string; icon?: React.ReactNode; showEE?: boolean; isBeta?: boolean; }; export const commandBarNavSections = ( env?: Env, options?: OrgNavSectionsOptions ): CommandBarNavSection[] => [ { heading: "commandLauncher", items: [ { title: "commandResourceLauncher", href: "/{orgId}", icon: } ] }, { heading: "network", items: [ { title: "commandSites", href: "/{orgId}/settings/sites", icon: }, { title: "commandProxyResources", href: "/{orgId}/settings/resources/public", icon: }, { title: "commandClientResources", href: "/{orgId}/settings/resources/private", icon: }, { href: "/{orgId}/settings/clients/user", title: "commandUserDevices", icon: }, { href: "/{orgId}/settings/clients/machine", title: "commandMachineClients", icon: }, ...(build === "saas" ? [ { title: "commandRemoteExitNodes", href: "/{orgId}/settings/remote-exit-nodes", icon: } ] : []) ] }, { heading: "commandTeam", items: [ { title: "commandUsers", href: "/{orgId}/settings/access/users", icon: }, { title: "commandRoles", href: "/{orgId}/settings/access/roles", icon: }, { title: "commandInvitations", href: "/{orgId}/settings/access/invitations", icon: } ] }, { heading: "accessControl", items: [ ...(!env?.flags.disableEnterpriseFeatures ? [ { title: "commandResourcePolicies", href: "/{orgId}/settings/policies/resources/public", icon: } ] : []), // PaidFeaturesAlert ...((build === "oss" && !env?.flags.disableEnterpriseFeatures) || build === "saas" || env?.app.identityProviderMode === "org" || (env?.app.identityProviderMode === undefined && build !== "oss") ? [ { title: "commandIdentityProviders", href: "/{orgId}/settings/idp", icon: } ] : []), ...(!env?.flags.disableEnterpriseFeatures ? [ { title: "commandApprovals", href: "/{orgId}/settings/access/approvals", icon: } ] : []), { title: "commandShareableLinks", href: "/{orgId}/settings/share-links", icon: } ] }, { heading: "commandLogsAndAnalytics", items: [ { title: "commandLogsAnalytics", href: "/{orgId}/settings/logs/analytics", icon: }, { title: "commandLogsRequest", href: "/{orgId}/settings/logs/request", icon: }, ...(!env?.flags.disableEnterpriseFeatures ? [ { title: "commandLogsAccess", href: "/{orgId}/settings/logs/access", icon: }, { title: "commandLogsAction", href: "/{orgId}/settings/logs/action", icon: }, { title: "commandLogsConnection", href: "/{orgId}/settings/logs/connection", icon: }, { title: "commandLogsStreaming", href: "/{orgId}/settings/logs/streaming", icon: } ] : []) ] }, { heading: "commandManagement", items: [ ...(!env?.flags.disableEnterpriseFeatures ? [ { title: "commandAlerting", href: "/{orgId}/settings/alerting", icon: }, { title: "commandProvisioning", href: "/{orgId}/settings/provisioning", icon: } ] : []), { title: "commandBluePrints", href: "/{orgId}/settings/blueprints", icon: }, { title: "commandApiKeys", href: "/{orgId}/settings/api-keys", icon: }, ...(!env?.flags.disableEnterpriseFeatures ? [ { title: "labels", href: "/{orgId}/settings/labels", icon: } ] : []) ] }, { heading: "commandOrganization", items: [ { title: "commandSettings", href: "/{orgId}/settings/general", icon: }, { title: "commandDomains", href: "/{orgId}/settings/domains", icon: } ] }, ...(build === "saas" && options?.isPrimaryOrg ? [ { heading: "commandBillingAndLicenses", items: [ { title: "commandBilling", href: "/{orgId}/settings/billing", icon: }, { title: "commandEnterpriseLicenses", href: "/{orgId}/settings/license", icon: } ] } ] : []) ];