summaryrefslogtreecommitdiff
path: root/src/views/_sila/Power/Dynamic/CurrentInput.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/_sila/Power/Dynamic/CurrentInput.vue')
-rw-r--r--src/views/_sila/Power/Dynamic/CurrentInput.vue13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/views/_sila/Power/Dynamic/CurrentInput.vue b/src/views/_sila/Power/Dynamic/CurrentInput.vue
index dace6a82..34e2c166 100644
--- a/src/views/_sila/Power/Dynamic/CurrentInput.vue
+++ b/src/views/_sila/Power/Dynamic/CurrentInput.vue
@@ -108,6 +108,7 @@ export default {
warning: Infinity,
shutdown: Infinity,
isBusy: true,
+ opened: false,
fields: [
{
key: 'name',
@@ -162,26 +163,30 @@ export default {
},
watch: {
timeScale() {
+ if (!this.opened) {
+ return;
+ }
+
this.loadData();
},
},
- created() {
- this.loadData();
- },
methods: {
onOpened(state) {
if (state) {
this.loadData();
}
+ this.opened = state;
},
loadData() {
let payload = { metricsName: 'psu_current', lastHour: false };
if (this.timeScale === 'hour') {
payload.lastHour = true;
}
+
+ this.$root.$emit('psu-current-input', true);
this.startLoader();
this.$store.dispatch('powerSupply/getPsu', payload).finally(() => {
- this.$root.$emit('psu-current');
+ this.$root.$emit('psu-current-output', false);
this.isBusy = false;
this.endLoader();
});