diff options
author | Derick Montague <derick.montague@ibm.com> | 2021-06-28 23:52:22 +0300 |
---|---|---|
committer | Derick Montague <derick.montague@ibm.com> | 2021-08-10 22:20:42 +0300 |
commit | 828dda9b187684902710bb11621eca27bf0c6eec (patch) | |
tree | 322a9511f7df3317ae23ab55b08c9b3730dfd810 /src/store/modules/Health/DumpsStore.js | |
parent | 03dc2b7b9f0672aac84349fbc77aab55403447e0 (diff) | |
download | webui-vue-828dda9b187684902710bb11621eca27bf0c6eec.tar.xz |
IA update: Add logs and update overview icon
This is the first patchset of the information architecture changes.
These changes are the result of several months of design research with
users to improve the existing information architecture (IA). More
information can we found in the Github story.
This patchset will add a Logs section and move event logs and dumps from
the Health section to the new Logs section. It will also update the icon
used for the Overview page.
Github story: https://github.com/openbmc/webui-vue/issues/56
Testing:
1. IBM build:
- Logs contained Event logs and dumps
- Both pages rendered when clicking link
2. Intel build
- Logs contained Event logs only
- Logs page rendered when clicking link
3. Tested default build
- Logs contained Event logs only
- Logs page rendered when clicking link
Signed-off-by: Derick Montague <derick.montague@ibm.com>
Change-Id: I4621837202cf5ad3469d6ea460d9a5bdc79c8816
Diffstat (limited to 'src/store/modules/Health/DumpsStore.js')
-rw-r--r-- | src/store/modules/Health/DumpsStore.js | 117 |
1 files changed, 0 insertions, 117 deletions
diff --git a/src/store/modules/Health/DumpsStore.js b/src/store/modules/Health/DumpsStore.js deleted file mode 100644 index 3b91354b..00000000 --- a/src/store/modules/Health/DumpsStore.js +++ /dev/null @@ -1,117 +0,0 @@ -import api, { getResponseCount } from '@/store/api'; -import i18n from '@/i18n'; - -const DumpsStore = { - namespaced: true, - state: { - bmcDumps: [], - }, - getters: { - bmcDumps: (state) => state.bmcDumps, - }, - mutations: { - setBmcDumps: (state, dumps) => { - state.bmcDumps = dumps.map((dump) => ({ - data: dump.AdditionalDataURI, - dateTime: new Date(dump.Created), - dumpType: dump.Name, - id: dump.Id, - location: dump['@odata.id'], - size: dump.AdditionalDataSizeBytes, - })); - }, - }, - actions: { - async getBmcDumps({ commit }) { - return await api - .get('/redfish/v1/Managers/bmc/LogServices/Dump/Entries') - .then(({ data = {} }) => commit('setBmcDumps', data.Members || [])) - .catch((error) => console.log(error)); - }, - async createBmcDump() { - return await api - .post( - '/redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.CollectDiagnosticData', - { - DiagnosticDataType: 'Manager', - OEMDiagnosticDataType: '', - } - ) - .catch((error) => { - console.log(error); - throw new Error(i18n.t('pageDumps.toast.errorStartBmcDump')); - }); - }, - async createSystemDump() { - return await api - .post( - '/redfish/v1/Systems/system/LogServices/Dump/Actions/LogService.CollectDiagnosticData', - { - DiagnosticDataType: 'OEM', - OEMDiagnosticDataType: 'System', - } - ) - .catch((error) => { - console.log(error); - throw new Error(i18n.t('pageDumps.toast.errorStartSystemDump')); - }); - }, - async deleteDumps({ dispatch }, dumps) { - const promises = dumps.map(({ location }) => - api.delete(location).catch((error) => { - console.log(error); - return error; - }) - ); - return await api - .all(promises) - .then((response) => { - dispatch('getBmcDumps'); - return response; - }) - .then( - api.spread((...responses) => { - const { successCount, errorCount } = getResponseCount(responses); - const toastMessages = []; - - if (successCount) { - const message = i18n.tc( - 'pageDumps.toast.successDeleteDump', - successCount - ); - toastMessages.push({ type: 'success', message }); - } - - if (errorCount) { - const message = i18n.tc( - 'pageDumps.toast.errorDeleteDump', - errorCount - ); - toastMessages.push({ type: 'error', message }); - } - - return toastMessages; - }) - ); - }, - async deleteAllDumps({ commit, state }) { - const totalDumpCount = state.bmcDumps.length; - return await api - .post( - '/redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.ClearLog' - ) - .then(() => { - commit('setBmcDumps', []); - return i18n.tc('pageDumps.toast.successDeleteDump', totalDumpCount); - }) - .catch((error) => { - console.log(error); - throw new Error( - i18n.tc('pageDumps.toast.errorDeleteDump', totalDumpCount) - ); - }); - }, - }, -}; - -export default DumpsStore; |