From 3f22a729b5248ecc4fca95b7a3215c9f90563b02 Mon Sep 17 00:00:00 2001 From: Ryan Lewis Date: Wed, 11 Sep 2024 18:00:53 -0500 Subject: [PATCH] Fix admin action corner cases --- .../components/AdminButtons/CancelButton.vue | 1 + .../AdminButtons/LockUnlockButton.vue | 9 +++++ .../AdminButtons/PauseResumeButton.vue | 12 ++++++- .../components/AdminButtons/ResetButton.vue | 3 +- .../AdminButtons/SafetyStopButton.vue | 3 +- .../AdminButtons/ShutdownButton.vue | 3 +- src/ui/src/components/Dashboard.vue | 12 +++---- src/wei/core/admin.py | 34 ++++++++++++++----- src/wei/core/state_manager.py | 16 +++++++++ 9 files changed, 74 insertions(+), 19 deletions(-) diff --git a/src/ui/src/components/AdminButtons/CancelButton.vue b/src/ui/src/components/AdminButtons/CancelButton.vue index 91606d03..a25cb468 100644 --- a/src/ui/src/components/AdminButtons/CancelButton.vue +++ b/src/ui/src/components/AdminButtons/CancelButton.vue @@ -28,6 +28,7 @@ main_url: string; module?: string; module_status?: string; + wc_state?: any; }>(); const cancel_url = ref() diff --git a/src/ui/src/components/AdminButtons/LockUnlockButton.vue b/src/ui/src/components/AdminButtons/LockUnlockButton.vue index e630cd83..534f981d 100644 --- a/src/ui/src/components/AdminButtons/LockUnlockButton.vue +++ b/src/ui/src/components/AdminButtons/LockUnlockButton.vue @@ -27,6 +27,7 @@ const props = defineProps<{ main_url: string; module?: string; + wc_state?: any; module_status?: string; }>(); @@ -53,8 +54,16 @@ if (props.module_status == 'LOCKED') { isLocked.value = true } else { + if (props.wc_state) { + if (props.wc_state.locked) { + isLocked.value = true + } else { + isLocked.value = false + } + } else { isLocked.value = false } + } }) } diff --git a/src/ui/src/components/AdminButtons/PauseResumeButton.vue b/src/ui/src/components/AdminButtons/PauseResumeButton.vue index 374968fd..ac17529c 100644 --- a/src/ui/src/components/AdminButtons/PauseResumeButton.vue +++ b/src/ui/src/components/AdminButtons/PauseResumeButton.vue @@ -24,12 +24,13 @@