diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-08-16 13:16:28 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-08-16 13:16:28 +0300 |
commit | 7d5e7b6f494c16640790734c39ffb2f1ed511358 (patch) | |
tree | c7bf34cb586a5a1313c3f15673d34996796c167c /src/views/_sila/Motherboard/Dynamic | |
parent | 3e22d1b10a4bd2b9e998aaaf25b388377b3953da (diff) | |
download | webui-vue-7d5e7b6f494c16640790734c39ffb2f1ed511358.tar.xz |
SILABMC-256: patch/get for limits
Diffstat (limited to 'src/views/_sila/Motherboard/Dynamic')
-rw-r--r-- | src/views/_sila/Motherboard/Dynamic/MotherboardTemp.vue | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/src/views/_sila/Motherboard/Dynamic/MotherboardTemp.vue b/src/views/_sila/Motherboard/Dynamic/MotherboardTemp.vue index 9f8d41cb..fde051e1 100644 --- a/src/views/_sila/Motherboard/Dynamic/MotherboardTemp.vue +++ b/src/views/_sila/Motherboard/Dynamic/MotherboardTemp.vue @@ -72,7 +72,7 @@ import DataFormatterMixin from '@/components/_sila/Mixins/DataFormatterMixin'; import LoadingBarMixin from '@/components/_sila/Mixins/LoadingBarMixin'; import TableFilterMixin from '@/components/_sila/Mixins/TableFilterMixin'; -import { getItems } from '@/utilities/_sila/metricProperties'; +import { getItems, getGroups } from '@/utilities/_sila/metricProperties'; export default { components: { Chart }, @@ -121,10 +121,27 @@ export default { }, computed: { + groups() { + return getGroups(this.filteredSensors); + }, + items() { return getItems(this.filteredSensors); }, + limits() { + return this.$store.getters['motherboard/limits']; + }, + + limit() { + return this.limits.find((limit) => { + return ( + limit?.UpperThresholdNonCritical && + this.groups.includes(limit.MemberId) + ); + })?.UpperThresholdNonCritical; + }, + allSensors() { return this.timeScale === 'hour' ? this.$store.getters['motherboard/motherboardLastHour'] @@ -152,9 +169,16 @@ export default { created() { this.loadData(); + // this.saveLimits(); }, methods: { + saveLimits() { + this.startLoader(); + this.$store + .dispatch('motherboard/patchLimits') + .finally(() => this.endLoader()); + }, loadData() { let payload = { lastHour: false }; if (this.timeScale === 'hour') { @@ -165,8 +189,10 @@ export default { this.$store .dispatch('motherboard/getMotherboardDynamic', payload) .finally(() => { - this.endLoader(); - this.isBusy = false; + this.$store.dispatch('motherboard/getLimits').finally(() => { + this.endLoader(); + this.isBusy = false; + }); }); }, }, |