diff options
Diffstat (limited to 'src/components/_sila/Global')
-rw-r--r-- | src/components/_sila/Global/Chart.vue | 105 |
1 files changed, 41 insertions, 64 deletions
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, 'С°'); |