|
|
@ -30,6 +30,20 @@ const SimpleOperationsPanel: FC<SimpleOperationsPanelProps> = ({ |
|
|
|
), |
|
|
|
), |
|
|
|
[title], |
|
|
|
[title], |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
const messageElement = useMemo( |
|
|
|
|
|
|
|
() => |
|
|
|
|
|
|
|
message && ( |
|
|
|
|
|
|
|
<Grid item sm={2} xs={1}> |
|
|
|
|
|
|
|
<MessageBox |
|
|
|
|
|
|
|
{...message} |
|
|
|
|
|
|
|
onClose={() => { |
|
|
|
|
|
|
|
setMessage(undefined); |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
[message], |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<Panel> |
|
|
|
<Panel> |
|
|
@ -69,13 +83,7 @@ const SimpleOperationsPanel: FC<SimpleOperationsPanelProps> = ({ |
|
|
|
.catch((error) => { |
|
|
|
.catch((error) => { |
|
|
|
const emsg = handleAPIError(error); |
|
|
|
const emsg = handleAPIError(error); |
|
|
|
|
|
|
|
|
|
|
|
emsg.children = ( |
|
|
|
emsg.children = `Failed to ${actionText} "Install target". ${emsg.children}`; |
|
|
|
<> |
|
|
|
|
|
|
|
Failed to {actionText} "Install |
|
|
|
|
|
|
|
target"; CAUSE: |
|
|
|
|
|
|
|
{emsg.children} |
|
|
|
|
|
|
|
</> |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setMessage(emsg); |
|
|
|
setMessage(emsg); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -102,12 +110,7 @@ const SimpleOperationsPanel: FC<SimpleOperationsPanelProps> = ({ |
|
|
|
api.put('/command/update-system').catch((error) => { |
|
|
|
api.put('/command/update-system').catch((error) => { |
|
|
|
const emsg = handleAPIError(error); |
|
|
|
const emsg = handleAPIError(error); |
|
|
|
|
|
|
|
|
|
|
|
emsg.children = ( |
|
|
|
emsg.children = `Failed to initiate system update. ${emsg.children}`; |
|
|
|
<> |
|
|
|
|
|
|
|
Failed to initiate system update; CAUSE: |
|
|
|
|
|
|
|
{emsg.children} |
|
|
|
|
|
|
|
</> |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setMessage(emsg); |
|
|
|
setMessage(emsg); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -119,7 +122,6 @@ const SimpleOperationsPanel: FC<SimpleOperationsPanelProps> = ({ |
|
|
|
Update system |
|
|
|
Update system |
|
|
|
</StretchedButton> |
|
|
|
</StretchedButton> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item sm={2} xs={1}> |
|
|
|
<Grid item sm={2} xs={1}> |
|
|
|
<StretchedButton>Reconfigure striker</StretchedButton> |
|
|
|
<StretchedButton>Reconfigure striker</StretchedButton> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
@ -135,12 +137,7 @@ const SimpleOperationsPanel: FC<SimpleOperationsPanelProps> = ({ |
|
|
|
api.put('/command/reboot-host').catch((error) => { |
|
|
|
api.put('/command/reboot-host').catch((error) => { |
|
|
|
const emsg = handleAPIError(error); |
|
|
|
const emsg = handleAPIError(error); |
|
|
|
|
|
|
|
|
|
|
|
emsg.children = ( |
|
|
|
emsg.children = `Failed to initiate system reboot. ${emsg.children}`; |
|
|
|
<> |
|
|
|
|
|
|
|
Failed to initiate system reboot; CAUSE: |
|
|
|
|
|
|
|
{emsg.children} |
|
|
|
|
|
|
|
</> |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setMessage(emsg); |
|
|
|
setMessage(emsg); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -164,12 +161,7 @@ const SimpleOperationsPanel: FC<SimpleOperationsPanelProps> = ({ |
|
|
|
api.put('/command/poweroff-host').catch((error) => { |
|
|
|
api.put('/command/poweroff-host').catch((error) => { |
|
|
|
const emsg = handleAPIError(error); |
|
|
|
const emsg = handleAPIError(error); |
|
|
|
|
|
|
|
|
|
|
|
emsg.children = ( |
|
|
|
emsg.children = `Failed to initiate system shutdown. ${emsg.children}`; |
|
|
|
<> |
|
|
|
|
|
|
|
Failed to initiate system shutdown; CAUSE: |
|
|
|
|
|
|
|
{emsg.children} |
|
|
|
|
|
|
|
</> |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setMessage(emsg); |
|
|
|
setMessage(emsg); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -181,16 +173,7 @@ const SimpleOperationsPanel: FC<SimpleOperationsPanelProps> = ({ |
|
|
|
Shutdown |
|
|
|
Shutdown |
|
|
|
</StretchedButton> |
|
|
|
</StretchedButton> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
<Grid item sm={2} xs={1}> |
|
|
|
{messageElement} |
|
|
|
{message && ( |
|
|
|
|
|
|
|
<MessageBox |
|
|
|
|
|
|
|
{...message} |
|
|
|
|
|
|
|
onClose={() => { |
|
|
|
|
|
|
|
setMessage(undefined); |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
</Panel> |
|
|
|
</Panel> |
|
|
|
); |
|
|
|
); |
|
|
|