summaryrefslogtreecommitdiff
path: root/src/components/_sila/Global
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-08-16 18:42:20 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-08-16 18:42:20 +0300
commitfe9b637630e8a58a68721d8ade914eff81936a5f (patch)
tree0c174bb87135ab8fb6a7a61f6f62ad2a4f4f5471 /src/components/_sila/Global
parentc4484916034f8ba3ec05fc64096abf2514b27fb9 (diff)
downloadwebui-vue-fe9b637630e8a58a68721d8ade914eff81936a5f.tar.xz
SILABMC-256: add fields for motherboard
Diffstat (limited to 'src/components/_sila/Global')
-rw-r--r--src/components/_sila/Global/Chart.vue206
1 files changed, 112 insertions, 94 deletions
diff --git a/src/components/_sila/Global/Chart.vue b/src/components/_sila/Global/Chart.vue
index ac8fc325..01e54071 100644
--- a/src/components/_sila/Global/Chart.vue
+++ b/src/components/_sila/Global/Chart.vue
@@ -54,27 +54,6 @@ export default {
yMax: null,
minTickInterval: null,
plotBands: null,
- plotLines: [
- {
- color: '#E11717',
- 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',
- },
- },
- },
- ],
};
},
computed: {
@@ -200,20 +179,33 @@ export default {
},
};
},
- },
- async created() {
- this.setOptions();
- },
+ plotLines() {
+ let plotLines = [
+ {
+ color: '#E11717',
+ 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',
+ },
+ },
+ },
+ ];
- methods: {
- setOptions() {
switch (this.type) {
case 'fans':
- this.categories = this.setSpeed(10000);
- this.minRange = 10000;
- this.minTickInterval = 1000;
- this.plotLines.push({
+ plotLines.push({
color: '#1A3E5B',
dashStyle: 'solid',
value: this.shutdown,
@@ -232,54 +224,8 @@ export default {
},
});
break;
- case 'memory':
- 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, 'С°');
- this.yMax = 100;
- this.minTickInterval = 25;
- break;
case 'power':
- this.categories = this.setCategories(101, 'Вт');
- this.yMax = 100;
- this.minTickInterval = 25;
- this.plotLines.push({
+ plotLines.push({
color: '#1A3E5B',
dashStyle: 'solid',
value: this.shutdown,
@@ -299,10 +245,7 @@ export default {
});
break;
case 'voltage-input':
- this.categories = this.setCategories(251, 'В');
- this.yMax = 250;
- this.minTickInterval = 25;
- this.plotLines.push({
+ plotLines.push({
color: '#1A3E5B',
dashStyle: 'solid',
value: this.shutdown,
@@ -322,10 +265,7 @@ export default {
});
break;
case 'voltage-output':
- this.categories = this.setCategories(101, 'В');
- this.yMax = 100;
- this.minTickInterval = 25;
- this.plotLines.push({
+ plotLines.push({
color: '#1A3E5B',
dashStyle: 'solid',
value: this.shutdown,
@@ -345,10 +285,7 @@ export default {
});
break;
case 'current':
- this.categories = this.setCategories(11, 'A');
- this.yMax = 10;
- this.minTickInterval = 2;
- this.plotLines.push({
+ plotLines.push({
color: '#1A3E5B',
dashStyle: 'solid',
value: this.shutdown,
@@ -368,10 +305,7 @@ export default {
});
break;
case 'psu-power':
- this.categories = this.setCategories(126, 'Вт');
- this.yMax = 125;
- this.minTickInterval = 25;
- this.plotLines.push({
+ plotLines.push({
color: '#1A3E5B',
dashStyle: 'solid',
value: this.shutdown,
@@ -390,6 +324,90 @@ export default {
},
});
}
+ return plotLines;
+ },
+ },
+
+ async created() {
+ this.setOptions();
+ },
+
+ methods: {
+ setOptions() {
+ switch (this.type) {
+ case 'fans':
+ this.categories = this.setSpeed(10000);
+ this.minRange = 10000;
+ this.minTickInterval = 1000;
+ break;
+ case 'memory':
+ 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, 'С°');
+ this.yMax = 100;
+ this.minTickInterval = 25;
+ break;
+ case 'power':
+ this.categories = this.setCategories(101, 'Вт');
+ this.yMax = 100;
+ this.minTickInterval = 25;
+ break;
+ case 'voltage-input':
+ this.categories = this.setCategories(251, 'В');
+ this.yMax = 250;
+ this.minTickInterval = 25;
+ break;
+ case 'voltage-output':
+ this.categories = this.setCategories(101, 'В');
+ this.yMax = 100;
+ this.minTickInterval = 25;
+ break;
+ case 'current':
+ this.categories = this.setCategories(11, 'A');
+ this.yMax = 10;
+ this.minTickInterval = 2;
+ break;
+ case 'psu-power':
+ this.categories = this.setCategories(126, 'Вт');
+ this.yMax = 125;
+ this.minTickInterval = 25;
+ }
},
setCategories(count, desc) {
const arr = [...new Array(count)].map((i, k) => `${k} ${desc}`);