From 0dee21814dfa0a0adca094690ebd96ed9359a8bc Mon Sep 17 00:00:00 2001 From: Emma Alexia Date: Mon, 4 Aug 2025 16:13:33 -0400 Subject: [PATCH] Change "Billing" link on dashboard for admins (#3951) * Change "Billing" link on dashboard for admins Requires an archon change before merging * change order * steal changes from prospector's old PR supersedes #3234 Co-authored-by: Prospector * lint? --------- Co-authored-by: Prospector --- .../components/ui/servers/ServerSidebar.vue | 7 +++++-- .../composables/servers/modules/general.ts | 1 + .../src/pages/servers/manage/[id]/options.vue | 19 +++++++++++++++++-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/apps/frontend/src/components/ui/servers/ServerSidebar.vue b/apps/frontend/src/components/ui/servers/ServerSidebar.vue index c3edaab68..f68a21e0c 100644 --- a/apps/frontend/src/components/ui/servers/ServerSidebar.vue +++ b/apps/frontend/src/components/ui/servers/ServerSidebar.vue @@ -2,7 +2,10 @@
-
+
props.server.general?.owner_id ?? "Ghost"); +const isOwner = computed(() => (auth.value?.user as User | null)?.id === ownerId.value); +const isAdmin = computed(() => isUserAdmin(auth.value?.user)); + +const navLinks = computed(() => [ { icon: SettingsIcon, label: "General", href: `/servers/manage/${serverId}/options` }, { icon: WrenchIcon, label: "Platform", href: `/servers/manage/${serverId}/options/loader` }, { icon: TextQuoteIcon, label: "Startup", href: `/servers/manage/${serverId}/options/startup` }, @@ -48,7 +55,15 @@ const navLinks = [ label: "Billing", href: `/settings/billing#server-${serverId}`, external: true, + shown: isOwner.value, + }, + { + icon: ModrinthIcon, + label: "Admin Billing", + href: `/admin/billing/${ownerId.value}`, + external: true, + shown: isAdmin.value, }, { icon: InfoIcon, label: "Info", href: `/servers/manage/${serverId}/options/info` }, -]; +]);