forked from openbmc/webui-vue
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Audit Logs Page Implementation (#174)
* Added Implementation of AuditLogs GUI * Added error handling for download all * removed the AuditLogEntry condition * Added success toast * Added dropdown from id and message string * rverted commits * Addresed review comments
- Loading branch information
1 parent
08a7899
commit 38d9b57
Showing
10 changed files
with
440 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import api from '@/store/api'; | ||
|
||
const AuditLogsStore = { | ||
namespaced: true, | ||
state: { | ||
allAuditLogs: [], | ||
}, | ||
getters: { | ||
allAuditLogs: (state) => state.allAuditLogs, | ||
}, | ||
mutations: { | ||
setAllAuditLogs: (state, allAuditLogs) => | ||
(state.allAuditLogs = allAuditLogs), | ||
}, | ||
actions: { | ||
async getAuditLogData({ commit }) { | ||
return await api | ||
.get('/redfish/v1/Systems/system/LogServices/AuditLog/Entries') | ||
.then(({ data: { Members = [] } = {} }) => { | ||
const auditLogs = Members.map((log) => { | ||
const { EventTimestamp, Id, Message, MessageArgs, Oem } = log; | ||
const [, operation, account, , , address, , result] = MessageArgs; | ||
return { | ||
auditId: Id, | ||
operation: operation, | ||
message: Message, | ||
account: account || '--', | ||
date: new Date(EventTimestamp), | ||
addr: address ? address.split('::ffff:').pop() : '--', | ||
res: result || '--', | ||
uri: log['@odata.id'], | ||
additionalDataUri: Oem.IBM.AdditionalDataFullAuditLogURI, | ||
}; | ||
}); | ||
commit('setAllAuditLogs', auditLogs); | ||
}) | ||
.catch((error) => { | ||
console.log(error); | ||
}); | ||
}, | ||
async downloadLogData(_, uri) { | ||
return await api.get(uri).then((response) => { | ||
return response; | ||
}); | ||
}, | ||
}, | ||
}; | ||
|
||
export default AuditLogsStore; |
Oops, something went wrong.