From 049ccee94ee303210a9f92aca99395d30fe244db Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Sat, 11 Sep 2021 17:40:38 +0200 Subject: [PATCH] Disable save buttons when slave is offline With the instance status unknown now meaning assigned slave is offline the save list buttons can now easily be disabled using this status. Disable the upload save, download save and delete save buttons when the slave is offline or the instance is not assigned to a slave. --- packages/web_ui/src/components/SavesList.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/web_ui/src/components/SavesList.jsx b/packages/web_ui/src/components/SavesList.jsx index 20c9fee5..8b61f063 100644 --- a/packages/web_ui/src/components/SavesList.jsx +++ b/packages/web_ui/src/components/SavesList.jsx @@ -29,6 +29,7 @@ export default function SavesList(props) { let [starting, setStarting] = useState(false); let [uploadingFiles, setUploadingFiles] = useState([]); + let slaveOffline = ["unassigned", "unknown"].includes(props.instance.status); const saveTable = Load save + , }} @@ -141,6 +143,7 @@ export default function SavesList(props) { } let uploadProps = { + disabled: slaveOffline, name: "file", accept: ".zip", headers: { @@ -157,7 +160,7 @@ export default function SavesList(props) { return
- + />