summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-07-19 20:58:19 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-07-19 20:58:19 +0300
commit5ff6d2f4a485f3ac09f41127a4f12b07e0eb936a (patch)
treedbf655ac2e7d2d958511ee5d6d085bc5b829aec2
parentd9da196da5a44ced13d48c9f702fae6c8d6b6e5b (diff)
parent61657800f556ebbb1e6041d5d85a99368b73ff3b (diff)
downloadwebui-vue-5ff6d2f4a485f3ac09f41127a4f12b07e0eb936a.tar.xz
Merge branch 'sila-ui' into dynamic-info-ui
-rw-r--r--src/env/components/AppNavigation/sila.js11
-rw-r--r--src/env/router/sila.js9
-rw-r--r--src/locales/en-US.json17
-rw-r--r--src/locales/ru-RU.json17
-rw-r--r--src/store/index.js2
-rw-r--r--src/store/modules/_sila/HardwareStatus/FanStore.js53
-rw-r--r--src/utilities/_sila/tableParser.js12
-rw-r--r--src/views/_sila/Fans/Static/FansStaticPage.vue81
-rw-r--r--src/views/_sila/Fans/Static/index.js2
9 files changed, 199 insertions, 5 deletions
diff --git a/src/env/components/AppNavigation/sila.js b/src/env/components/AppNavigation/sila.js
index 9939ef8c..f6a1900d 100644
--- a/src/env/components/AppNavigation/sila.js
+++ b/src/env/components/AppNavigation/sila.js
@@ -78,6 +78,17 @@ const AppNavigationMixin = {
],
},
{
+ id: 'fans',
+ label: this.$t('appNavigation.fans'),
+ children: [
+ {
+ id: 'fans/static',
+ label: this.$t('appNavigation.staticInfo'),
+ route: '/fans/static',
+ },
+ ],
+ },
+ {
id: 'operations',
label: this.$t('appNavigation.operations'),
icon: 'iconControl',
diff --git a/src/env/router/sila.js b/src/env/router/sila.js
index a622a436..8a489585 100644
--- a/src/env/router/sila.js
+++ b/src/env/router/sila.js
@@ -29,6 +29,7 @@ import KeyClear from '@/views/_sila/Operations/KeyClear';
import Certificates from '@/views/_sila/SecurityAndAccess/Certificates';
import VirtualMedia from '@/views/_sila/Operations/VirtualMedia';
import Power from '@/views/_sila/ResourceManagement/Power';
+import FansStatic from '@/views/_sila/Fans/Static';
import i18n from '@/i18n';
const routes = [
@@ -152,6 +153,14 @@ const routes = [
},
},
{
+ path: 'fans/static',
+ name: 'fans-static',
+ component: FansStatic,
+ meta: {
+ title: i18n.t('appPageTitle.fans'),
+ },
+ },
+ {
path: '/security-and-access/sessions',
name: 'sessions',
component: Sessions,
diff --git a/src/locales/en-US.json b/src/locales/en-US.json
index d7a26493..5823bed4 100644
--- a/src/locales/en-US.json
+++ b/src/locales/en-US.json
@@ -129,7 +129,9 @@
"certificates": "@:appPageTitle.certificates",
"virtualMedia": "@:appPageTitle.virtualMedia",
"power": "@:appPageTitle.power",
- "keyClear": "@:appPageTitle.keyClear"
+ "keyClear": "@:appPageTitle.keyClear",
+ "staticInfo": "Static Information",
+ "fans": "@:appPageTitle.fans"
},
"appPageTitle": {
"changePassword": "Change password",
@@ -139,6 +141,7 @@
"dumps": "Dumps",
"eventLogs": "Event logs",
"factoryReset": "Factory reset",
+ "fans": "Fans",
"firmware": "Firmware",
"inventory": "Inventory and LEDs",
"kvm": "KVM",
@@ -158,7 +161,8 @@
"serverPowerOperations": "Server power operations",
"certificates": "Certificates",
"virtualMedia": "Virtual media",
- "keyClear": "Key clear"
+ "keyClear": "Key clear",
+ "specification": "Specification"
},
"pageChangePassword": {
"changePassword": "Change password",
@@ -812,6 +816,15 @@
"upperCritical": "Upper critical"
}
},
+ "pageFans": {
+ "installedFans": "Installed Fans",
+ "table": {
+ "name": "Name",
+ "health": "Health",
+ "type": "Type",
+ "currentValue": "Current Speed, rpm"
+ }
+ },
"pageSerialOverLan": {
"alert": {
"disconnectedAlertMessage" : "System must be powered on to connect"
diff --git a/src/locales/ru-RU.json b/src/locales/ru-RU.json
index d7427dda..ccc54844 100644
--- a/src/locales/ru-RU.json
+++ b/src/locales/ru-RU.json
@@ -133,7 +133,9 @@
"certificates": "@:appPageTitle.certificates",
"virtualMedia": "@:appPageTitle.virtualMedia",
"power": "@:appPageTitle.power",
- "keyClear": "@:appPageTitle.keyClear"
+ "keyClear": "@:appPageTitle.keyClear",
+ "staticInfo": "Статическая информация",
+ "fans": "@:appPageTitle.fans"
},
"appPageTitle": {
"changePassword": "Изменить пароль",
@@ -143,6 +145,7 @@
"dumps": "Дампы",
"eventLogs": "Журнал событий",
"factoryReset": "Сброс до заводских настроек",
+ "fans": "Вентиляторы",
"firmware": "Встроенное ПО",
"inventory": "Перечень оборудования и LED",
"kvm": "KVM",
@@ -163,7 +166,8 @@
"serverPowerOperations": "Управление питанием сервера",
"certificates": "Сертификаты",
"virtualMedia": "Виртуальные носители",
- "keyClear": "Удаление ключей"
+ "keyClear": "Удаление ключей",
+ "specification": "Характеристики"
},
"pageChangePassword": {
"changePassword": "Изменить пароль",
@@ -818,6 +822,15 @@
"upperCritical": "Макс. крит. значение"
}
},
+ "pageFans": {
+ "installedFans": "Установленные вентиляторы",
+ "table": {
+ "name": "Имя",
+ "health": "Состояние",
+ "type": "Тип устройства",
+ "currentValue": "Текущая скорость, об/мин"
+ }
+ },
"pageSerialOverLan": {
"alert": {
"disconnectedAlertMessage" : "Система должна быть включена для соединения"
diff --git a/src/store/index.js b/src/store/index.js
index ba248c58..41eba75f 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -19,7 +19,7 @@ import ServerLedStore from './modules/HardwareStatus/ServerLedStore';
import SystemStore from './modules/HardwareStatus/SystemStore';
import PowerSupplyStore from './modules/HardwareStatus/PowerSupplyStore';
import MemoryStore from './modules/HardwareStatus/MemoryStore';
-import FanStore from './modules/HardwareStatus/FanStore';
+import FanStore from './modules/_sila//HardwareStatus/FanStore';
import ChassisStore from './modules/HardwareStatus/ChassisStore';
import BmcStore from './modules/HardwareStatus/BmcStore';
import ProcessorStore from './modules/HardwareStatus/ProcessorStore';
diff --git a/src/store/modules/_sila/HardwareStatus/FanStore.js b/src/store/modules/_sila/HardwareStatus/FanStore.js
new file mode 100644
index 00000000..1399710b
--- /dev/null
+++ b/src/store/modules/_sila/HardwareStatus/FanStore.js
@@ -0,0 +1,53 @@
+import api from '@/store/api';
+import { fanType } from '@/utilities/_sila/tableParser';
+
+const FanStore = {
+ namespaced: true,
+ state: {
+ fans: [],
+ },
+ getters: {
+ fans: (state) => state.fans,
+ },
+ mutations: {
+ setFanInfo: (state, data) => {
+ state.fans = data.map((fan) => {
+ const {
+ IndicatorLED,
+ Location,
+ MemberId,
+ Name,
+ Reading,
+ ReadingUnits,
+ Status = {},
+ PartNumber,
+ SerialNumber,
+ } = fan;
+ return {
+ id: MemberId,
+ health: Status.Health,
+ partNumber: PartNumber,
+ serialNumber: SerialNumber,
+ healthRollup: Status.HealthRollup,
+ identifyLed: IndicatorLED,
+ locationNumber: Location,
+ name: Name,
+ speed: Reading + ' ' + ReadingUnits,
+ speedRPM: Reading,
+ type: fanType(Name),
+ statusState: Status.State,
+ };
+ });
+ },
+ },
+ actions: {
+ async getFanInfo({ commit }) {
+ return await api
+ .get('/redfish/v1/Chassis/chassis/Thermal')
+ .then(({ data: { Fans = [] } }) => commit('setFanInfo', Fans))
+ .catch((error) => console.log(error));
+ },
+ },
+};
+
+export default FanStore;
diff --git a/src/utilities/_sila/tableParser.js b/src/utilities/_sila/tableParser.js
new file mode 100644
index 00000000..9c85bfe5
--- /dev/null
+++ b/src/utilities/_sila/tableParser.js
@@ -0,0 +1,12 @@
+export function fanType(name) {
+ switch (true) {
+ case name.includes('CPU'):
+ return 'Процессоры';
+ case name.includes('System'):
+ return 'Системная плата';
+ case name.includes('Pwm'):
+ return 'Процессоры';
+ default:
+ return 'Неизвестное расположение';
+ }
+}
diff --git a/src/views/_sila/Fans/Static/FansStaticPage.vue b/src/views/_sila/Fans/Static/FansStaticPage.vue
new file mode 100644
index 00000000..810aeb4b
--- /dev/null
+++ b/src/views/_sila/Fans/Static/FansStaticPage.vue
@@ -0,0 +1,81 @@
+<template>
+ <b-container fluid="xl">
+ <page-title :description="$t('appPageTitle.specification')" />
+ <page-section :section-small-title="$t('pageFans.installedFans')">
+ <b-table
+ responsive="md"
+ show-empty
+ :items="fans"
+ :busy="isBusy"
+ :fields="fields"
+ :empty-text="$t('global.table.emptyMessage')"
+ >
+ <template #cell(status)="{ value }">
+ <status-icon :status="statusIcon(value)" />
+ {{ value }}
+ </template>
+ </b-table>
+ </page-section>
+ </b-container>
+</template>
+
+<script>
+import PageTitle from '@/components/_sila/Global/PageTitle';
+import PageSection from '@/components/_sila/Global/PageSection';
+
+import DataFormatterMixin from '@/components/_sila/Mixins/DataFormatterMixin';
+import LoadingBarMixin from '@/components/_sila/Mixins/LoadingBarMixin';
+
+import StatusIcon from '@/components/_sila//Global/StatusIcon';
+
+export default {
+ components: { PageTitle, PageSection, StatusIcon },
+ mixins: [DataFormatterMixin, LoadingBarMixin],
+ data() {
+ return {
+ isBusy: true,
+ fields: [
+ {
+ key: 'name',
+ label: this.$t('pageFans.table.name'),
+ formatter: this.dataFormatter,
+ thStyle: { width: '25%' },
+ },
+ {
+ key: 'health',
+ label: this.$t('pageFans.table.health'),
+ formatter: this.dataFormatter,
+ thStyle: { width: '25%' },
+ tdClass: 'text-nowrap',
+ },
+ {
+ key: 'type',
+ label: this.$t('pageFans.table.type'),
+ formatter: this.dataFormatter,
+ thStyle: { width: '25%' },
+ },
+ {
+ key: 'speedRPM',
+ label: this.$t('pageFans.table.currentValue'),
+ formatter: this.dataFormatter,
+ thStyle: { width: '25%' },
+ },
+ ],
+ };
+ },
+
+ computed: {
+ fans() {
+ return this.$store.getters['fan/fans'];
+ },
+ },
+
+ created() {
+ this.startLoader();
+ this.$store.dispatch('fan/getFanInfo').finally(() => {
+ this.endLoader();
+ this.isBusy = false;
+ });
+ },
+};
+</script>
diff --git a/src/views/_sila/Fans/Static/index.js b/src/views/_sila/Fans/Static/index.js
new file mode 100644
index 00000000..9a5d913d
--- /dev/null
+++ b/src/views/_sila/Fans/Static/index.js
@@ -0,0 +1,2 @@
+import FansStaticPage from './FansStaticPage.vue';
+export default FansStaticPage;