WebUI system logs implementation
This commit implements the webui logs page
which will show all system logs depends
on user selection( SEL or Event or Oem). This
is based out of redfish systems log services.
- View logs with pagination.
- Search filter for logs view.
- Sort option with Type, Id, Severity, Date.
- Clear logs.
- Export logs.
UnitTest:
- Existing bmcweb send the system logs of EntryType
"Event". So Loaded UI, selected Type "Event" and
validated all the above mentioned operations.
Change-Id: I0384e475f7913ca66b6db5d64831583fb382f8d5
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index 503fcd1..743d3fa 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -57,6 +57,54 @@
return ip.match(
/\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/);
},
+ getRedfishSysName: function() {
+ return $http({
+ method: 'GET',
+ url: DataService.getHost() + '/redfish/v1/Systems',
+ withCredentials: true
+ })
+ .then(
+ function(response) {
+ var sysUrl = response.data['Members'][0]['@odata.id'];
+ return sysUrl.split('/').pop(-1);
+ },
+ function(error) {
+ console.log(JSON.stringify(error));
+ });
+ },
+ getSystemLogs: function(recordType) {
+ var uri = '/redfish/v1/Systems/' + DataService.systemName +
+ '/LogServices/EventLog/Entries';
+ return $http({
+ method: 'GET',
+ url: DataService.getHost() + uri,
+ withCredentials: true
+ })
+ .then(
+ function(response) {
+ var logEntries = [];
+ angular.forEach(response.data['Members'], function(log) {
+ if (log.hasOwnProperty('EntryType')) {
+ if (log['EntryType'] == recordType) {
+ logEntries.push(log);
+ }
+ }
+ });
+ return logEntries;
+ },
+ function(error) {
+ console.log(JSON.stringify(error));
+ });
+ },
+ clearSystemLogs: function() {
+ var uri = '/redfish/v1/Systems/' + DataService.systemName +
+ '/LogServices/EventLog/Actions/LogService.ClearLog';
+ return $http({
+ method: 'POST',
+ url: DataService.getHost() + uri,
+ withCredentials: true
+ });
+ },
deleteObject: function(path) {
return $http({
method: 'POST',