diff --git a/app/Transformers/Api/Client/ServerTransformer.php b/app/Transformers/Api/Client/ServerTransformer.php index ac3ab26ba..637772094 100644 --- a/app/Transformers/Api/Client/ServerTransformer.php +++ b/app/Transformers/Api/Client/ServerTransformer.php @@ -46,6 +46,7 @@ class ServerTransformer extends BaseClientTransformer return [ 'server_owner' => $this->getKey()->user_id === $server->owner_id, 'identifier' => $server->uuidShort, + 'internal_id' => $server->id, 'uuid' => $server->uuid, 'name' => $server->name, 'node' => $server->node->name, diff --git a/resources/scripts/api/server/getServer.ts b/resources/scripts/api/server/getServer.ts index 65363343c..95fda0ddc 100644 --- a/resources/scripts/api/server/getServer.ts +++ b/resources/scripts/api/server/getServer.ts @@ -13,6 +13,7 @@ export interface Allocation { export interface Server { id: string; + internalId: number; uuid: string; name: string; node: string; @@ -44,6 +45,7 @@ export interface Server { export const rawDataToServerObject = ({ attributes: data }: FractalResponseData): Server => ({ id: data.identifier, + internalId: data.internal_id, uuid: data.uuid, name: data.name, node: data.node, diff --git a/resources/scripts/routers/ServerRouter.tsx b/resources/scripts/routers/ServerRouter.tsx index ec6bc20b4..68f2fbf9c 100644 --- a/resources/scripts/routers/ServerRouter.tsx +++ b/resources/scripts/routers/ServerRouter.tsx @@ -29,6 +29,8 @@ import InstallListener from '@/components/server/InstallListener'; import StartupContainer from '@/components/server/startup/StartupContainer'; import requireServerPermission from '@/hoc/requireServerPermission'; import ErrorBoundary from '@/components/elements/ErrorBoundary'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons'; const ServerRouter = ({ match, location }: RouteComponentProps<{ id: string }>) => { const rootAdmin = useStoreState(state => state.user.data!.rootAdmin); @@ -40,6 +42,7 @@ const ServerRouter = ({ match, location }: RouteComponentProps<{ id: string }>) const isInstalling = ServerContext.useStoreState(state => state.server.data?.isInstalling); const getServer = ServerContext.useStoreActions(actions => actions.server.getServer); const clearServerState = ServerContext.useStoreActions(actions => actions.clearServerState); + const serverId = ServerContext.useStoreState(state => state.server.data?.internalId); useEffect(() => () => { clearServerState(); @@ -109,6 +112,11 @@ const ServerRouter = ({ match, location }: RouteComponentProps<{ id: string }>) Settings + {rootAdmin && + + + + }