Make it easier for plugins to extend the navigation and add routes
This commit is contained in:
parent
88a7bd7578
commit
04e97cc67e
5 changed files with 198 additions and 116 deletions
|
@ -0,0 +1,33 @@
|
|||
import React from 'react';
|
||||
import { ServerContext } from '@/state/server';
|
||||
import ScreenBlock from '@/components/elements/ScreenBlock';
|
||||
import ServerInstallSvg from '@/assets/images/server_installing.svg';
|
||||
import ServerErrorSvg from '@/assets/images/server_error.svg';
|
||||
import ServerRestoreSvg from '@/assets/images/server_restore.svg';
|
||||
|
||||
export default () => {
|
||||
const status = ServerContext.useStoreState(state => state.server.data?.status || null);
|
||||
const isTransferring = ServerContext.useStoreState(state => state.server.data?.isTransferring || false);
|
||||
|
||||
return (
|
||||
status === 'installing' || status === 'install_failed' ?
|
||||
<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.'}
|
||||
/>
|
||||
:
|
||||
<ScreenBlock
|
||||
title={isTransferring ? 'Transferring' : 'Restoring from Backup'}
|
||||
image={ServerRestoreSvg}
|
||||
message={isTransferring ? 'Your server is being transfered to a new node, please check back later.' : 'Your server is currently being restored from a backup, please check back in a few minutes.'}
|
||||
/>
|
||||
);
|
||||
};
|
Reference in a new issue