Add dynamic content to system overview page
Change-Id: Id47db28c9ec7b4dc39b9b690797087e1970ce328
Signed-off-by: Iftekharul Islam <iislam@us.ibm.com>
diff --git a/app/common/directives/log-event.html b/app/common/directives/log-event.html
index 70d7dee..6b8f972 100644
--- a/app/common/directives/log-event.html
+++ b/app/common/directives/log-event.html
@@ -21,7 +21,7 @@
<div class="column small-9 large-9 event-log__event-info"
ng-click="event.meta = ! event.meta">
<p class="inline event__priority event-resolved" ng-hide="event.Resolved == 0">Resolved</p>
- <p class="inline event__priority med-priority" ng-class="{'low-priority': event.priority == 'Low', 'medium-priority': event.priority == 'Medium', 'high-priority': event.priority == 'High'}" ng-hide="event.Resolved == 1">{{event.priority}}</p>
+ <p class="inline event__priority" ng-class="{'low-priority': event.priority == 'Low', 'medium-priority': event.priority == 'Medium', 'high-priority': event.priority == 'High'}" ng-hide="event.Resolved == 1">{{event.priority}}</p>
<p class="inline event__severity">{{event.severity_code}}</p>
<p class="inline event__description">{{event.Severity}}</p>
<div>
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index 540fb42..ed10768 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -67,7 +67,11 @@
}).success(function(response){
var json = JSON.stringify(response);
var content = JSON.parse(json);
- callback(content.data.Asserted);
+ if(callback){
+ callback(content.data.Asserted);
+ }else{
+ return content.data.Asserted;
+ }
}).error(function(error){
console.log(error);
});
@@ -355,7 +359,11 @@
}, content.data[key]));
}
}
- callback(data, dataClone);
+ if(callback){
+ callback(data, dataClone);
+ }else{
+ return data;
+ }
}).error(function(error){
console.log(error);
});
@@ -553,7 +561,11 @@
}
}
}
- callback(data, bmcActiveVersion, hostActiveVersion);
+ if(callback){
+ callback(data, bmcActiveVersion, hostActiveVersion);
+ }else{
+ return(data, bmcActiveVersion, hostActiveVersion);
+ }
}).error(function(error){
console.log(error);
});
@@ -584,6 +596,48 @@
}
});
},
+ getBMCEthernetInfo: function(callback){
+ $http({
+ method: 'GET',
+ url: SERVICE.API_CREDENTIALS.host + "/xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc/ethernet",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ withCredentials: true
+ }).success(function(response){
+ var json = JSON.stringify(response);
+ var content = JSON.parse(json);
+ if(callback){
+ callback(content.data);
+ }else{
+ return content.data;
+ }
+ }).error(function(error){
+ console.log(error);
+ });
+ },
+ getBMCInfo: function(callback){
+ $http({
+ method: 'GET',
+ url: SERVICE.API_CREDENTIALS.host + "/xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ withCredentials: true
+ }).success(function(response){
+ var json = JSON.stringify(response);
+ var content = JSON.parse(json);
+ if(callback){
+ callback(content.data);
+ }else{
+ return content.data;
+ }
+ }).error(function(error){
+ console.log(error);
+ });
+ },
};
return SERVICE;
}]);