diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/locales/en-US.json | 3 | ||||
-rw-r--r-- | src/locales/ru-RU.json | 3 | ||||
-rw-r--r-- | src/views/_sila/Fans/Dynamic/FanSpeed.vue | 48 |
3 files changed, 51 insertions, 3 deletions
diff --git a/src/locales/en-US.json b/src/locales/en-US.json index c19c756f..b4a1bae0 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -831,7 +831,8 @@ "name": "Name", "health": "Health", "type": "Type", - "currentValue": "Current Speed, rpm" + "currentValue": "Current Speed, rpm", + "pwm": "% power" } }, "pageProcessors": { diff --git a/src/locales/ru-RU.json b/src/locales/ru-RU.json index ee234f0b..079ff467 100644 --- a/src/locales/ru-RU.json +++ b/src/locales/ru-RU.json @@ -847,7 +847,8 @@ "min": "Минимальная", "minDate": "Дата минимальной", "max": "Максимальная", - "maxDate": "Дата максимальной" + "maxDate": "Дата максимальной", + "pwm": "% мощности" }, "labels": { "warning": "Значение предупреждения, об/мин", diff --git a/src/views/_sila/Fans/Dynamic/FanSpeed.vue b/src/views/_sila/Fans/Dynamic/FanSpeed.vue index a47202b8..cf556053 100644 --- a/src/views/_sila/Fans/Dynamic/FanSpeed.vue +++ b/src/views/_sila/Fans/Dynamic/FanSpeed.vue @@ -69,6 +69,11 @@ {{ value.date }} </span> </template> + <template #cell(pwm)="{ value }"> + <span> + {{ `${value}%` }} + </span> + </template> </b-table> </div> </template> @@ -108,6 +113,10 @@ export default { label: this.$t('pageFans.table.middle'), }, { + key: 'pwm', + label: this.$t('pageFans.table.pwm'), + }, + { key: 'min', label: this.$t('pageFans.table.min'), }, @@ -129,7 +138,24 @@ export default { computed: { items() { - return getItems(this.filteredSensors); + const allArr = getItems(this.filteredSensors); + + let pwmArr = allArr.filter((item) => { + return item.name.toLowerCase().includes('pwm'); + }); + + let cpuArr = allArr.filter((item) => { + return !item.name.toLowerCase().includes('pwm'); + }); + + return cpuArr.map((cpu) => { + let pwm = pwmArr.find((pwm) => pwm.name === this.getPwmByCpu(cpu.name)) + .middle; + return { + pwm, + ...cpu, + }; + }); }, allSensors() { @@ -155,6 +181,9 @@ export default { timeScale() { this.loadData(); }, + items(data) { + console.log('data!!!', data); + }, }, created() { @@ -162,6 +191,23 @@ export default { }, methods: { + getPwmByCpu(cpu) { + switch (cpu) { + case 'System_Fan_1': + return 'Pwm_1'; + case 'System_Fan_2': + return 'Pwm_5'; + case 'System_Fan_3': + return 'Pwm_6'; + case 'CPU1_Fan': + return 'Pwm_7'; + case 'CPU2_Fan': + return 'Pwm_8'; + default: + return null; + } + }, + onOpened(state) { if (state) { this.loadData(); |