From 4e88f1f38afffaf51c25dbdd9684b2784d411c85 Mon Sep 17 00:00:00 2001 From: miloschwartz Date: Thu, 19 Feb 2026 22:41:14 -0800 Subject: [PATCH] more sidebar improvements --- messages/en-US.json | 4 +- src/app/navigation.tsx | 152 +++++++++++++++---------------- src/components/LayoutSidebar.tsx | 66 +++++++------- src/components/OrgSelector.tsx | 2 +- 4 files changed, 114 insertions(+), 110 deletions(-) diff --git a/messages/en-US.json b/messages/en-US.json index 3d6b5d77..92334feb 100644 --- a/messages/en-US.json +++ b/messages/en-US.json @@ -649,7 +649,7 @@ "resourcesUsersRolesAccess": "User and role-based access control", "resourcesErrorUpdate": "Failed to toggle resource", "resourcesErrorUpdateDescription": "An error occurred while updating the resource", - "access": "Access", + "access": "Access Control", "shareLink": "{resource} Share Link", "resourceSelect": "Select resource", "shareLinks": "Share Links", @@ -790,6 +790,7 @@ "accessRoleRemoved": "Role removed", "accessRoleRemovedDescription": "The role has been successfully removed.", "accessRoleRequiredRemove": "Before deleting this role, please select a new role to transfer existing members to.", + "network": "Network", "manage": "Manage", "sitesNotFound": "No sites found.", "pangolinServerAdmin": "Server Admin - Pangolin", @@ -1267,6 +1268,7 @@ "sidebarLogAndAnalytics": "Log & Analytics", "sidebarBluePrints": "Blueprints", "sidebarOrganization": "Organization", + "sidebarManagement": "Management", "sidebarBillingAndLicenses": "Billing & Licenses", "sidebarLogsAnalytics": "Analytics", "blueprints": "Blueprints", diff --git a/src/app/navigation.tsx b/src/app/navigation.tsx index be3ad7d3..162d9966 100644 --- a/src/app/navigation.tsx +++ b/src/app/navigation.tsx @@ -2,6 +2,7 @@ import { SidebarNavItem } from "@app/components/SidebarNav"; import { Env } from "@app/lib/types/env"; import { build } from "@server/build"; import { + Building2, ChartLine, Combine, CreditCard, @@ -11,10 +12,11 @@ import { KeyRound, Laptop, Link as LinkIcon, - Logs, // Added from 'dev' branch + Logs, MonitorUp, + Plug, ReceiptText, - ScanEye, // Added from 'dev' branch + ScanEye, Server, Settings, SquareMousePointer, @@ -49,12 +51,12 @@ export const orgNavSections = ( options?: OrgNavSectionsOptions ): SidebarNavSection[] => [ { - heading: "sidebarGeneral", + heading: "network", items: [ { title: "sidebarSites", href: "/{orgId}/settings/sites", - icon: + icon: }, { title: "sidebarResources", @@ -157,92 +159,88 @@ export const orgNavSections = ( } ] }, - { - heading: "sidebarLogsAndAnalytics", - items: (() => { - const logItems: SidebarNavItem[] = [ - { - 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: - } - ] - : []) - ]; - - const analytics = { - title: "sidebarLogsAnalytics", - href: "/{orgId}/settings/logs/analytics", - icon: - }; - - // If only one log item, return it directly without grouping - if (logItems.length === 1) { - return [analytics, ...logItems]; - } - - // If multiple log items, create a group - return [ - analytics, - { - title: "sidebarLogs", - icon: , - items: logItems - } - ]; - })() - }, { heading: "sidebarOrganization", items: [ { - title: "sidebarApiKeys", - href: "/{orgId}/settings/api-keys", - icon: + 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: "sidebarBluePrints", - href: "/{orgId}/settings/blueprints", - icon: + title: "sidebarManagement", + icon: , + items: [ + { + title: "sidebarApiKeys", + href: "/{orgId}/settings/api-keys", + icon: + }, + { + title: "sidebarBluePrints", + href: "/{orgId}/settings/blueprints", + 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: } ] - }, - ...(build == "saas" && options?.isPrimaryOrg - ? [ - { - heading: "sidebarBillingAndLicenses", - items: [ - { - title: "sidebarBilling", - href: "/{orgId}/settings/billing", - icon: - }, - { - title: "sidebarEnterpriseLicenses", - href: "/{orgId}/settings/license", - icon: - } - ] - } - ] - : []) + } ]; export const adminNavSections = (env?: Env): SidebarNavSection[] => [ diff --git a/src/components/LayoutSidebar.tsx b/src/components/LayoutSidebar.tsx index 3095b1fd..ac75047c 100644 --- a/src/components/LayoutSidebar.tsx +++ b/src/components/LayoutSidebar.tsx @@ -18,7 +18,7 @@ import { approvalQueries } from "@app/lib/queries"; import { build } from "@server/build"; import { useQuery } from "@tanstack/react-query"; import { ListUserOrgsResponse } from "@server/routers/org"; -import { ExternalLink, Server } from "lucide-react"; +import { ArrowRight, ExternalLink, Server } from "lucide-react"; import { useTranslations } from "next-intl"; import dynamic from "next/dynamic"; import Link from "next/link"; @@ -146,36 +146,6 @@ export function LayoutSidebar({ />
- {!isAdminPage && user.serverAdmin && ( -
- - - - - {!isSidebarCollapsed && ( - {t("serverAdmin")} - )} - -
- )}
+ {!isAdminPage && user.serverAdmin && ( +
+ + + + + {!isSidebarCollapsed && ( + <> + {t("serverAdmin")} + + + )} + +
+ )} +
diff --git a/src/components/OrgSelector.tsx b/src/components/OrgSelector.tsx index cacaf553..25ec3b5c 100644 --- a/src/components/OrgSelector.tsx +++ b/src/components/OrgSelector.tsx @@ -71,7 +71,7 @@ export function OrgSelector({ "cursor-pointer transition-colors", isCollapsed ? "w-full h-16 flex items-center justify-center hover:bg-muted" - : "w-full px-4 py-4 hover:bg-muted" + : "w-full px-5 py-4 hover:bg-muted" )} > {isCollapsed ? (