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 eggFeatures = ServerContext.useStoreState((state) => state.server.data!.eggFeatures, isEqual);
const isNodeUnderMaintenance = ServerContext.useStoreState((state) => state.server.data!.isNodeUnderMaintenance);
const isSuspended = ServerContext.useStoreState((state) => state.server.data!.status === 'suspended');
return (
<ServerContentBlock title={'Console'}>
@ -32,15 +33,22 @@ const ServerConsoleContainer = () => {
: 'This server is currently being transferred to another node and all actions are unavailable.'}
</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={'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>
<p className={'text-sm line-clamp-2'}>{description}</p>
</div>
<div className={'col-span-4 sm:col-span-2 lg:col-span-1 self-end'}>
<Can action={['control.start', 'control.stop', 'control.restart']} matchAny>
<PowerButtons className={'flex sm:justify-end space-x-2'} />
</Can>
{!isSuspended && (
<Can action={['control.start', 'control.stop', 'control.restart']} matchAny>
<PowerButtons className={'flex sm:justify-end space-x-2'} />
</Can>
)}
</div>
</div>
<div className={'grid grid-cols-4 gap-2 sm:gap-4 mb-4'}>