summaryrefslogtreecommitdiff
path: root/src/store/modules/HardwareStatus
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/modules/HardwareStatus')
-rw-r--r--src/store/modules/HardwareStatus/FanStore.js31
-rw-r--r--src/store/modules/HardwareStatus/MotherboardStore.js45
2 files changed, 76 insertions, 0 deletions
diff --git a/src/store/modules/HardwareStatus/FanStore.js b/src/store/modules/HardwareStatus/FanStore.js
index fca1f326..fed3f742 100644
--- a/src/store/modules/HardwareStatus/FanStore.js
+++ b/src/store/modules/HardwareStatus/FanStore.js
@@ -1,12 +1,15 @@
import api from '@/store/api';
+import { fanType } from '@/utilities/_sila/tableParser';
const FanStore = {
namespaced: true,
state: {
fans: [],
+ fansLastHour: [],
},
getters: {
fans: (state) => state.fans,
+ fansLastHour: (state) => state.fansLastHour,
},
mutations: {
setFanInfo: (state, data) => {
@@ -32,12 +35,40 @@ const FanStore = {
locationNumber: Location,
name: Name,
speed: Reading + ' ' + ReadingUnits,
+ speedRPM: Reading,
+ type: fanType(Name),
statusState: Status.State,
};
});
},
+
+ setFansDynamic: (state, data) => {
+ state.fans = data;
+ },
+ setFansDynamicLastHour: (state, data) => {
+ state.fansLastHour = data;
+ },
},
actions: {
+ async getFansDynamic({ commit }, { lastHour }) {
+ let url = null;
+ if (lastHour) {
+ url =
+ '/redfish/v1/TelemetryService/MetricReports/hour_data&id=fans&period=last_hour';
+ } else {
+ url = '/redfish/v1/TelemetryService/MetricReports/hour_data&id=fans';
+ }
+ return await api
+ .get(url)
+ .then(({ data: { MetricValues = [] } }) => {
+ if (lastHour) {
+ commit('setFansDynamicLastHour', MetricValues);
+ } else {
+ commit('setFansDynamic', MetricValues);
+ }
+ })
+ .catch((error) => console.log(error));
+ },
async getFanInfo({ commit }) {
return await api
.get('/redfish/v1/Chassis/chassis/Thermal')
diff --git a/src/store/modules/HardwareStatus/MotherboardStore.js b/src/store/modules/HardwareStatus/MotherboardStore.js
new file mode 100644
index 00000000..7b2fe032
--- /dev/null
+++ b/src/store/modules/HardwareStatus/MotherboardStore.js
@@ -0,0 +1,45 @@
+import api from '@/store/api';
+
+const MotherboardStore = {
+ namespaced: true,
+ state: {
+ motherboard: [],
+ motherboardLastHour: [],
+ },
+ getters: {
+ motherboard: (state) => state.motherboard,
+ motherboardLastHour: (state) => state.motherboardLastHour,
+ },
+ mutations: {
+ setMotherboardDynamic: (state, data) => {
+ state.motherboard = data;
+ },
+ setMotherboardDynamicLastHour: (state, data) => {
+ state.motherboardLastHour = data;
+ },
+ },
+ actions: {
+ async getMotherboardDynamic({ commit }, { lastHour }) {
+ let url = null;
+ if (lastHour) {
+ url =
+ '/redfish/v1/TelemetryService/MetricReports/hour_data&id=other_temp&period=last_hour';
+ } else {
+ url =
+ '/redfish/v1/TelemetryService/MetricReports/hour_data&id=other_temp';
+ }
+ return await api
+ .get(url)
+ .then(({ data: { MetricValues = [] } }) => {
+ if (lastHour) {
+ commit('setMotherboardDynamicLastHour', MetricValues);
+ } else {
+ commit('setMotherboardDynamic', MetricValues);
+ }
+ })
+ .catch((error) => console.log(error));
+ },
+ },
+};
+
+export default MotherboardStore;