| import api from '@/store/api'; |
| chassis: state => state.chassis |
| setChassisInfo: (state, data) => { |
| state.chassis = data.map(chassis => { |
| serialNumber: SerialNumber, |
| chassisType: ChassisType, |
| manufacturer: Manufacturer, |
| statusState: Status.State, |
| healthRollup: Status.HealthRollup |
| async getChassisInfo({ commit }) { |
| .get('/redfish/v1/Chassis') |
| .then(({ data: { Members = [] } }) => |
| Members.map(member => api.get(member['@odata.id'])) |
| .then(promises => api.all(promises)) |
| const data = response.map(({ data }) => data); |
| commit('setChassisInfo', data); |
| .catch(error => console.log(error)); |
| export default ChassisStore; |