summaryrefslogtreecommitdiff
path: root/src/components/_sila/Global/Chart.vue
diff options
context:
space:
mode:
authorMaksim Zakharov <m.zakharov@IBS.RU>2022-08-05 16:56:18 +0300
committerMaksim Zakharov <m.zakharov@IBS.RU>2022-08-05 16:56:18 +0300
commitc94e39d946b187a39f21307c8cf42e1d1b3c3d8a (patch)
tree2179868da40b098041c0d26be07441914c0ce312 /src/components/_sila/Global/Chart.vue
parentc0f0a956a1def725feb1b821e5507183b435262b (diff)
downloadwebui-vue-c94e39d946b187a39f21307c8cf42e1d1b3c3d8a.tar.xz
add power supply page
Diffstat (limited to 'src/components/_sila/Global/Chart.vue')
-rw-r--r--src/components/_sila/Global/Chart.vue75
1 files changed, 74 insertions, 1 deletions
diff --git a/src/components/_sila/Global/Chart.vue b/src/components/_sila/Global/Chart.vue
index 4da58798..0b639252 100644
--- a/src/components/_sila/Global/Chart.vue
+++ b/src/components/_sila/Global/Chart.vue
@@ -42,6 +42,10 @@ export default {
type: Number,
default: null,
},
+ float: {
+ type: Boolean,
+ default: false,
+ },
},
data() {
return {
@@ -90,7 +94,7 @@ export default {
return {
...metric,
Timestamp: time,
- Value: Math.round(metric.Value),
+ Value: this.float ? metric.Value : Math.round(metric.Value),
};
});
@@ -290,6 +294,75 @@ export default {
},
});
break;
+ case 'voltage-input':
+ this.categories = this.setCategories(251, 'В');
+ this.yMax = 250;
+ this.minTickInterval = 25;
+ this.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':
+ this.categories = this.setCategories(101, 'В');
+ this.yMax = 100;
+ this.minTickInterval = 25;
+ this.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':
+ this.categories = this.setCategories(11, 'A');
+ this.yMax = 10;
+ this.minTickInterval = 2;
+ this.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;
}
},
setCategories(count, desc) {