diff options
author | c00149107 <chenchuanyu@huawei.com> | 2017-04-24 17:47:59 +0800 |
---|---|---|
committer | c00149107 <chenchuanyu@huawei.com> | 2017-04-24 17:47:59 +0800 |
commit | 993330a8817ffbd94a4f4bbd38d20e26b2e77350 (patch) | |
tree | 13d3bba7b0dfa1cd9b635c2047f00920fea246a5 /resmgr/src | |
parent | eaf64ea69ea837a99e0ad26fd9c33cf3537e9166 (diff) |
Fix resmgr client showing errors
Fix resmgr client showing errors
Change-Id: I493d7089c262ee0bf8078259fe2e287d2966731f
Issue-ID:CLIENT-200
Signed-off-by: c00149107 <chenchuanyu@huawei.com>
Diffstat (limited to 'resmgr/src')
-rw-r--r-- | resmgr/src/main/webapp/resmgr/js/app.js | 25 | ||||
-rw-r--r-- | resmgr/src/main/webapp/resmgr/sdn-resmgr/port/port.html | 1 | ||||
-rw-r--r-- | resmgr/src/main/webapp/resmgr/sdn-resmgr/port/portRest.js | 8 |
3 files changed, 26 insertions, 8 deletions
diff --git a/resmgr/src/main/webapp/resmgr/js/app.js b/resmgr/src/main/webapp/resmgr/js/app.js index 2ffcc2b6..2ca5177b 100644 --- a/resmgr/src/main/webapp/resmgr/js/app.js +++ b/resmgr/src/main/webapp/resmgr/js/app.js @@ -134,9 +134,18 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) var portName = {"ErrMsg" : {"errmsg" : "Name is required.", "modalVar":"port.name", "errtag":"textboxErrName", "errfunc":"validatetextboxName", "required":true}};
$('#myModal #name').append($compile(Mustache.to_html(text, portName.ErrMsg))($scope));
- var portMe = {"ErrMsg" : {"errmsg" : "ME is required.", "modalVar":"port.meID", "errtag":"textboxErrMe", "errfunc":"validatetextboxMe", "required":true}};
- $('#myModal #meID').append($compile(Mustache.to_html(text, portMe.ErrMsg))($scope));
-
+ portDataService.getAllNEData().then(function(response) {
+ var medata = [];
+ for(var i = 0; i < response.managedElements.length; i+=1){
+ medata[i] = {"serviceTemplateId":response.managedElements[i].id,"templateName":response.managedElements[i].name};
+ }
+ var dropdownInfo = translateToDropdownInfo(medata);
+ $("#myModal #medropdown").html(dropdownInfo);
+ console.log("Data: ");
+ $log.info(data);
+ }, function(reason) {
+ $scope.message = "Error is :" + JSON.stringify(reason);
+ });
//var portType = {"ErrMsg" : {"textboxErr" : "The name is required.", "modalVar":"port.type"}};
//$('#myModal #type').append($compile(Mustache.to_html(dropDown, $scope.data.dropdowntypeData))($scope));
@@ -148,7 +157,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) $('#myModal #type').append($compile(Mustache.to_html(dropDown, dropSimple_data))($scope));*/
- var dropdownResponse=[{"serviceTemplateId":"tenant_site","templateName":"portType1"},{"serviceTemplateId":"tenant_site2","templateName":"portType2"}];
+ var dropdownResponse=[{"serviceTemplateId":"ETH","templateName":"ETH"},{"serviceTemplateId":"POS","templateName":"POS"},{"serviceTemplateId":"Trunk","templateName":"Trunk"},{"serviceTemplateId":"Loopback","templateName":"Loopback"}];
var dropdownInfo = translateToDropdownInfo(dropdownResponse);
document.getElementById("portdropdown").innerHTML = dropdownInfo;
@@ -169,7 +178,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) $('#myModal #Edgepoint').append($compile(Mustache.to_html(dropDown, dropSimple_data))($scope));*/
- var dropdownResponse=[{"serviceTemplateId":"tenant_site","templateName":"Edgepoint1"},{"serviceTemplateId":"tenant_site2","templateName":"Edgepoint2"}];
+ var dropdownResponse=[{"serviceTemplateId":"true","templateName":"true"},{"serviceTemplateId":"false","templateName":"false"}];
var dropdownInfo = translateToDropdownInfo(dropdownResponse);
document.getElementById("portEdropdown").innerHTML = dropdownInfo;
@@ -464,7 +473,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) $('#myModal #type').append($compile(Mustache.to_html(dropDown, dropSimple_data))($scope));*/
- var dropdownResponse=[{"serviceTemplateId":"tenant_site","templateName":"tenant_site"},{"serviceTemplateId":"tenant_site2","templateName":"tenant_site2"}];
+ var dropdownResponse=[{"serviceTemplateId":"network_site","templateName":"network_site"},{"serviceTemplateId":"tenant_site","templateName":"tenant_site"}];
var dropdownInfo = translateToDropdownInfo(dropdownResponse);
document.getElementById("sitedropdown").innerHTML = dropdownInfo;
@@ -1212,7 +1221,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) neDataService.getNECtrlDDList()
.then(function (response) {
- $scope.ctrlList = response.data;
+ $scope.ctrlList = response;
var dropdownInfo = translateCtrlIDToDropdownInfo($scope.ctrlList);
$("#myModal #medropdown").html(dropdownInfo);
console.log("Data: ");
@@ -1224,7 +1233,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) /*var neController = {"ErrMsg" : {"errmsg" : "IP Address is required.", "modalVar":"ne.controller"}};
$('#myModal #controller').append($compile(Mustache.to_html(text, neController.ErrMsg))($scope));*/
- var neIPAddress = {"ErrMsg" : {"errmsg" : "IP Address is required.", "modalVar":"ne.ipAddress","errtag":"textboxErrIP", "errfunc":"validatetextboxIP","required":true}};
+ var neIPAddress = {"ErrMsg" : {"errmsg" : "IP Address is required.", "modalVar":"ne.ipAddress"}};
$('#myModal #ipAddress').append($compile(Mustache.to_html(text, neIPAddress.ErrMsg))($scope));
diff --git a/resmgr/src/main/webapp/resmgr/sdn-resmgr/port/port.html b/resmgr/src/main/webapp/resmgr/sdn-resmgr/port/port.html index f81265b0..e980af6a 100644 --- a/resmgr/src/main/webapp/resmgr/sdn-resmgr/port/port.html +++ b/resmgr/src/main/webapp/resmgr/sdn-resmgr/port/port.html @@ -95,6 +95,7 @@ <div class="form-group row" id="rowSpacing">
<label class="col-xs-4 col-form-label" id="textCenter">me</label>
<div id="meID" class="col-xs-8" >
+ <select id="medropdown" class="form-control inputfield" ng-model="siteData.optSelect"></select>
</div>
</div>
<div class="form-group row" id="rowSpacing">
diff --git a/resmgr/src/main/webapp/resmgr/sdn-resmgr/port/portRest.js b/resmgr/src/main/webapp/resmgr/sdn-resmgr/port/portRest.js index 6bed2640..ad960cd7 100644 --- a/resmgr/src/main/webapp/resmgr/sdn-resmgr/port/portRest.js +++ b/resmgr/src/main/webapp/resmgr/sdn-resmgr/port/portRest.js @@ -90,6 +90,14 @@ app.factory("portDataService", function($http,DataService, $log){ console.log(response);
return response;
});
+ },
+ getAllNEData : function() {
+ return DataService.get("/openoapi/extsys/v1/sdncontrollers")
+ .then(function(response){
+ $log.info("in get data service data is :"+response);
+ console.log(response);
+ return response;
+ });
}
}
});
\ No newline at end of file |