From 936057f39ed7899a053e2baf797d5f9b94c6f969 Mon Sep 17 00:00:00 2001 From: Josue Date: Fri, 28 May 2021 13:17:24 -0400 Subject: [PATCH] fix: change server status value to match what's in the specs --- striker-ui/components/Servers.tsx | 4 ++-- striker-ui/lib/consts/SERVERS.ts | 8 ++++---- striker-ui/types/AnvilServers.d.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/striker-ui/components/Servers.tsx b/striker-ui/components/Servers.tsx index 0da3097e..f0685cd2 100644 --- a/striker-ui/components/Servers.tsx +++ b/striker-ui/components/Servers.tsx @@ -37,7 +37,7 @@ const selectDecorator = (state: string): Colours => { switch (state) { case 'running': return 'ok'; - case 'shut_off': + case 'shut off': return 'off'; case 'crashed': return 'error'; @@ -86,7 +86,7 @@ const Servers = ({ anvil }: { anvil: AnvilListItem[] }): JSX.Element => { } /> - {server.server_state !== 'shut_off' && + {server.server_state !== 'shut off' && server.server_state !== 'crashed' && anvil[ anvil.findIndex((a) => a.anvil_uuid === uuid) diff --git a/striker-ui/lib/consts/SERVERS.ts b/striker-ui/lib/consts/SERVERS.ts index aba4b1c0..b010067c 100644 --- a/striker-ui/lib/consts/SERVERS.ts +++ b/striker-ui/lib/consts/SERVERS.ts @@ -2,10 +2,10 @@ const serverState: ReadonlyMap = new Map([ ['running', 'Running'], ['idle', 'Idle'], ['paused', 'Paused'], - ['in_shutdown', 'Shutting Down'], - ['shut_off', 'Off'], - ['crashed', 'crashed'], - ['pmsuspended', 'Suspended'], + ['in shutdown', 'Shutting Down'], + ['shut off', 'Off'], + ['crashed', 'Crashed'], + ['pmsuspended', 'PM Suspended'], ['migrating', 'Migrating'], ]); diff --git a/striker-ui/types/AnvilServers.d.ts b/striker-ui/types/AnvilServers.d.ts index 96413218..d8b3e88d 100644 --- a/striker-ui/types/AnvilServers.d.ts +++ b/striker-ui/types/AnvilServers.d.ts @@ -5,8 +5,8 @@ declare type AnvilServer = { | 'running' | 'idle' | 'paused' - | 'in_shutdown' - | 'shut_off' + | 'in shutdown' + | 'shut off' | 'crashed' | 'pmsuspended' | 'migrating';