Updated hostname and mac address with correct api path in server dashboard
Change-Id: I2661a7234a288d7fed60461580fa1845a5d712b6
Signed-off-by: Iftekharul Islam <iislam@us.ibm.com>
diff --git a/app/common/directives/app-header.html b/app/common/directives/app-header.html
index d6eb8bc..bc0d744 100644
--- a/app/common/directives/app-header.html
+++ b/app/common/directives/app-header.html
@@ -7,7 +7,7 @@
<div class="header__functions-wrapper" aria-label="header">
<div class="logo__wrapper"><img src="assets/images/logo.svg" class="header__logo" alt="company logo"/></div>
<div class="header__server-name">
- <p class="header__hostname">[[hostname needed]]</p>
+ <p class="header__hostname">{{dataService.hostname}}</p>
<p class="header__server-ip courier-bold">BMC IP address {{dataService.server_id}}</p>
</div>
<div class="header__functions">
diff --git a/app/common/directives/app-header.js b/app/common/directives/app-header.js
index a2f510e..6a9493b 100644
--- a/app/common/directives/app-header.js
+++ b/app/common/directives/app-header.js
@@ -15,7 +15,6 @@
$scope.loadServerStatus = function(){
if(!userModel.isLoggedIn()){
- //@TODO:some error message?
return;
}
APIUtils.getHostState(function(status){
@@ -28,7 +27,18 @@
}
});
}
+
+ $scope.loadNetworkInfo = function(){
+ if(!userModel.isLoggedIn()){
+ return;
+ }
+ APIUtils.getNetworkInfo().then(function(data){
+ dataService.setNetworkInfo(data);
+ });
+ }
+
$scope.loadServerStatus();
+ $scope.loadNetworkInfo();
$scope.logout = function(){
userModel.logout(function(status, error){
@@ -42,6 +52,7 @@
$scope.refresh = function(){
$scope.loadServerStatus();
+ $scope.loadNetworkInfo();
//Add flash class to header timestamp on click of refresh
var myEl = angular.element( document.querySelector( '.header__refresh' ) );
@@ -54,6 +65,7 @@
var loginListener = $rootScope.$on('user-logged-in', function(event, arg){
$scope.loadServerStatus();
+ $scope.loadNetworkInfo();
});
$scope.$on('$destroy', function(){
diff --git a/app/common/services/dataService.js b/app/common/services/dataService.js
index 6863621..6640ddb 100644
--- a/app/common/services/dataService.js
+++ b/app/common/services/dataService.js
@@ -31,20 +31,28 @@
this.path = '';
this.sensorData = [];
+ this.hostname = "";
+ this.mac_address = "";
+
+ this.setNetworkInfo = function(data){
+ this.hostname = data.hostname;
+ this.mac_address = data.mac_address;
+ }
+
this.setPowerOnState = function(){
this.server_state = Constants.HOST_STATE_TEXT.on;
this.server_status = Constants.HOST_STATE.on;
- },
+ }
this.setPowerOffState = function(){
this.server_state = Constants.HOST_STATE_TEXT.off;
this.server_status = Constants.HOST_STATE.off;
- },
+ }
this.setBootingState = function(){
this.server_state = Constants.HOST_STATE_TEXT.booting;
this.server_status = Constants.HOST_STATE.booting;
- },
+ }
this.setUnreachableState = function(){
this.server_state = Constants.HOST_STATE_TEXT.unreachable;
diff --git a/app/overview/controllers/system-overview-controller.html b/app/overview/controllers/system-overview-controller.html
index 384ca99..787a0dd 100644
--- a/app/overview/controllers/system-overview-controller.html
+++ b/app/overview/controllers/system-overview-controller.html
@@ -41,7 +41,7 @@
<ul class="overview__metadata-wrapper">
<li class="overview__metadata-block">
<p class="content-label">Hostname</p>
- <p class="courier-bold overview__hostname">bmc401.aus.stg1.global</p>
+ <p class="courier-bold overview__hostname">{{dataService.hostname}}</p>
</li>
<li class="overview__metadata-block">
<p class="content-label">BMC IP address</p>
@@ -53,7 +53,7 @@
</li>
<li class="overview__metadata-block">
<p class="content-label">Mac address</p>
- <p class="courier-bold">{{mac_address}}</p>
+ <p class="courier-bold">{{dataService.mac_address}}</p>
</li>
</ul>
</div>