From 143223d899c3c1373c76b851ad6933424277e9bb Mon Sep 17 00:00:00 2001 From: Vitalii Lysak Date: Tue, 16 Aug 2022 18:43:55 +0300 Subject: SILABMC-256: add fields for memory --- src/views/_sila/Memory/Dynamic/MemoryTemp.vue | 82 ++++++++++++++++++--------- 1 file changed, 54 insertions(+), 28 deletions(-) (limited to 'src/views') diff --git a/src/views/_sila/Memory/Dynamic/MemoryTemp.vue b/src/views/_sila/Memory/Dynamic/MemoryTemp.vue index 3505f827..f69e797a 100644 --- a/src/views/_sila/Memory/Dynamic/MemoryTemp.vue +++ b/src/views/_sila/Memory/Dynamic/MemoryTemp.vue @@ -4,11 +4,11 @@ {{ $t('pageMemory.temperature') }} - + { + 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['memory/dimmsLastHour'] @@ -180,6 +192,16 @@ export default { }, methods: { + saveLimit() { + this.startLoader(); + this.$store + .dispatch('memory/patchLimits', { + warning: this.warning, + groups: this.groups, + }) + .catch(({ message }) => this.errorToast(message)) + .finally(() => this.endLoader()); + }, loadData() { let payload = { lastHour: false }; if (this.timeScale === 'hour') { @@ -188,8 +210,12 @@ export default { this.startLoader(); this.$store.dispatch('memory/getMemoryDynamic', payload).finally(() => { - this.endLoader(); - this.isBusy = false; + this.$store.dispatch('memory/getLimits').finally(() => { + this.warning = this.warningLimit; + this.critical = this.criticalLimit; + this.endLoader(); + this.isBusy = false; + }); }); }, }, -- cgit v1.2.3