summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
authorMaksim Zakharov <m.zakharov@IBS.RU>2022-07-19 18:39:57 +0300
committerMaksim Zakharov <m.zakharov@IBS.RU>2022-07-19 18:44:00 +0300
commit61657800f556ebbb1e6041d5d85a99368b73ff3b (patch)
tree618aec32ac4c3b3c0485d195bd87c83633047f06 /src/store
parentf8fcf3957a749b349a33bae2691bca2883a981c3 (diff)
downloadwebui-vue-61657800f556ebbb1e6041d5d85a99368b73ff3b.tar.xz
SILABMC-52 Add page Fans Static, Fans Store, tab Fans
Diffstat (limited to 'src/store')
-rw-r--r--src/store/index.js2
-rw-r--r--src/store/modules/_sila/HardwareStatus/FanStore.js53
2 files changed, 54 insertions, 1 deletions
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;