From abfcb75c06375d3159a718334bca563feafcc466 Mon Sep 17 00:00:00 2001 From: Vitalii Lysak Date: Wed, 17 Aug 2022 09:37:28 +0300 Subject: SILABMC-256: add fields for processors --- src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue | 4 +- src/views/_sila/Processors/Dynamic/CpuTemp.vue | 84 +++++++++++++++++++------- 2 files changed, 63 insertions(+), 25 deletions(-) (limited to 'src/views/_sila') diff --git a/src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue b/src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue index 7a3a392d..018e19a1 100644 --- a/src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue +++ b/src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue @@ -8,7 +8,7 @@ - + - + { + return ( + limit?.UpperThresholdNonCritical && + this.groups.includes(limit.MemberId) + ); + })?.UpperThresholdNonCritical; + }, + + criticalLimit() { + return this.limits.find((limit) => { + return ( + limit?.UpperThresholdCritical && this.groups.includes(limit.MemberId) + ); + })?.UpperThresholdCritical; + }, + allSensors() { return this.timeScale === 'hour' ? this.$store.getters['processors/cpuTempLastHour'] @@ -176,6 +200,16 @@ export default { this.loadData(); }, methods: { + saveLimit() { + this.startLoader(); + this.$store + .dispatch('processors/patchLimitsTemp', { + warning: this.warning, + groups: this.groups, + }) + .catch(({ message }) => this.errorToast(message)) + .finally(() => this.endLoader()); + }, onOpened(state) { if (state) { this.loadData(); @@ -192,8 +226,12 @@ export default { this.$store .dispatch('processors/getCpuTempDynamic', payload) .finally(() => { - this.endLoader(); - this.isBusy = false; + this.$store.dispatch('processors/getLimitsTemp').finally(() => { + this.warning = this.warningLimit; + this.critical = this.criticalLimit; + this.endLoader(); + this.isBusy = false; + }); }); }, }, -- cgit v1.2.3