diff --git a/apps/frontend/src/components/ui/servers/PanelServerActionButton.vue b/apps/frontend/src/components/ui/servers/PanelServerActionButton.vue index 073909fd3..8eb08a86c 100644 --- a/apps/frontend/src/components/ui/servers/PanelServerActionButton.vue +++ b/apps/frontend/src/components/ui/servers/PanelServerActionButton.vue @@ -89,6 +89,10 @@ Details + @@ -108,6 +112,7 @@ import { ServerIcon, InfoIcon, MoreVerticalIcon, + ClipboardCopyIcon, } from "@modrinth/assets"; import { ButtonStyled, NewModal } from "@modrinth/ui"; import { useRouter } from "vue-router"; @@ -116,6 +121,8 @@ import { useStorage } from "@vueuse/core"; type ServerAction = "start" | "stop" | "restart" | "kill"; type ServerState = "stopped" | "starting" | "running" | "stopping" | "restarting"; +const flags = useFeatureFlags(); + interface PowerAction { action: ServerAction; nextState: ServerState; @@ -198,8 +205,19 @@ const menuOptions = computed(() => [ icon: InfoIcon, action: () => detailsModal.value?.show(), }, + { + id: "copy-id", + label: "Copy ID", + icon: ClipboardCopyIcon, + action: () => copyId(), + shown: flags.value.developerMode, + }, ]); +async function copyId() { + await navigator.clipboard.writeText(serverId as string); +} + function initiateAction(action: ServerAction) { if (!canTakeAction.value) return; diff --git a/apps/frontend/src/components/ui/servers/notice/AssignNoticeModal.vue b/apps/frontend/src/components/ui/servers/notice/AssignNoticeModal.vue new file mode 100644 index 000000000..e57ac27aa --- /dev/null +++ b/apps/frontend/src/components/ui/servers/notice/AssignNoticeModal.vue @@ -0,0 +1,201 @@ + + diff --git a/apps/frontend/src/components/ui/servers/notice/NoticeDashboardItem.vue b/apps/frontend/src/components/ui/servers/notice/NoticeDashboardItem.vue new file mode 100644 index 000000000..434f3b85a --- /dev/null +++ b/apps/frontend/src/components/ui/servers/notice/NoticeDashboardItem.vue @@ -0,0 +1,118 @@ + + diff --git a/apps/frontend/src/composables/pyroServers.ts b/apps/frontend/src/composables/pyroServers.ts index 206063a25..eb3d32a0b 100644 --- a/apps/frontend/src/composables/pyroServers.ts +++ b/apps/frontend/src/composables/pyroServers.ts @@ -1,5 +1,6 @@ // usePyroServer is a composable that interfaces with the REDACTED API to get data and control the users server import { $fetch, FetchError } from "ofetch"; +import type { ServerNotice } from "@modrinth/utils"; interface PyroFetchOptions { method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; @@ -289,6 +290,7 @@ interface General { sftp_password: string; sftp_host: string; datacenter?: string; + notices?: ServerNotice[]; } interface Allocation { diff --git a/apps/frontend/src/layouts/default.vue b/apps/frontend/src/layouts/default.vue index 118074246..a387f4932 100644 --- a/apps/frontend/src/layouts/default.vue +++ b/apps/frontend/src/layouts/default.vue @@ -298,6 +298,12 @@ link: '/admin/user_email', shown: isAdmin(auth.user), }, + { + id: 'servers-notices', + color: 'primary', + link: '/admin/servers/notices', + shown: isAdmin(auth.user), + }, ]" >