mirror of
https://github.com/modrinth/code.git
synced 2026-09-04 05:48:57 +00:00
qa: pass
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
:server-id="serverId"
|
:server-id="serverId"
|
||||||
:reload-page="() => router.go(0)"
|
:reload-page="() => router.go(0)"
|
||||||
:resolve-viewer="resolveViewer"
|
:resolve-viewer="resolveViewer"
|
||||||
:show-copy-id-action="themeStore.devMode"
|
|
||||||
:auth-user="authUser"
|
:auth-user="authUser"
|
||||||
:navigate-to-billing="() => openUrl('https://modrinth.com/settings/billing')"
|
:navigate-to-billing="() => openUrl('https://modrinth.com/settings/billing')"
|
||||||
:navigate-to-servers="() => router.push('/hosting/manage')"
|
:navigate-to-servers="() => router.push('/hosting/manage')"
|
||||||
@@ -53,14 +52,12 @@ import { useRoute, useRouter } from 'vue-router'
|
|||||||
import { get_user } from '@/helpers/cache'
|
import { get_user } from '@/helpers/cache'
|
||||||
import { get as getCreds } from '@/helpers/mr_auth'
|
import { get as getCreds } from '@/helpers/mr_auth'
|
||||||
import { useBreadcrumbs } from '@/store/breadcrumbs'
|
import { useBreadcrumbs } from '@/store/breadcrumbs'
|
||||||
import { useTheming } from '@/store/theme'
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const auth = injectAuth()
|
const auth = injectAuth()
|
||||||
const client = injectModrinthClient()
|
const client = injectModrinthClient()
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
const themeStore = useTheming()
|
|
||||||
const breadcrumbs = useBreadcrumbs()
|
const breadcrumbs = useBreadcrumbs()
|
||||||
|
|
||||||
const serverId = computed(() => {
|
const serverId = computed(() => {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
:server-id="serverId"
|
:server-id="serverId"
|
||||||
:reload-page="() => reloadNuxtApp({ path: route.path })"
|
:reload-page="() => reloadNuxtApp({ path: route.path })"
|
||||||
:resolve-viewer="resolveViewer"
|
:resolve-viewer="resolveViewer"
|
||||||
:show-copy-id-action="flags.developerMode"
|
|
||||||
:show-advanced-debug-info="flags.advancedDebugInfo"
|
:show-advanced-debug-info="flags.advancedDebugInfo"
|
||||||
:stripe-publishable-key="config.public.stripePublishableKey as string"
|
:stripe-publishable-key="config.public.stripePublishableKey as string"
|
||||||
:site-url="config.public.siteUrl as string"
|
:site-url="config.public.siteUrl as string"
|
||||||
|
|||||||
@@ -1,65 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="contents">
|
|
||||||
<ButtonStyled circular type="transparent" size="large">
|
|
||||||
<TeleportOverflowMenu :options="menuOptions">
|
|
||||||
<MoreVerticalIcon aria-hidden="true" />
|
|
||||||
<template #allServers>
|
|
||||||
<ServerIcon class="h-5 w-5" />
|
|
||||||
<span>All servers</span>
|
|
||||||
</template>
|
|
||||||
<template #copy-id>
|
|
||||||
<ClipboardCopyIcon class="h-5 w-5" aria-hidden="true" />
|
|
||||||
<span>Copy ID</span>
|
|
||||||
</template>
|
|
||||||
</TeleportOverflowMenu>
|
|
||||||
</ButtonStyled>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { ClipboardCopyIcon, MoreVerticalIcon, ServerIcon } from '@modrinth/assets'
|
|
||||||
import { computed } from 'vue'
|
|
||||||
import { useRouter } from 'vue-router'
|
|
||||||
|
|
||||||
import { ButtonStyled } from '#ui/components'
|
|
||||||
import TeleportOverflowMenu from '#ui/components/base/TeleportOverflowMenu.vue'
|
|
||||||
import { injectModrinthServerContext } from '#ui/providers'
|
|
||||||
|
|
||||||
const props = withDefaults(
|
|
||||||
defineProps<{
|
|
||||||
disabled?: boolean
|
|
||||||
showCopyIdAction?: boolean
|
|
||||||
showDebugInfo?: boolean
|
|
||||||
uptimeSeconds?: number
|
|
||||||
}>(),
|
|
||||||
{
|
|
||||||
disabled: false,
|
|
||||||
showCopyIdAction: false,
|
|
||||||
showDebugInfo: false,
|
|
||||||
uptimeSeconds: 0,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
const router = useRouter()
|
|
||||||
const { serverId } = injectModrinthServerContext()
|
|
||||||
|
|
||||||
const menuOptions = computed(() => [
|
|
||||||
{
|
|
||||||
id: 'allServers',
|
|
||||||
label: 'All servers',
|
|
||||||
icon: ServerIcon,
|
|
||||||
action: () => router.push('/hosting/manage'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'copy-id',
|
|
||||||
label: 'Copy ID',
|
|
||||||
icon: ClipboardCopyIcon,
|
|
||||||
action: () => copyId(),
|
|
||||||
shown: props.showCopyIdAction,
|
|
||||||
},
|
|
||||||
])
|
|
||||||
|
|
||||||
async function copyId() {
|
|
||||||
await navigator.clipboard.writeText(serverId)
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,3 +1,2 @@
|
|||||||
export { default as PanelServerActionButton } from './PanelServerActionButton.vue'
|
export { default as PanelServerActionButton } from './PanelServerActionButton.vue'
|
||||||
export { default as PanelServerOverflowMenu } from './PanelServerOverflowMenu.vue'
|
|
||||||
export { default as ServerManageHeader } from './ServerManageHeader.vue'
|
export { default as ServerManageHeader } from './ServerManageHeader.vue'
|
||||||
|
|||||||
@@ -172,12 +172,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<PanelServerOverflowMenu
|
|
||||||
:disabled="!!installError"
|
|
||||||
:uptime-seconds="uptimeSeconds"
|
|
||||||
:show-copy-id-action="showCopyIdAction"
|
|
||||||
:show-debug-info="showAdvancedDebugInfo"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</ServerManageHeader>
|
</ServerManageHeader>
|
||||||
@@ -348,6 +342,7 @@ import {
|
|||||||
CheckIcon,
|
CheckIcon,
|
||||||
CopyIcon,
|
CopyIcon,
|
||||||
FileIcon,
|
FileIcon,
|
||||||
|
GlobeIcon,
|
||||||
IssuesIcon,
|
IssuesIcon,
|
||||||
LayoutTemplateIcon,
|
LayoutTemplateIcon,
|
||||||
LoaderCircleIcon,
|
LoaderCircleIcon,
|
||||||
@@ -357,7 +352,6 @@ import {
|
|||||||
TransferIcon,
|
TransferIcon,
|
||||||
TriangleAlertIcon,
|
TriangleAlertIcon,
|
||||||
UsersIcon,
|
UsersIcon,
|
||||||
WorldIcon,
|
|
||||||
XIcon,
|
XIcon,
|
||||||
} from '@modrinth/assets'
|
} from '@modrinth/assets'
|
||||||
import { useQuery, useQueryClient } from '@tanstack/vue-query'
|
import { useQuery, useQueryClient } from '@tanstack/vue-query'
|
||||||
@@ -374,11 +368,7 @@ import ServerNotice from '#ui/components/base/ServerNotice.vue'
|
|||||||
import ConfirmLeaveModal from '#ui/components/modal/ConfirmLeaveModal.vue'
|
import ConfirmLeaveModal from '#ui/components/modal/ConfirmLeaveModal.vue'
|
||||||
import ServerPanelAdmonitions from '#ui/components/servers/admonitions/ServerPanelAdmonitions.vue'
|
import ServerPanelAdmonitions from '#ui/components/servers/admonitions/ServerPanelAdmonitions.vue'
|
||||||
import MedalServerCountdown from '#ui/components/servers/marketing/MedalServerCountdown.vue'
|
import MedalServerCountdown from '#ui/components/servers/marketing/MedalServerCountdown.vue'
|
||||||
import {
|
import { PanelServerActionButton, ServerManageHeader } from '#ui/components/servers/server-header'
|
||||||
PanelServerActionButton,
|
|
||||||
PanelServerOverflowMenu,
|
|
||||||
ServerManageHeader,
|
|
||||||
} from '#ui/components/servers/server-header'
|
|
||||||
import ServerSettingsModal from '#ui/components/servers/ServerSettingsModal.vue'
|
import ServerSettingsModal from '#ui/components/servers/ServerSettingsModal.vue'
|
||||||
import {
|
import {
|
||||||
hasServerPermission,
|
hasServerPermission,
|
||||||
@@ -423,7 +413,6 @@ const props = withDefaults(
|
|||||||
serverId: string
|
serverId: string
|
||||||
reloadPage: () => void
|
reloadPage: () => void
|
||||||
resolveViewer: () => Promise<{ userId: string | null; userRole: string | null }>
|
resolveViewer: () => Promise<{ userId: string | null; userRole: string | null }>
|
||||||
showCopyIdAction?: boolean
|
|
||||||
showAdvancedDebugInfo?: boolean
|
showAdvancedDebugInfo?: boolean
|
||||||
showUptime?: boolean
|
showUptime?: boolean
|
||||||
additionalTabs?: Tab[]
|
additionalTabs?: Tab[]
|
||||||
@@ -446,7 +435,6 @@ const props = withDefaults(
|
|||||||
constrainWidth?: boolean
|
constrainWidth?: boolean
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
showCopyIdAction: false,
|
|
||||||
showAdvancedDebugInfo: false,
|
showAdvancedDebugInfo: false,
|
||||||
showUptime: true,
|
showUptime: true,
|
||||||
additionalTabs: () => [],
|
additionalTabs: () => [],
|
||||||
@@ -1053,7 +1041,7 @@ const navLinks = computed<Tab[]>(() => [
|
|||||||
{
|
{
|
||||||
label: formatMessage(messages.instancesNav),
|
label: formatMessage(messages.instancesNav),
|
||||||
href: `/hosting/manage/${encodeURIComponent(props.serverId)}/instances`,
|
href: `/hosting/manage/${encodeURIComponent(props.serverId)}/instances`,
|
||||||
icon: WorldIcon,
|
icon: GlobeIcon,
|
||||||
subpages: [],
|
subpages: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user