fix: change server status value to match what's in the specs

main
Josue 4 years ago committed by Tsu-ba-me
parent 64f0c2d756
commit 936057f39e
  1. 4
      striker-ui/components/Servers.tsx
  2. 8
      striker-ui/lib/consts/SERVERS.ts
  3. 4
      striker-ui/types/AnvilServers.d.ts

@ -37,7 +37,7 @@ const selectDecorator = (state: string): Colours => {
switch (state) { switch (state) {
case 'running': case 'running':
return 'ok'; return 'ok';
case 'shut_off': case 'shut off':
return 'off'; return 'off';
case 'crashed': case 'crashed':
return 'error'; return 'error';
@ -86,7 +86,7 @@ const Servers = ({ anvil }: { anvil: AnvilListItem[] }): JSX.Element => {
} }
/> />
</Box> </Box>
{server.server_state !== 'shut_off' && {server.server_state !== 'shut off' &&
server.server_state !== 'crashed' && server.server_state !== 'crashed' &&
anvil[ anvil[
anvil.findIndex((a) => a.anvil_uuid === uuid) anvil.findIndex((a) => a.anvil_uuid === uuid)

@ -2,10 +2,10 @@ const serverState: ReadonlyMap<string, string> = new Map([
['running', 'Running'], ['running', 'Running'],
['idle', 'Idle'], ['idle', 'Idle'],
['paused', 'Paused'], ['paused', 'Paused'],
['in_shutdown', 'Shutting Down'], ['in shutdown', 'Shutting Down'],
['shut_off', 'Off'], ['shut off', 'Off'],
['crashed', 'crashed'], ['crashed', 'Crashed'],
['pmsuspended', 'Suspended'], ['pmsuspended', 'PM Suspended'],
['migrating', 'Migrating'], ['migrating', 'Migrating'],
]); ]);

@ -5,8 +5,8 @@ declare type AnvilServer = {
| 'running' | 'running'
| 'idle' | 'idle'
| 'paused' | 'paused'
| 'in_shutdown' | 'in shutdown'
| 'shut_off' | 'shut off'
| 'crashed' | 'crashed'
| 'pmsuspended' | 'pmsuspended'
| 'migrating'; | 'migrating';

Loading…
Cancel
Save