From 0847eaf4cc4b050fc6f297940013a3e7e4c1cb81 Mon Sep 17 00:00:00 2001 From: Vitalii Lysak Date: Thu, 25 Aug 2022 12:16:17 +0300 Subject: SILABMC-256: add limits for Voltage --- src/components/_sila/Global/Chart.vue | 117 ++++------------------------------ 1 file changed, 14 insertions(+), 103 deletions(-) (limited to 'src/components') diff --git a/src/components/_sila/Global/Chart.vue b/src/components/_sila/Global/Chart.vue index 6a3775bb..5fd2dd31 100644 --- a/src/components/_sila/Global/Chart.vue +++ b/src/components/_sila/Global/Chart.vue @@ -31,10 +31,6 @@ export default { type: Number, default: null, }, - shutdown: { - type: Number, - default: null, - }, critical: { type: Number, default: null, @@ -196,70 +192,14 @@ export default { case 'processors': case 'power': case 'memory': - plotLines.push({ - color: '#E11717', - dashStyle: 'solid', - value: this.critical, - 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-input': - 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': - 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': + case 'psu-power': plotLines.push({ - color: '#1A3E5B', + color: '#E11717', dashStyle: 'solid', - value: this.shutdown, + value: this.critical, width: 2, label: { text: this.$t('chart.thresholdFailure'), @@ -275,25 +215,6 @@ export default { }, }); break; - case 'psu-power': - plotLines.push({ - color: '#1A3E5B', - dashStyle: 'solid', - value: this.shutdown, - width: 2, - label: { - text: this.$t('chart.thresholdWarning'), - align: 'right', - style: { - fontFamily: 'Inter', - fontSize: '12px', - fontStyle: 'normal', - fontWeight: '400', - lineHeight: '16px', - color: '#0C1C2999', - }, - }, - }); } return plotLines; }, @@ -316,6 +237,10 @@ export default { case 'processors': case 'power': case 'fans': + case 'voltage-input': + case 'voltage-output': + case 'current': + case 'psu-power': plotBands = [ { color: '#F0AC0C1A', @@ -343,22 +268,14 @@ export default { case 'memory': case 'processors': case 'fans': - yMax = this.max; - break; - case 'power': - yMax = 100; - break; case 'voltage-input': - yMax = 250; - break; case 'voltage-output': - yMax = 100; - break; case 'current': - yMax = 10; - break; case 'psu-power': - yMax = 125; + yMax = this.max; + break; + case 'power': + yMax = 100; break; } return yMax; @@ -369,25 +286,19 @@ export default { switch (this.type) { case 'motherboard': + case 'memory': + case 'processors': categories = this.setCategories(this.setMaxWithInterval(), 'С°'); break; case 'fans': categories = this.setSpeed(this.setMaxWithInterval()); break; - case 'memory': - categories = this.setCategories(this.setMaxWithInterval(), 'С°'); - break; - case 'processors': - categories = this.setCategories(this.setMaxWithInterval(), 'С°'); - break; case 'power': categories = this.setCategories(101, 'Вт'); break; case 'voltage-input': - categories = this.setCategories(251, 'В'); - break; case 'voltage-output': - categories = this.setCategories(101, 'В'); + categories = this.setCategories(this.setMaxWithInterval(), 'В'); break; case 'current': categories = this.setCategories(11, 'A'); -- cgit v1.2.3