Skip to content

Commit

Permalink
Merge pull request #2004 from slntopp/dev-fixes
Browse files Browse the repository at this point in the history
fix disable all switch
  • Loading branch information
SazukinPavel authored Feb 12, 2025
2 parents 23c7f1d + 31226bf commit e53efaa
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions admin-ui/src/components/ServicesProvider/suspend-rules.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,16 @@ function isTime(value) {
const setTemplateRules = () => {
template.value.suspendRules.schedules.map((shedule) => {
suspendRules.value[shedule.day] = shedule.allowedSuspendTime.map(
(range) => ({
startTime: range.startTime,
endTime: range.endTime,
})
);
if (shedule.enabled) {
suspendRules.value[shedule.day] = null;
} else {
suspendRules.value[shedule.day] = shedule.allowedSuspendTime.map(
(range) => ({
startTime: range.startTime,
endTime: range.endTime,
})
);
}
});
suspendRules.value = { ...suspendRules.value };
Expand Down Expand Up @@ -164,6 +168,7 @@ const save = async () => {
newSuspendRules.schedules.push({
day,
allowedSuspendTime: suspendRules.value[day],
enabled: suspendRules.value[day] !== null,
});
});
Expand Down

0 comments on commit e53efaa

Please sign in to comment.