diff --git a/web/app/src/assets/base.css b/web/app/src/assets/base.css index 0c3198eb..b2ca0a42 100644 --- a/web/app/src/assets/base.css +++ b/web/app/src/assets/base.css @@ -223,7 +223,7 @@ h2.column-title { color: var(--color-text-hint); font-size: var(--font-size-base); margin: 0; - padding-bottom: var(--spacer-xs); + padding-bottom: var(--spacer-sm); } h3.sub-title { diff --git a/web/app/src/components/SwitchCheckbox.vue b/web/app/src/components/SwitchCheckbox.vue new file mode 100644 index 00000000..b8a61053 --- /dev/null +++ b/web/app/src/components/SwitchCheckbox.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/web/app/src/components/workers/WorkerDetails.vue b/web/app/src/components/workers/WorkerDetails.vue index 6b9bf60f..4c8dc62f 100644 --- a/web/app/src/components/workers/WorkerDetails.vue +++ b/web/app/src/components/workers/WorkerDetails.vue @@ -35,35 +35,18 @@
-

Sleep Schedule

-
-
- - - - - +

+ + + Sleep Schedule +
+
-

+ +

Time of the day (and on which days) this worker should go to sleep.

-
-

- Adjust at which time of the day (and on which days) this worker should go to sleep. -

-
@@ -86,13 +69,18 @@ Use 24-hour format. +
+
+ + +
+
Status
- enabled - disabled + {{ workerSleepScheduleStatusLabel }}
Days of Week
@@ -123,6 +111,7 @@ import { WorkerMgtApi, WorkerSleepSchedule } from '@/manager-api'; import { apiClient } from '@/stores/api-query-count'; import { workerStatus } from "../../statusindicator"; import LinkWorkerTask from '@/components/LinkWorkerTask.vue'; +import SwitchCheckbox from '@/components/SwitchCheckbox.vue'; export default { props: [ @@ -130,6 +119,7 @@ export default { ], components: { LinkWorkerTask, + SwitchCheckbox, }, data() { return { @@ -172,6 +162,9 @@ export default { 'end_time': this.workerSleepSchedule.end_time === '' ? '24:00' : this.workerSleepSchedule.end_time, } }, + workerSleepScheduleStatusLabel() { + return this.workerSleepSchedule.is_active ? 'Enabled' : 'Disabled'; + }, }, methods: { fetchWorkerSleepSchedule() { @@ -195,7 +188,8 @@ export default { this.notifs.add(notifMessage)); }, toggleWorkerSleepSchedule() { - let verb = this.workerSleepSchedule.is_active ? 'Enabled' : 'Disabled'; + this.workerSleepSchedule.is_active = !this.workerSleepSchedule.is_active; + let verb = this.workerSleepScheduleStatusLabel; this.setWorkerSleepSchedule(`${verb} schedule for worker ${this.workerData.name}`); }, saveWorkerSleepSchedule() { @@ -214,6 +208,21 @@ export default {