From f73b682a5cc44f2b4e60a4b22622b0c59a9b4a9a Mon Sep 17 00:00:00 2001 From: Vitalii Lysak Date: Wed, 17 Aug 2022 15:27:13 +0300 Subject: SILABMC-256: add validation and upd limits layout --- src/components/_sila/Global/Chart.vue | 105 +++++++++++++--------------------- 1 file changed, 41 insertions(+), 64 deletions(-) (limited to 'src/components') diff --git a/src/components/_sila/Global/Chart.vue b/src/components/_sila/Global/Chart.vue index 01e54071..f68cb140 100644 --- a/src/components/_sila/Global/Chart.vue +++ b/src/components/_sila/Global/Chart.vue @@ -53,7 +53,6 @@ export default { minRange: null, yMax: null, minTickInterval: null, - plotBands: null, }; }, computed: { @@ -183,55 +182,25 @@ export default { plotLines() { let plotLines = [ { - color: '#E11717', + color: '#F0AC0C', dashStyle: 'solid', value: this.warning, zIndex: '1000', width: 2, - label: { - text: this.$t('chart.thresholdWarning'), - align: 'right', - style: { - fontFamily: 'Inter, sans-serif', - fontSize: '12px', - fontStyle: 'normal', - fontWeight: '400', - lineHeight: '16px', - color: '#0C1C2999', - }, - }, }, ]; switch (this.type) { case 'fans': - 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 'processors': case 'power': plotLines.push({ - color: '#1A3E5B', + color: '#E11717', dashStyle: 'solid', - value: this.shutdown, + value: this.critical, width: 2, label: { - text: this.$t('chart.thresholdWarning'), + text: this.$t('chart.thresholdFailure'), align: 'right', style: { fontFamily: 'Inter', @@ -326,6 +295,42 @@ export default { } return plotLines; }, + + plotBands() { + let plotBands = null; + + switch (this.type) { + case 'motherboard': + plotBands = [ + { + color: '#F0AC0C1A', + dashStyle: 'solid', + from: this.warning, + to: Infinity, + }, + ]; + break; + case 'memory': + case 'processors': + case 'power': + plotBands = [ + { + color: '#F0AC0C1A', + dashStyle: 'solid', + from: this.warning, + to: this.critical, + }, + { + color: '#FF41411A', + dashStyle: 'solid', + from: this.critical, + to: Infinity, + }, + ]; + break; + } + return plotBands; + }, }, async created() { @@ -344,39 +349,11 @@ export default { this.categories = this.setCategories(101, 'С°'); this.yMax = 100; this.minTickInterval = 25; - this.plotBands = [ - { - color: '#F0AC0C1A', - dashStyle: 'solid', - from: this.notNormal, - to: this.critical, - }, - { - color: '#FF41411A', - dashStyle: 'solid', - from: this.critical, - to: this.warning, - }, - ]; break; case 'processors': this.categories = this.setCategories(101, 'С°'); this.yMax = 100; this.minTickInterval = 25; - this.plotBands = [ - { - color: '#F0AC0C1A', - dashStyle: 'solid', - from: this.notNormal, - to: this.critical, - }, - { - color: '#FF41411A', - dashStyle: 'solid', - from: this.critical, - to: this.warning, - }, - ]; break; case 'motherboard': this.categories = this.setCategories(101, 'С°'); -- cgit v1.2.3