2022-06-12 15:36:55 +00:00
|
|
|
import ServerInstallSvg from '@/assets/images/server_installing.svg';
|
|
|
|
import ServerErrorSvg from '@/assets/images/server_error.svg';
|
|
|
|
import ServerRestoreSvg from '@/assets/images/server_restore.svg';
|
2022-11-25 20:25:03 +00:00
|
|
|
import ScreenBlock from '@/components/elements/ScreenBlock';
|
|
|
|
import { ServerContext } from '@/state/server';
|
2022-06-12 15:36:55 +00:00
|
|
|
|
|
|
|
export default () => {
|
2022-11-25 20:25:03 +00:00
|
|
|
const status = ServerContext.useStoreState(state => state.server.data?.status || null);
|
|
|
|
const isTransferring = ServerContext.useStoreState(state => state.server.data?.isTransferring || false);
|
2022-11-06 23:02:30 +00:00
|
|
|
const isNodeUnderMaintenance = ServerContext.useStoreState(
|
2022-11-25 20:25:03 +00:00
|
|
|
state => state.server.data?.isNodeUnderMaintenance || false,
|
2022-11-06 23:02:30 +00:00
|
|
|
);
|
2022-06-12 15:36:55 +00:00
|
|
|
|
2023-01-17 22:21:31 +00:00
|
|
|
return status === 'installing' || status === 'install_failed' || status === 'reinstall_failed' ? (
|
2022-06-26 19:13:52 +00:00
|
|
|
<ScreenBlock
|
|
|
|
title={'Running Installer'}
|
|
|
|
image={ServerInstallSvg}
|
|
|
|
message={'Your server should be ready soon, please try again in a few minutes.'}
|
|
|
|
/>
|
|
|
|
) : status === 'suspended' ? (
|
|
|
|
<ScreenBlock
|
|
|
|
title={'Server Suspended'}
|
|
|
|
image={ServerErrorSvg}
|
|
|
|
message={'This server is suspended and cannot be accessed.'}
|
|
|
|
/>
|
2022-11-06 23:02:30 +00:00
|
|
|
) : isNodeUnderMaintenance ? (
|
|
|
|
<ScreenBlock
|
|
|
|
title={'Node under Maintenance'}
|
|
|
|
image={ServerErrorSvg}
|
|
|
|
message={'The node of this server is currently under maintenance.'}
|
|
|
|
/>
|
2022-06-26 19:13:52 +00:00
|
|
|
) : (
|
|
|
|
<ScreenBlock
|
|
|
|
title={isTransferring ? 'Transferring' : 'Restoring from Backup'}
|
|
|
|
image={ServerRestoreSvg}
|
|
|
|
message={
|
|
|
|
isTransferring
|
2022-11-25 20:25:03 +00:00
|
|
|
? 'Your server is being transferred to a new node, please check back later.'
|
2022-06-26 19:13:52 +00:00
|
|
|
: 'Your server is currently being restored from a backup, please check back in a few minutes.'
|
|
|
|
}
|
|
|
|
/>
|
2022-06-12 15:36:55 +00:00
|
|
|
);
|
|
|
|
};
|