From 74767ed6a2944babfc0d93ae02aeb062bfaa2a27 Mon Sep 17 00:00:00 2001
From: Dane Everitt
Date: Fri, 11 Sep 2020 23:18:01 -0700
Subject: [PATCH] Disable buttons when not fully connected to instance
---
resources/scripts/components/server/ServerConsole.tsx | 3 ++-
resources/scripts/components/server/StopOrKillButton.tsx | 2 +-
resources/scripts/state/server/index.ts | 4 ++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/resources/scripts/components/server/ServerConsole.tsx b/resources/scripts/components/server/ServerConsole.tsx
index 253cb05e2..ad84505c9 100644
--- a/resources/scripts/components/server/ServerConsole.tsx
+++ b/resources/scripts/components/server/ServerConsole.tsx
@@ -75,7 +75,7 @@ export default () => {
status === 'offline' ? tw`text-red-500` : (status === 'running' ? tw`text-green-500` : tw`text-yellow-500`),
]}
/>
- {status}
+ {!status ? 'Connecting...' : status}
{cpu.toFixed(2)}%
@@ -112,6 +112,7 @@ export default () => {
size={'xsmall'}
isSecondary
css={tw`mr-2`}
+ disabled={!status}
onClick={e => {
e.preventDefault();
sendPowerCommand('restart');
diff --git a/resources/scripts/components/server/StopOrKillButton.tsx b/resources/scripts/components/server/StopOrKillButton.tsx
index ee9d40d2d..605ca397e 100644
--- a/resources/scripts/components/server/StopOrKillButton.tsx
+++ b/resources/scripts/components/server/StopOrKillButton.tsx
@@ -16,7 +16,7 @@ const StopOrKillButton = ({ onPress }: { onPress: (action: PowerAction) => void