From 9145a3dfb6608188269a480f7c45a483166d332d Mon Sep 17 00:00:00 2001 From: Vitalii Lysak Date: Tue, 16 Aug 2022 18:43:29 +0300 Subject: SILABMC-256: add fields for fans --- src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue | 65 ++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 13 deletions(-) (limited to 'src/views/_sila/Fans') diff --git a/src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue b/src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue index 10f6c9c5..7a3a392d 100644 --- a/src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue +++ b/src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue @@ -8,11 +8,11 @@ - + { + return ( + limit?.UpperThresholdNonCritical && + this.groups.includes(limit.MemberId) + ); + })?.UpperThresholdNonCritical; + }, + + shutdownLimit() { + return this.limits.find((limit) => { + return ( + limit?.UpperThresholdCritical && this.groups.includes(limit.MemberId) + ); + })?.UpperThresholdCritical; + }, + allSensors() { return this.timeScale === 'hour' ? this.$store.getters['fan/fansLastHour'] @@ -212,6 +237,16 @@ export default { }, methods: { + saveLimit() { + this.startLoader(); + this.$store + .dispatch('fan/patchLimits', { + warning: this.warning, + groups: this.groups, + }) + .catch(({ message }) => this.errorToast(message)) + .finally(() => this.endLoader()); + }, getPwmByCpu(cpu) { switch (cpu) { case 'CPU1_Fan': @@ -237,8 +272,12 @@ export default { this.startLoader(); this.$store.dispatch('fan/getFansDynamic', payload).finally(() => { - this.endLoader(); - this.isBusy = false; + this.$store.dispatch('fan/getLimits').finally(() => { + this.warning = this.warningLimit; + this.shutdown = this.shutdownLimit; + this.endLoader(); + this.isBusy = false; + }); }); }, }, -- cgit v1.2.3