Compare commits

...

2 commits

Author SHA1 Message Date
Lance Pioch
723dc7a53d Also hide power buttons 2022-11-08 21:14:36 -05:00
Lance Pioch
b623902c19 Show danger alert to front end user 2022-11-08 21:14:25 -05:00

View file

@ -20,6 +20,7 @@ const ServerConsoleContainer = () => {
const isTransferring = ServerContext.useStoreState((state) => state.server.data!.isTransferring); const isTransferring = ServerContext.useStoreState((state) => state.server.data!.isTransferring);
const eggFeatures = ServerContext.useStoreState((state) => state.server.data!.eggFeatures, isEqual); const eggFeatures = ServerContext.useStoreState((state) => state.server.data!.eggFeatures, isEqual);
const isNodeUnderMaintenance = ServerContext.useStoreState((state) => state.server.data!.isNodeUnderMaintenance); const isNodeUnderMaintenance = ServerContext.useStoreState((state) => state.server.data!.isNodeUnderMaintenance);
const isSuspended = ServerContext.useStoreState((state) => state.server.data!.status === 'suspended');
return ( return (
<ServerContentBlock title={'Console'}> <ServerContentBlock title={'Console'}>
@ -32,15 +33,22 @@ const ServerConsoleContainer = () => {
: 'This server is currently being transferred to another node and all actions are unavailable.'} : 'This server is currently being transferred to another node and all actions are unavailable.'}
</Alert> </Alert>
)} )}
{isSuspended && (
<Alert type={'danger'} className={'mb-4'}>
This server is currently suspended.
</Alert>
)}
<div className={'grid grid-cols-4 gap-4 mb-4'}> <div className={'grid grid-cols-4 gap-4 mb-4'}>
<div className={'hidden sm:block sm:col-span-2 lg:col-span-3 pr-4'}> <div className={'hidden sm:block sm:col-span-2 lg:col-span-3 pr-4'}>
<h1 className={'font-header text-2xl text-gray-50 leading-relaxed line-clamp-1'}>{name}</h1> <h1 className={'font-header text-2xl text-gray-50 leading-relaxed line-clamp-1'}>{name}</h1>
<p className={'text-sm line-clamp-2'}>{description}</p> <p className={'text-sm line-clamp-2'}>{description}</p>
</div> </div>
<div className={'col-span-4 sm:col-span-2 lg:col-span-1 self-end'}> <div className={'col-span-4 sm:col-span-2 lg:col-span-1 self-end'}>
<Can action={['control.start', 'control.stop', 'control.restart']} matchAny> {!isSuspended && (
<PowerButtons className={'flex sm:justify-end space-x-2'} /> <Can action={['control.start', 'control.stop', 'control.restart']} matchAny>
</Can> <PowerButtons className={'flex sm:justify-end space-x-2'} />
</Can>
)}
</div> </div>
</div> </div>
<div className={'grid grid-cols-4 gap-2 sm:gap-4 mb-4'}> <div className={'grid grid-cols-4 gap-2 sm:gap-4 mb-4'}>