summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
authorYoshie Muranaka <yoshiemuranaka@gmail.com>2020-06-08 21:03:11 +0300
committerDerick Montague <derick.montague@ibm.com>2020-06-18 00:04:55 +0300
commite24b17d2f599a34895acb9eccff3144af55484c5 (patch)
tree5576908d3fdd2966872f4dd763237e85a682e81a /src/store
parentb1f559f03e3f464c1b8b19a9327158be0ecafe62 (diff)
downloadwebui-vue-e24b17d2f599a34895acb9eccff3144af55484c5.tar.xz
Add DIMM slot table to hardware status page
Add items at /redfish/v1/Systems/system/Memory endpoint to DIMM slot table. The table is sortable and has a row expansion to view details. The code is currently missing most properties needed to match the design. This table will need to be revisited when all properties are available. Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com> Change-Id: I07cacf3403fe84431cb9fe0e4315069fc7baf27d
Diffstat (limited to 'src/store')
-rw-r--r--src/store/index.js4
-rw-r--r--src/store/modules/Health/MemoryStore.js39
2 files changed, 42 insertions, 1 deletions
diff --git a/src/store/index.js b/src/store/index.js
index 8479a27b..b4e030ba 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -16,6 +16,7 @@ import SensorsStore from './modules/Health/SensorsStore';
import ServerLedStore from './modules/Control/ServerLedStore';
import SystemStore from './modules/Health/SystemStore';
import PowerSupplyStore from './modules/Health/PowerSupplyStore';
+import MemoryStore from './modules/Health/MemoryStore';
import WebSocketPlugin from './plugins/WebSocketPlugin';
@@ -40,7 +41,8 @@ export default new Vuex.Store({
sensors: SensorsStore,
sslCertificates: SslCertificatesStore,
serverLed: ServerLedStore,
- system: SystemStore
+ system: SystemStore,
+ memory: MemoryStore
},
plugins: [WebSocketPlugin]
});
diff --git a/src/store/modules/Health/MemoryStore.js b/src/store/modules/Health/MemoryStore.js
new file mode 100644
index 00000000..63e08e6a
--- /dev/null
+++ b/src/store/modules/Health/MemoryStore.js
@@ -0,0 +1,39 @@
+import api from '@/store/api';
+
+const MemoryStore = {
+ namespaced: true,
+ state: {
+ dimms: []
+ },
+ getters: {
+ dimms: state => state.dimms
+ },
+ mutations: {
+ setMemoryInfo: (state, data) => {
+ state.dimms = data.map(({ data }) => {
+ const { Id, Status = {}, PartNumber, SerialNumber } = data;
+ return {
+ id: Id,
+ health: Status.Health,
+ partNumber: PartNumber,
+ serialNumber: SerialNumber,
+ statusState: Status.State
+ };
+ });
+ }
+ },
+ actions: {
+ async getDimms({ commit }) {
+ return await api
+ .get('/redfish/v1/Systems/system/Memory')
+ .then(({ data: { Members } }) => {
+ const promises = Members.map(item => api.get(item['@odata.id']));
+ return api.all(promises);
+ })
+ .then(response => commit('setMemoryInfo', response))
+ .catch(error => console.log(error));
+ }
+ }
+};
+
+export default MemoryStore;