Added delete and mark as resolved in event log page
Change-Id: Ia1f8e630cecef38bc546bdcde867685a99dd936b
Signed-off-by: Iftekharul Islam <iislam@us.ibm.com>
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index b044328..3b8b7e0 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -11,7 +11,7 @@
'use strict';
angular
.module('app.common.services')
- .factory('APIUtils', ['$http', 'Constants', function($http, Constants){
+ .factory('APIUtils', ['$http', 'Constants', '$q', function($http, Constants, $q){
var SERVICE = {
LOGIN_CREDENTIALS: Constants.LOGIN_CREDENTIALS,
API_CREDENTIALS: Constants.API_CREDENTIALS,
@@ -599,7 +599,7 @@
getBMCEthernetInfo: function(callback){
$http({
method: 'GET',
- url: SERVICE.API_CREDENTIALS.host + "/xyz/openbmc_project/inventory",
+ url: SERVICE.API_CREDENTIALS.host + "/xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc/ethernet",
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
@@ -620,7 +620,7 @@
getBMCInfo: function(callback){
$http({
method: 'GET',
- url: SERVICE.API_CREDENTIALS.host + "/xyz/openbmc_project/inventory",
+ url: SERVICE.API_CREDENTIALS.host + "/xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc",
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
@@ -641,7 +641,7 @@
getHardwares: function(callback){
$http({
method: 'GET',
- url: SERVICE.API_CREDENTIALS.host + "/xyz/openbmc_project/inventory/system",
+ url: SERVICE.API_CREDENTIALS.host + "/xyz/openbmc_project/inventory/enumerate",
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
@@ -742,6 +742,56 @@
}
});
},
+ deleteLogs: function(logs) {
+ var defer = $q.defer();
+ var promises = [];
+
+ function finished(){
+ defer.resolve();
+ }
+
+ logs.forEach(function(item){
+ promises.push($http({
+ method: 'POST',
+ url: SERVICE.API_CREDENTIALS.host + "/xyz/openbmc_project/logging/entry/"+item.Id+"/action/Delete",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ withCredentials: true,
+ data: JSON.stringify({"data": []})
+ }));
+ });
+
+ $q.all(promises).then(finished);
+
+ return defer.promise;
+ },
+ resolveLogs: function(logs) {
+ var defer = $q.defer();
+ var promises = [];
+
+ function finished(){
+ defer.resolve();
+ }
+
+ logs.forEach(function(item){
+ promises.push($http({
+ method: 'PUT',
+ url: SERVICE.API_CREDENTIALS.host + "/xyz/openbmc_project/logging/entry/"+item.Id+"/attr/Resolved",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ withCredentials: true,
+ data: JSON.stringify({"data": "1"})
+ }));
+ });
+
+ $q.all(promises).then(finished);
+
+ return defer.promise;
+ },
};
return SERVICE;
}]);
diff --git a/app/common/services/constants.js b/app/common/services/constants.js
index 1445081..7d77ec0 100644
--- a/app/common/services/constants.js
+++ b/app/common/services/constants.js
@@ -20,7 +20,7 @@
password: "testpass",
},
API_CREDENTIALS: {
- host: 'https://9.3.164.177',
+ host: 'https://9.3.181.15',
mock_host: 'http://localhost:3000'
},
API_RESPONSE: {
@@ -59,7 +59,7 @@
Warning: 'Medium'
},
PAGINATION: {
- LOG_ITEMS_PER_PAGE: 4
+ LOG_ITEMS_PER_PAGE: 25
},
HARDWARE: {
component_key_filter: '/xyz/openbmc_project/inventory/system',