diff options
Diffstat (limited to 'src/store/modules/_sila/HardwareStatus')
-rw-r--r-- | src/store/modules/_sila/HardwareStatus/FanStore.js | 81 | ||||
-rw-r--r-- | src/store/modules/_sila/HardwareStatus/MotherboardStore.js | 45 |
2 files changed, 0 insertions, 126 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; diff --git a/src/store/modules/_sila/HardwareStatus/MotherboardStore.js b/src/store/modules/_sila/HardwareStatus/MotherboardStore.js deleted file mode 100644 index 7b2fe032..00000000 --- a/src/store/modules/_sila/HardwareStatus/MotherboardStore.js +++ /dev/null @@ -1,45 +0,0 @@ -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; |