mirror of
https://github.com/modrinth/code.git
synced 2026-08-30 11:36:05 +00:00
75 lines
1.4 KiB
TypeScript
75 lines
1.4 KiB
TypeScript
import type { Archon } from '@modrinth/api-client'
|
|
import {
|
|
CardIcon,
|
|
ListIcon,
|
|
ModrinthIcon,
|
|
SettingsIcon,
|
|
TextQuoteIcon,
|
|
VersionIcon,
|
|
WrenchIcon,
|
|
} from '@modrinth/assets'
|
|
import type { Component } from 'vue'
|
|
|
|
export type ServerSettingsTabId =
|
|
| 'general'
|
|
| 'installation'
|
|
| 'network'
|
|
| 'properties'
|
|
| 'advanced'
|
|
| 'billing'
|
|
| 'admin-billing'
|
|
|
|
export interface ServerSettingsTabContext {
|
|
serverId: string
|
|
ownerId: string
|
|
serverStatus?: Archon.Servers.v0.Status | null
|
|
isOwner: boolean
|
|
isAdmin: boolean
|
|
}
|
|
|
|
export interface ServerSettingsTabDefinition {
|
|
id: ServerSettingsTabId
|
|
icon: Component
|
|
href?: (ctx: ServerSettingsTabContext) => string
|
|
external?: boolean
|
|
shown?: (ctx: ServerSettingsTabContext) => boolean
|
|
}
|
|
|
|
export const serverSettingsTabDefinitions: ServerSettingsTabDefinition[] = [
|
|
{
|
|
id: 'general',
|
|
icon: SettingsIcon,
|
|
},
|
|
{
|
|
id: 'installation',
|
|
icon: WrenchIcon,
|
|
},
|
|
{
|
|
id: 'network',
|
|
icon: VersionIcon,
|
|
},
|
|
{
|
|
id: 'properties',
|
|
icon: ListIcon,
|
|
shown: ({ serverStatus }) => serverStatus !== 'installing',
|
|
},
|
|
{
|
|
id: 'advanced',
|
|
icon: TextQuoteIcon,
|
|
},
|
|
{
|
|
id: 'billing',
|
|
icon: CardIcon,
|
|
href: ({ serverId }) => `/settings/billing#server-${serverId}`,
|
|
external: true,
|
|
shown: ({ isOwner }) => isOwner,
|
|
},
|
|
{
|
|
id: 'admin-billing',
|
|
icon: ModrinthIcon,
|
|
href: ({ ownerId }) => `/admin/billing/${ownerId}`,
|
|
external: true,
|
|
shown: ({ isAdmin }) => isAdmin,
|
|
},
|
|
]
|