Update logic for tracking a server's transfer state

This commit is contained in:
Matthew Penner 2020-12-16 09:34:47 -07:00
parent 5d03c0d2e5
commit e6c4a68e4a
20 changed files with 206 additions and 74 deletions

View file

@ -17,6 +17,7 @@ const ChunkedStatGraphs = lazy(() => import(/* webpackChunkName: "graphs" */'@/c
const ServerConsole = () => {
const isInstalling = ServerContext.useStoreState(state => state.server.data!.isInstalling);
const isTransferring = ServerContext.useStoreState(state => state.server.data!.isTransferring);
// @ts-ignore
const eggFeatures: string[] = ServerContext.useStoreState(state => state.server.data!.eggFeatures, isEqual);
@ -24,11 +25,7 @@ const ServerConsole = () => {
<ServerContentBlock title={'Console'} css={tw`flex flex-wrap`}>
<div css={tw`w-full lg:w-1/4`}>
<ServerDetailsBlock/>
{!isInstalling ?
<Can action={[ 'control.start', 'control.stop', 'control.restart' ]} matchAny>
<PowerControls/>
</Can>
:
{isInstalling ?
<div css={tw`mt-4 rounded bg-yellow-500 p-3`}>
<ContentContainer>
<p css={tw`text-sm text-yellow-900`}>
@ -37,6 +34,20 @@ const ServerConsole = () => {
</p>
</ContentContainer>
</div>
:
isTransferring ?
<div css={tw`mt-4 rounded bg-yellow-500 p-3`}>
<ContentContainer>
<p css={tw`text-sm text-yellow-900`}>
This server is currently being transferred to another node and all actions
are unavailable.
</p>
</ContentContainer>
</div>
:
<Can action={[ 'control.start', 'control.stop', 'control.restart' ]} matchAny>
<PowerControls/>
</Can>
}
</div>
<div css={tw`w-full lg:w-3/4 mt-4 lg:mt-0 lg:pl-4`}>