import React, { memo } from 'react'; import { ServerContext } from '@/state/server'; import Can from '@/components/elements/Can'; import ServerContentBlock from '@/components/elements/ServerContentBlock'; import isEqual from 'react-fast-compare'; import Spinner from '@/components/elements/Spinner'; import Features from '@feature/Features'; import Console from '@/components/server/console/Console'; import StatGraphs from '@/components/server/console/StatGraphs'; import PowerButtons from '@/components/server/console/PowerButtons'; import ServerDetailsBlock from '@/components/server/console/ServerDetailsBlock'; import { Alert } from '@/components/elements/alert'; import BeforeContent from '@/blueprint/components/Server/Terminal/BeforeContent'; import AfterContent from '@/blueprint/components/Server/Terminal/AfterContent'; export type PowerAction = 'start' | 'stop' | 'restart' | 'kill'; const ServerConsoleContainer = () => { const name = ServerContext.useStoreState((state) => state.server.data!.name); const description = ServerContext.useStoreState((state) => state.server.data!.description); const isInstalling = ServerContext.useStoreState((state) => state.server.isInstalling); const isTransferring = ServerContext.useStoreState((state) => state.server.data!.isTransferring); const eggFeatures = ServerContext.useStoreState((state) => state.server.data!.eggFeatures, isEqual); const isNodeUnderMaintenance = ServerContext.useStoreState((state) => state.server.data!.isNodeUnderMaintenance); return ( {(isNodeUnderMaintenance || isInstalling || isTransferring) && ( {isNodeUnderMaintenance ? 'The node of this server is currently under maintenance and all actions are unavailable.' : isInstalling ? 'This server is currently running its installation process and most actions are unavailable.' : 'This server is currently being transferred to another node and all actions are unavailable.'} )}

{name}

{description}

); }; export default memo(ServerConsoleContainer, isEqual);