From c94e39d946b187a39f21307c8cf42e1d1b3c3d8a Mon Sep 17 00:00:00 2001 From: Maksim Zakharov Date: Fri, 5 Aug 2022 16:56:18 +0300 Subject: add power supply page --- src/components/_sila/Global/Chart.vue | 75 +++++++++++++++++++++++++++++++- src/components/_sila/Global/Collapse.vue | 6 ++- 2 files changed, 79 insertions(+), 2 deletions(-) (limited to 'src/components/_sila/Global') diff --git a/src/components/_sila/Global/Chart.vue b/src/components/_sila/Global/Chart.vue index 4da58798..0b639252 100644 --- a/src/components/_sila/Global/Chart.vue +++ b/src/components/_sila/Global/Chart.vue @@ -42,6 +42,10 @@ export default { type: Number, default: null, }, + float: { + type: Boolean, + default: false, + }, }, data() { return { @@ -90,7 +94,7 @@ export default { return { ...metric, Timestamp: time, - Value: Math.round(metric.Value), + Value: this.float ? metric.Value : Math.round(metric.Value), }; }); @@ -290,6 +294,75 @@ export default { }, }); break; + case 'voltage-input': + this.categories = this.setCategories(251, 'В'); + this.yMax = 250; + this.minTickInterval = 25; + this.plotLines.push({ + color: '#1A3E5B', + dashStyle: 'solid', + value: this.shutdown, + width: 2, + label: { + text: this.$t('chart.thresholdFailure'), + align: 'right', + style: { + fontFamily: 'Inter', + fontSize: '12px', + fontStyle: 'normal', + fontWeight: '400', + lineHeight: '16px', + color: '#0C1C2999', + }, + }, + }); + break; + case 'voltage-output': + this.categories = this.setCategories(101, 'В'); + this.yMax = 100; + this.minTickInterval = 25; + this.plotLines.push({ + color: '#1A3E5B', + dashStyle: 'solid', + value: this.shutdown, + width: 2, + label: { + text: this.$t('chart.thresholdFailure'), + align: 'right', + style: { + fontFamily: 'Inter', + fontSize: '12px', + fontStyle: 'normal', + fontWeight: '400', + lineHeight: '16px', + color: '#0C1C2999', + }, + }, + }); + break; + case 'current': + this.categories = this.setCategories(11, 'A'); + this.yMax = 10; + this.minTickInterval = 2; + this.plotLines.push({ + color: '#1A3E5B', + dashStyle: 'solid', + value: this.shutdown, + width: 2, + label: { + text: this.$t('chart.thresholdFailure'), + align: 'right', + style: { + fontFamily: 'Inter', + fontSize: '12px', + fontStyle: 'normal', + fontWeight: '400', + lineHeight: '16px', + color: '#0C1C2999', + }, + }, + }); + break; } }, setCategories(count, desc) { diff --git a/src/components/_sila/Global/Collapse.vue b/src/components/_sila/Global/Collapse.vue index f004c955..da2b74c8 100644 --- a/src/components/_sila/Global/Collapse.vue +++ b/src/components/_sila/Global/Collapse.vue @@ -10,7 +10,7 @@ {{ title }} - + @@ -29,6 +29,10 @@ export default { type: String, default: null, }, + defaultOpen: { + type: Boolean, + default: false, + }, }, data() { return { -- cgit v1.2.3