Disable buttons when not fully connected to instance
This commit is contained in:
parent
1c00c3b234
commit
74767ed6a2
3 changed files with 5 additions and 4 deletions
|
@ -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}
|
||||
</p>
|
||||
<p css={tw`text-xs mt-2`}>
|
||||
<FontAwesomeIcon icon={faMicrochip} fixedWidth css={tw`mr-1`}/> {cpu.toFixed(2)}%
|
||||
|
@ -112,6 +112,7 @@ export default () => {
|
|||
size={'xsmall'}
|
||||
isSecondary
|
||||
css={tw`mr-2`}
|
||||
disabled={!status}
|
||||
onClick={e => {
|
||||
e.preventDefault();
|
||||
sendPowerCommand('restart');
|
||||
|
|
|
@ -16,7 +16,7 @@ const StopOrKillButton = ({ onPress }: { onPress: (action: PowerAction) => void
|
|||
<Button
|
||||
color={'red'}
|
||||
size={'xsmall'}
|
||||
disabled={status === 'offline'}
|
||||
disabled={!status || status === 'offline'}
|
||||
onClick={e => {
|
||||
e.preventDefault();
|
||||
onPress(clicked ? 'kill' : 'stop');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue