summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-08-17 15:27:13 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-08-17 15:27:13 +0300
commitf73b682a5cc44f2b4e60a4b22622b0c59a9b4a9a (patch)
tree48a407a81c5bbaa71682d5b19f0265105a14b423 /src/components
parent67dab376eb97139c5dba14b441c6d9cede62fb2e (diff)
downloadwebui-vue-f73b682a5cc44f2b4e60a4b22622b0c59a9b4a9a.tar.xz
SILABMC-256: add validation and upd limits layout
Diffstat (limited to 'src/components')
-rw-r--r--src/components/_sila/Global/Chart.vue105
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, 'С°');