summaryrefslogtreecommitdiff
path: root/src/components/_sila
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
parentc0f0a956a1def725feb1b821e5507183b435262b (diff)
downloadwebui-vue-c94e39d946b187a39f21307c8cf42e1d1b3c3d8a.tar.xz
add power supply page
Diffstat (limited to 'src/components/_sila')
-rw-r--r--src/components/_sila/Global/Chart.vue75
-rw-r--r--src/components/_sila/Global/Collapse.vue6
2 files changed, 79 insertions, 2 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) {
diff --git a/src/components/_sila/Global/Collapse.vue b/src/components/_sila/Global/Collapse.vue
index f004c955..da2b74c8 100644
--- a/src/components/_sila/Global/Collapse.vue
+++ b/src/components/_sila/Global/Collapse.vue
@@ -10,7 +10,7 @@
{{ title }}
<component :is="iconChevronUp" class="icon-expand" />
</b-button>
- <b-collapse :id="id">
+ <b-collapse :id="id" :visible="defaultOpen">
<slot></slot>
</b-collapse>
</div>
@@ -29,6 +29,10 @@ export default {
type: String,
default: null,
},
+ defaultOpen: {
+ type: Boolean,
+ default: false,
+ },
},
data() {
return {