From 5fff754d48ec658673c11f8e593d3af4f94d79df Mon Sep 17 00:00:00 2001 From: Vitalii Lysak Date: Tue, 9 Aug 2022 13:56:56 +0300 Subject: fx type fields for fans, static --- src/views/_sila/Fans/Static/FansStaticPage.vue | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/views/_sila/Fans/Static/FansStaticPage.vue') diff --git a/src/views/_sila/Fans/Static/FansStaticPage.vue b/src/views/_sila/Fans/Static/FansStaticPage.vue index dba6edb1..d92fb888 100644 --- a/src/views/_sila/Fans/Static/FansStaticPage.vue +++ b/src/views/_sila/Fans/Static/FansStaticPage.vue @@ -67,6 +67,14 @@ export default { computed: { fans() { + return this.rawFans.map((fan) => { + return { + type: this.getFanTypeByName(fan.name), + ...fan, + }; + }); + }, + rawFans() { return this.$store.getters['fan/fans']; }, }, @@ -78,5 +86,19 @@ export default { this.isBusy = false; }); }, + + methods: { + getFanTypeByName(name) { + switch (true) { + case name.includes('CPU'): + case name.includes('Pwm'): + return this.$t('pageFans.types.processors'); + case name.includes('System'): + return this.$t('pageFans.types.motherboard'); + default: + return null; + } + }, + }, }; -- cgit v1.2.3