diff options
author | Maksim Zakharov <m.zakharov@IBS.RU> | 2022-08-08 17:27:36 +0300 |
---|---|---|
committer | Maksim Zakharov <m.zakharov@IBS.RU> | 2022-08-08 17:27:36 +0300 |
commit | 0332cf97422e5989f466373ace45fee9babd2fb3 (patch) | |
tree | 3a48602947fd0f79145c5ae842190529b6f9b503 /src/views/_sila/Power/Dynamic/VoltOutput.vue | |
parent | 1f71e4f7800c0db4d639b42bfc0b5efa9ecc87a2 (diff) | |
download | webui-vue-0332cf97422e5989f466373ace45fee9babd2fb3.tar.xz |
fix dymamic collapse
Diffstat (limited to 'src/views/_sila/Power/Dynamic/VoltOutput.vue')
-rw-r--r-- | src/views/_sila/Power/Dynamic/VoltOutput.vue | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/views/_sila/Power/Dynamic/VoltOutput.vue b/src/views/_sila/Power/Dynamic/VoltOutput.vue index d75a56b9..3f3eecb0 100644 --- a/src/views/_sila/Power/Dynamic/VoltOutput.vue +++ b/src/views/_sila/Power/Dynamic/VoltOutput.vue @@ -1,8 +1,8 @@ <template> <collapse id="collapse_OutputVolt" - default-open :title="$t('pagePowerSup.OutputVolt')" + @opened="onOpened" > <template #image> <img src="@/assets/images/_sila/collapsed/voltage.svg" /> @@ -165,5 +165,25 @@ export default { this.items.length ? (this.isBusy = false) : (this.isBusy = true); }, }, + methods: { + onOpened(state) { + if (state) { + this.loadData(); + } + }, + loadData() { + let payload = { metricsName: 'psu_voltage', lastHour: false }; + if (this.timeScale === 'hour') { + payload.lastHour = true; + } + + this.startLoader(); + this.$store.dispatch('powerSupply/getPsu', payload).finally(() => { + this.$root.$emit('psu-volt'); + this.isBusy = false; + this.endLoader(); + }); + }, + }, }; </script> |