diff --git a/apps/frontend/src/components/ui/servers/ServerSidebar.vue b/apps/frontend/src/components/ui/servers/ServerSidebar.vue index 0c44c9767c..18ead0a869 100644 --- a/apps/frontend/src/components/ui/servers/ServerSidebar.vue +++ b/apps/frontend/src/components/ui/servers/ServerSidebar.vue @@ -2,7 +2,10 @@
-
+
; }>(); diff --git a/apps/frontend/src/pages/servers/manage/[id]/options.vue b/apps/frontend/src/pages/servers/manage/[id]/options.vue index 3716342d3e..46cca44ad9 100644 --- a/apps/frontend/src/pages/servers/manage/[id]/options.vue +++ b/apps/frontend/src/pages/servers/manage/[id]/options.vue @@ -10,13 +10,16 @@ import { TextQuoteIcon, VersionIcon, CardIcon, + ModrinthIcon, UserIcon, WrenchIcon, } from "@modrinth/assets"; +import { isAdmin as isUserAdmin, type User } from "@modrinth/utils"; import type { Server } from "~/composables/pyroServers"; const route = useRoute(); const serverId = route.params.id as string; +const auth = await useAuth(); const props = defineProps<{ server: Server<["general", "content", "backups", "network", "startup", "ws", "fs"]>; @@ -26,7 +29,11 @@ useHead({ title: `Options - ${props.server.general?.name ?? "Server"} - Modrinth`, }); -const navLinks = [ +const ownerId = computed(() => `Dc7EYhxG`); +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` }, @@ -42,7 +49,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` }, -]; +]);