summaryrefslogtreecommitdiff
path: root/src/store/modules/_sila/HardwareStatus/FanStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/modules/_sila/HardwareStatus/FanStore.js')
-rw-r--r--src/store/modules/_sila/HardwareStatus/FanStore.js81
1 files changed, 0 insertions, 81 deletions
diff --git a/src/store/modules/_sila/HardwareStatus/FanStore.js b/src/store/modules/_sila/HardwareStatus/FanStore.js
deleted file mode 100644
index fed3f742..00000000
--- a/src/store/modules/_sila/HardwareStatus/FanStore.js
+++ /dev/null
@@ -1,81 +0,0 @@
-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) => {
- 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,
- };
- });
- },
-
- 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')
- .then(({ data: { Fans = [] } }) => commit('setFanInfo', Fans))
- .catch((error) => console.log(error));
- },
- },
-};
-
-export default FanStore;