mirror of
https://github.com/modrinth/code.git
synced 2026-08-31 03:55:59 +00:00
qa: pass
This commit is contained in:
@@ -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 PanelServerOverflowMenu } from './PanelServerOverflowMenu.vue'
|
||||
export { default as ServerManageHeader } from './ServerManageHeader.vue'
|
||||
|
||||
@@ -172,12 +172,6 @@
|
||||
</div>
|
||||
</template>
|
||||
</Tooltip>
|
||||
<PanelServerOverflowMenu
|
||||
:disabled="!!installError"
|
||||
:uptime-seconds="uptimeSeconds"
|
||||
:show-copy-id-action="showCopyIdAction"
|
||||
:show-debug-info="showAdvancedDebugInfo"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</ServerManageHeader>
|
||||
@@ -348,6 +342,7 @@ import {
|
||||
CheckIcon,
|
||||
CopyIcon,
|
||||
FileIcon,
|
||||
GlobeIcon,
|
||||
IssuesIcon,
|
||||
LayoutTemplateIcon,
|
||||
LoaderCircleIcon,
|
||||
@@ -357,7 +352,6 @@ import {
|
||||
TransferIcon,
|
||||
TriangleAlertIcon,
|
||||
UsersIcon,
|
||||
WorldIcon,
|
||||
XIcon,
|
||||
} from '@modrinth/assets'
|
||||
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 ServerPanelAdmonitions from '#ui/components/servers/admonitions/ServerPanelAdmonitions.vue'
|
||||
import MedalServerCountdown from '#ui/components/servers/marketing/MedalServerCountdown.vue'
|
||||
import {
|
||||
PanelServerActionButton,
|
||||
PanelServerOverflowMenu,
|
||||
ServerManageHeader,
|
||||
} from '#ui/components/servers/server-header'
|
||||
import { PanelServerActionButton, ServerManageHeader } from '#ui/components/servers/server-header'
|
||||
import ServerSettingsModal from '#ui/components/servers/ServerSettingsModal.vue'
|
||||
import {
|
||||
hasServerPermission,
|
||||
@@ -423,7 +413,6 @@ const props = withDefaults(
|
||||
serverId: string
|
||||
reloadPage: () => void
|
||||
resolveViewer: () => Promise<{ userId: string | null; userRole: string | null }>
|
||||
showCopyIdAction?: boolean
|
||||
showAdvancedDebugInfo?: boolean
|
||||
showUptime?: boolean
|
||||
additionalTabs?: Tab[]
|
||||
@@ -446,7 +435,6 @@ const props = withDefaults(
|
||||
constrainWidth?: boolean
|
||||
}>(),
|
||||
{
|
||||
showCopyIdAction: false,
|
||||
showAdvancedDebugInfo: false,
|
||||
showUptime: true,
|
||||
additionalTabs: () => [],
|
||||
@@ -1053,7 +1041,7 @@ const navLinks = computed<Tab[]>(() => [
|
||||
{
|
||||
label: formatMessage(messages.instancesNav),
|
||||
href: `/hosting/manage/${encodeURIComponent(props.serverId)}/instances`,
|
||||
icon: WorldIcon,
|
||||
icon: GlobeIcon,
|
||||
subpages: [],
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user