From 0332cf97422e5989f466373ace45fee9babd2fb3 Mon Sep 17 00:00:00 2001
From: Maksim Zakharov <m.zakharov@IBS.RU>
Date: Mon, 8 Aug 2022 17:27:36 +0300
Subject: fix dymamic collapse

---
 src/views/_sila/Power/Dynamic/PowerTemp.vue | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

(limited to 'src/views/_sila/Power/Dynamic/PowerTemp.vue')

diff --git a/src/views/_sila/Power/Dynamic/PowerTemp.vue b/src/views/_sila/Power/Dynamic/PowerTemp.vue
index e253b28a..a58c7eaf 100644
--- a/src/views/_sila/Power/Dynamic/PowerTemp.vue
+++ b/src/views/_sila/Power/Dynamic/PowerTemp.vue
@@ -1,8 +1,8 @@
 <template>
   <collapse
     id="collapse_psuTempp"
-    default-open
     :title="$t('pagePowerSup.temperature')"
+    @opened="onOpened"
   >
     <template #image>
       <img src="@/assets/images/_sila/collapsed/temperature.svg" />
@@ -89,13 +89,14 @@ import PageSection from '@/components/Global/PageSection';
 
 import DataFormatterMixin from '@/components/_sila/Mixins/DataFormatterMixin';
 import TableFilterMixin from '@/components/_sila/Mixins/TableFilterMixin';
+import LoadingBarMixin from '@/components/_sila/Mixins/LoadingBarMixin';
 import Collapse from '@/components/_sila/Global/Collapse';
 
 import { getItems } from '@/utilities/_sila/metricProperties';
 
 export default {
   components: { PageSection, Chart, Collapse },
-  mixins: [DataFormatterMixin, TableFilterMixin],
+  mixins: [DataFormatterMixin, TableFilterMixin, LoadingBarMixin],
   props: {
     timeScale: {
       type: String,
@@ -170,15 +171,21 @@ export default {
     this.loadData();
   },
   methods: {
+    onOpened(state) {
+      if (state) {
+        this.loadData();
+      }
+    },
     loadData() {
       let payload = { metricsName: 'psu_temp', lastHour: false };
       if (this.timeScale === 'hour') {
         payload.lastHour = true;
       }
-
+      this.startLoader();
       this.$store.dispatch('powerSupply/getPsu', payload).finally(() => {
         this.$root.$emit('psu-temp');
         this.isBusy = false;
+        this.endLoader();
       });
     },
   },
-- 
cgit v1.2.3

