diff options
author | Quan-Zhong <quanzhong@huawei.com> | 2017-04-21 10:54:24 +0800 |
---|---|---|
committer | Quan-Zhong <quanzhong@huawei.com> | 2017-04-21 10:54:24 +0800 |
commit | 07361b0590debc727a2041d33f027df9926cddf2 (patch) | |
tree | 080b498811db3bf063be9458549a01d98ff25225 /resmgr | |
parent | ee1b2408e237eb8127561b24c43ed8c7a64c789b (diff) |
modify resmgr-nfv
NFVO-171
Change-Id: Iab216c4009ab4c4c78107bad1f34016afe4334d6
Signed-off-by: Quan-Zhong <quanzhong@huawei.com>
Diffstat (limited to 'resmgr')
6 files changed, 164 insertions, 123 deletions
diff --git a/resmgr/src/main/webapp/resmgr/js/app.js b/resmgr/src/main/webapp/resmgr/js/app.js index aea4a20d..b8d5cb12 100644 --- a/resmgr/src/main/webapp/resmgr/js/app.js +++ b/resmgr/src/main/webapp/resmgr/js/app.js @@ -643,8 +643,8 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) $scope.init = function() {
locationDataService.getLocationData()
.then(function (data) {
- $scope.data = data;
- console.log("Data: ");
+ $scope.data = data.locations;
+ console.log(JSON.stringify($scope.data));
$log.info(data);
loadButtons();
}, function (reason) {
@@ -665,7 +665,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) $('#locationAction').html($compile(addhtml)($scope));
$('#locationAction').append($compile(deletehtml)($scope));
- var modelSubmit_data = {"title":"OK", "clickAction":"saveData(loc.Id)"};
+ var modelSubmit_data = {"title":"OK", "clickAction":"saveData(loc.id)"};
var modelSubmit_html = Mustache.to_html(def_button_tpl, modelSubmit_data);
$('#myModal #footerBtns').html($compile(modelSubmit_html)($scope));
@@ -678,34 +678,34 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) var ipv4 = $(modelTemplate).filter('#ipv4').html();
var number = $(modelTemplate).filter('#numeric').html();
- var locId = {"ErrMsg" : {"errmsg" : "Name is required.", "modalVar":"loc.Id", "errtag":"textboxErrId", "errfunc":"validatetextboxId"}};
+ var locId = {"ErrMsg" : {"errmsg" : "Name is required.", "modalVar":"loc.id", "errtag":"textboxErrId", "errfunc":"validatetextboxId"}};
$('#myModal #Name').append($compile(Mustache.to_html(text, locId.ErrMsg))($scope));
- var locCountry = {"ErrMsg" : {"errmsg" : "Country is required.", "modalVar":"loc.Country", "errtag":"textboxErrCountry", "errfunc":"validatetextboxCountry","required":true}};
+ var locCountry = {"ErrMsg" : {"errmsg" : "Country is required.", "modalVar":"loc.country", "errtag":"textboxErrCountry", "errfunc":"validatetextboxCountry","required":true}};
$('#myModal #Country').append($compile(Mustache.to_html(text, locCountry.ErrMsg))($scope));
- var locLocation = {"ErrMsg" : {"errmsg" : "Location is required.", "modalVar":"loc.Location", "errtag":"textboxErrLocation", "errfunc":"validatetextboxLocation","required":true}};
+ var locLocation = {"ErrMsg" : {"errmsg" : "Location is required.", "modalVar":"loc.location", "errtag":"textboxErrLocation", "errfunc":"validatetextboxLocation","required":true}};
$('#myModal #Location').append($compile(Mustache.to_html(text, locLocation.ErrMsg))($scope));
- var locDescription = {"ErrMsg" : {"errmsg" : "The name is required.", "modalVar":"loc.Description", "errtag":"textboxErr", "errfunc":"validatetextbox"}};
+ var locDescription = {"ErrMsg" : {"errmsg" : "The name is required.", "modalVar":"loc.description", "errtag":"textboxErr", "errfunc":"validatetextbox"}};
$('#myModal #Description').append($compile(Mustache.to_html(text, locDescription.ErrMsg))($scope));
- var locLatitude = {"ErrMsg" : {"errmsg" : "Latitude is required.", "modalVar":"loc.Latitude", "errtag":"textboxErrLatitude", "errfunc":"validatetextboxLatitude", "required":true}};
+ var locLatitude = {"ErrMsg" : {"errmsg" : "Latitude is required.", "modalVar":"loc.latitude", "errtag":"textboxErrLatitude", "errfunc":"validatetextboxLatitude", "required":true}};
$('#myModal #Latitude').append($compile(Mustache.to_html(text, locLatitude.ErrMsg))($scope));
- var locLongitude = {"ErrMsg" : {"errmsg" : "Longitude is required.", "modalVar":"loc.Longitude", "errtag":"textboxErrLongitude", "errfunc":"validatetextboxLongitude", "required":true}};
+ var locLongitude = {"ErrMsg" : {"errmsg" : "Longitude is required.", "modalVar":"loc.longitude", "errtag":"textboxErrLongitude", "errfunc":"validatetextboxLongitude", "required":true}};
$('#myModal #Longitude').append($compile(Mustache.to_html(text, locLongitude.ErrMsg))($scope));
$scope.checkboxes = { 'checked': false, items: {} };
- $scope.neTableParams = new NgTableParams({count: 5, sorting: {Id: 'asc'} //{page: 1,count: 10,filter: {name: 'M'},sorting: {name: 'desc'}
- }, { counts:[5, 10, 20, 50], dataset: $scope.data.locationData});
+ $scope.neTableParams = new NgTableParams({count: 5, sorting: {Id: 'asc'}
+ }, { counts:[5, 10, 20, 50], dataset: $scope.data});
$scope.$watch('checkboxes.checked', function(value) {
$scope.checkboxes.items = {};
angular.forEach($scope.neTableParams.data, function(item) {
- if (angular.isDefined(item.Id)) {
- $scope.checkboxes.items[item.Id] = value;
+ if (angular.isDefined(item.id)) {
+ $scope.checkboxes.items[item.id] = value;
}
});
});
@@ -713,7 +713,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) }
$scope.validatetextboxCountry = function (value){
- if($scope.loc.Country) {
+ if($scope.loc.country) {
$scope.textboxErrCountry = false;
}
else
@@ -721,7 +721,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) }
$scope.validatetextboxLocation = function (value){
- if($scope.loc.Location) {
+ if($scope.loc.location) {
$scope.textboxErrLocation = false;
}
else
@@ -729,7 +729,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) }
$scope.validatetextboxLatitude = function (value){
- if($scope.loc.Latitude) {
+ if($scope.loc.latitude) {
$scope.textboxErrLatitude = false;
}
else
@@ -737,7 +737,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) }
$scope.validatetextboxLongitude = function (value){
- if($scope.loc.Longitude) {
+ if($scope.loc.longitude) {
$scope.textboxErrLongitude = false;
}
else
@@ -771,7 +771,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) if (!$scope.textboxErrLocation && !$scope.textboxErrCountry && !$scope.textboxErrLatitude && !$scope.textboxErrLongitude) {
var locs = {}
- locs.location = $scope.loc
+ locs = $scope.loc
if(id) {
@@ -861,10 +861,10 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) $scope.editData = function(id) {
console.log("To be edited : " + id);
var dataFound = false;
- angular.forEach($scope.data.locationData, function(data) {
+ angular.forEach($scope.data, function(data) {
if(!dataFound) {
- if (data.Id == id) {
- console.log("Found : " + data.Id);
+ if (data.id == id) {
+ console.log("Found : " + data.id);
$scope.loc = data;
$("#myModal").modal();
dataFound = true;
@@ -1205,9 +1205,9 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) $('#myModal #controller').append($compile(Mustache.to_html(dropDown, dropSimple_data))($scope));*/
- /*var dropdownResponse=[{"serviceTemplateId":"meCtrl","templateName":"mecontroller1"},{"serviceTemplateId":"meCtrl2","templateName":"mecontroller"}];
+ var dropdownResponse=[{"serviceTemplateId":"meCtrl","templateName":"mecontroller1"},{"serviceTemplateId":"meCtrl2","templateName":"mecontroller"}];
var dropdownInfo = translateToDropdownInfo(dropdownResponse);
- document.getElementById("medropdown").innerHTML = dropdownInfo;*/
+ document.getElementById("medropdown").innerHTML = dropdownInfo;
neDataService.getNECtrlDDList()
@@ -1476,7 +1476,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) $scope.init = function() {
datacenterDataService.getDatacenterData()
.then(function (data) {
- $scope.data = data;
+ $scope.data = data.datacenters;
console.log("Data: ");
$log.info(data);
loadButtons();
@@ -1498,7 +1498,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) $('#datacenterAction').html($compile(addhtml)($scope));
$('#datacenterAction').append($compile(deletehtml)($scope));
- var modelSubmit_data = {"title":"OK", "clickAction":"saveData(datacenter.Id)"};
+ var modelSubmit_data = {"title":"OK", "clickAction":"saveData(datacenter.id)"};
var modelSubmit_html = Mustache.to_html(def_button_tpl, modelSubmit_data);
$('#myModal #footerBtns').html($compile(modelSubmit_html)($scope));
@@ -1511,10 +1511,10 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) var number = $(modelTemplate).filter('#numeric').html();
var dropDown = $(modelTemplate).filter('#simpleDropdownTmpl').html();
- var dataId = {"ErrMsg" : {"textboxErr" : "The name is required.", "modalVar":"datacenter.Id"}};
+ var dataId = {"ErrMsg" : {"textboxErr" : "The name is required.", "modalVar":"datacenter.id"}};
$('#myModal #Id').append($compile(Mustache.to_html(text, dataId.ErrMsg))($scope));
- var dataName = {"ErrMsg" : {"errmsg" : "The name is required.", "modalVar":"datacenter.Name","errtag":"textboxErr", "errfunc":"validatetextbox","required":true}};
+ var dataName = {"ErrMsg" : {"errmsg" : "The name is required.", "modalVar":"datacenter.name","errtag":"textboxErr", "errfunc":"validatetextbox","required":true}};
$('#myModal #Name').append($compile(Mustache.to_html(text, dataName.ErrMsg))($scope));
var dataStatus = {"ErrMsg" : {"textboxErr" : "The name is required.", "modalVar":"datacenter.Status"}};
@@ -1559,30 +1559,35 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) var dropdownInfo = translateToDropdownInfo(dropdownResponse);
document.getElementById("servicenamedropdown").innerHTML = dropdownInfo;
- var dataCPU = {"ErrMsg" : {"textboxErr" : "The name is required.", "modalVar":"datacenter.Cpu"}};
+ var dataCPU = {"ErrMsg" : {"textboxErr" : "The name is required.", "modalVar":"datacenter.cpu"}};
$('#myModal #Cpu').append($compile(Mustache.to_html(text, dataCPU.ErrMsg))($scope));
- var dataMemory = {"ErrMsg" : {"textboxErr" : "The name is required.", "modalVar":"datacenter.Memory"}};
+ var dataMemory = {"ErrMsg" : {"textboxErr" : "The name is required.", "modalVar":"datacenter.memory"}};
$('#myModal #Memory').append($compile(Mustache.to_html(text, dataMemory.ErrMsg))($scope));
- var dataHarddisk = {"ErrMsg" : {"textboxErr" : "The name is required.", "modalVar":"datacenter.HardDisk"}};
+ var dataHarddisk = {"ErrMsg" : {"textboxErr" : "The name is required.", "modalVar":"datacenter.hardDisk"}};
$('#myModal #HardDisk').append($compile(Mustache.to_html(text, dataHarddisk.ErrMsg))($scope));
$scope.checkboxes = { 'checked': false, items: {} };
- $scope.neTableParams = new NgTableParams({count: 5, sorting: {Id: 'asc'} //{page: 1,count: 10,filter: {name: 'M'},sorting: {name: 'desc'}
- }, { counts:[5, 10, 20, 50], dataset: $scope.data.datacenterData});
+ $scope.neTableParams = new NgTableParams({count: 5, sorting: {Id: 'asc'}
+ }, { counts:[5, 10, 20, 50], dataset: $scope.data});
$scope.$watch('checkboxes.checked', function(value) {
$scope.checkboxes.items = {};
angular.forEach($scope.neTableParams.data, function(item) {
- if (angular.isDefined(item.Id)) {
- $scope.checkboxes.items[item.Id] = value;
+ if (angular.isDefined(item.id)) {
+ $scope.checkboxes.items[item.id] = value;
}
});
});
+
+ //action
+ fillCountryData();
+ fillVimNameData();
+ regChangeAction();
}
@@ -1597,7 +1602,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) }
$scope.validatetextbox = function (value){
- if($scope.datacenter.Name) {
+ if($scope.datacenter.name) {
$scope.textboxErr = false;
}
else
@@ -1628,7 +1633,10 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) if (!$scope.textboxErr) {
var dcs = {}
- dcs.dc = $scope.datacenter;
+ dcs = $scope.datacenter;
+ $scope.datacenter.vimName = $("#servicenamedropdown").val();
+ $scope.datacenter.location = $("#locationdropdown").val();
+ $scope.datacenter.country = $("#countrydropdown").val();
if(id) {
//edit data
console.log("Editing data.." + JSON.stringify(dcs));
@@ -1716,9 +1724,9 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) $scope.editData = function(id) {
console.log("To be edited : " + id);
var dataFound = false;
- angular.forEach($scope.data.datacenterData, function(data) {
+ angular.forEach($scope.data, function(data) {
if(!dataFound) {
- if (data.Id == id) {
+ if (data.id == id) {
console.log("Found : " + data.id);
$scope.datacenter = data;
$("#myModal").modal();
diff --git a/resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenter.html b/resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenter.html index a2caf0a2..be46fbed 100644 --- a/resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenter.html +++ b/resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenter.html @@ -24,39 +24,39 @@ <table ng-table="neTableParams" class="table table-bordered table-striped" show-filter="true">
<tr ng-repeat="datacenterData in $data">
<td header="'ng-table/headers/checkbox.html'">
- <input type="checkbox" ng-model="checkboxes.items[datacenterData.Id]" />
+ <input type="checkbox" ng-model="checkboxes.items[datacenterData.id]" />
</td>
- <td title="'Id'" filter="{ Id: 'text'}" sortable="'Id'">
- {{datacenterData.Id}}
+ <td title="'Id'" filter="{ id: 'text'}" sortable="'id'">
+ {{datacenterData.id}}
</td>
- <td title="'Name'" filter="{ Name: 'number'}" sortable="'Name'">
- {{datacenterData.Name}}
+ <td title="'Name'" filter="{ name: 'number'}" sortable="'name'">
+ {{datacenterData.name}}
</td>
- <td title="'Status'" filter="{ Status: 'text'}" sortable="'Status'">
- {{datacenterData.Status}}
+ <td title="'Status'" filter="{ status: 'text'}" sortable="'status'">
+ {{datacenterData.status}}
</td>
</td>
- <td title="'Country'" filter="{ Country: 'text'}" sortable="'Country'">
- {{datacenterData.Country}}
+ <td title="'Country'" filter="{ country: 'text'}" sortable="'country'">
+ {{datacenterData.country}}
</td>
- <td title="'Location'" filter="{ Location: 'text'}" sortable="'Location'">
- {{datacenterData.Location}}
+ <td title="'Location'" filter="{ location: 'text'}" sortable="'location'">
+ {{datacenterData.location}}
</td>
- <td title="'Service Name'" filter="{ ServiceName: 'text'}" sortable="'ServiceName'">
- {{datacenterData.ServiceName}}
+ <td title="'Service Name'" filter="{ serviceName: 'text'}" sortable="'serviceName'">
+ {{datacenterData.vimName}}
</td>
- <td title="'Cpu(Cores)'" filter="{ Cpu: 'number'}" sortable="'Cpu'">
- {{datacenterData.Cpu}}
+ <td title="'Cpu(Cores)'" filter="{ cpu: 'number'}" sortable="'cpu'">
+ {{datacenterData.cpu}}
</td>
- <td title="'Memory(MB)'" filter="{ Memory: 'number'}" sortable="'Memory'">
- {{datacenterData.Memory}}
+ <td title="'Memory(MB)'" filter="{ memory: 'number'}" sortable="'memory'">
+ {{datacenterData.memory}}
</td>
- <td title="'HardDisk(GB)'" filter="{ HardDisk: 'number'}" sortable="'HardDisk'">
- {{datacenterData.HardDisk}}
+ <td title="'HardDisk(GB)'" filter="{ hardDisk: 'number'}" sortable="'hardDisk'">
+ {{datacenterData.hardDisk}}
</td>
<td title="'Action'">
- <span ng-click="editData(datacenterData.Id)" style="cursor: pointer;margin: 0 5px"> <img src="/openoui/framework/browser/thirdparty/images/edit.png" height="15" align="left"/></span>
- <span ng-click="deleteData(datacenterData.Id)" style="cursor: pointer;margin: 0 5px"><img src="/openoui/framework/browser/thirdparty/images/delete.png" height="15" align="middle"/></span>
+ <span ng-click="editData(datacenterData.id)" style="cursor: pointer;margin: 0 5px"> <img src="/openoui/framework/browser/thirdparty/images/edit.png" height="15" align="left"/></span>
+ <span ng-click="deleteData(datacenterData.id)" style="cursor: pointer;margin: 0 5px"><img src="/openoui/framework/browser/thirdparty/images/delete.png" height="15" align="middle"/></span>
</td>
</tr>
</table>
@@ -77,7 +77,7 @@ <button type="button" class="close" data-dismiss="modal">×</button>
<h5 class="modal-title labelstyle">Modal Header</h5>
</div>
- <form ng-submit="saveData(province.id)" name="provinceForm" method="post">
+ <form ng-submit="saveData(province.id)" name="datacenterForm" method="post">
<div class="modal-body" id="borderSpacing">
<div class="form-group row" id="rowSpacing">
@@ -85,38 +85,18 @@ <div id="Name" class="col-xs-8" >
</div>
</div>
- <!--<div class="form-group row">
- <label class="col-xs-4 col-form-label">Country</label>
- <div id="Country" class="col-xs-8" >
- </div>
- </div>-->
<div class="form-group row" id="rowSpacing">
<label class="col-xs-4 col-form-label" id="textCenter">Country</label>
<div id="Country" class="col-xs-8" >
<select id="countrydropdown" class="form-control inputfield" ng-model="datacenterData.optSelect" ng-options="item.templateName for item in optionsValue"></select>
</div>
</div>
- <div class="form-group row" id="rowSpacing">
- <label class="col-xs-4 col-form-label" id="textCenter">Status</label>
- <div id="Status" class="col-xs-8" >
- </div>
- </div>
- <!--<div class="form-group row">
- <label class="col-xs-4 col-form-label">Location</label>
- <div id="Location" class="col-xs-8" >
- </div>
- </div>-->
<div class="form-group row" id="rowSpacing">
<label class="col-xs-4 col-form-label" id="textCenter">Location</label>
<div id="Location" class="col-xs-8" >
<select id="locationdropdown" class="form-control inputfield" ng-model="datacenterData.optSelect" ng-options="item.templateName for item in optionsValue"></select>
</div>
</div>
- <!--<div class="form-group row">
- <label class="col-xs-4 col-form-label">ServiceName</label>
- <div id="ServiceName" class="col-xs-8" >
- </div>
- </div>-->
<div class="form-group row" id="rowSpacing">
<label class="col-xs-4 col-form-label" id="textCenter">ServiceName</label>
<div id="ServiceName" class="col-xs-8" >
@@ -125,17 +105,17 @@ </div>
<div class="form-group row" id="rowSpacing">
<label class="col-xs-4 col-form-label" id="textCenter">CPU(Cores)</label>
- <div id="Cpu" class="col-xs-8" >
+ <div id="" class="col-xs-8" >
</div>
</div>
<div class="form-group row" id="rowSpacing">
<label class="col-xs-4 col-form-label" id="textCenter">Memory</label>
- <div id="Memory" class="col-xs-8" >
+ <div id="" class="col-xs-8" >
</div>
</div>
<div class="form-group row" id="rowSpacing">
<label class="col-xs-4 col-form-label" id="textCenter">HardDisk</label>
- <div id="HardDisk" class="col-xs-8" >
+ <div id="" class="col-xs-8" >
</div>
</div>
diff --git a/resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenterRest.js b/resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenterRest.js index f1251569..61031eea 100644 --- a/resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenterRest.js +++ b/resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenterRest.js @@ -18,15 +18,6 @@ app.factory("datacenterDataService", function($http,DataService, $log){ uri += "/openoapi/resmgr/v1/datacenters/";
return {
getDatacenterData : function() {
- /*console.log("hi in dataservice");
- return $http({
- url: 'http://localhost:3000/datacenterAPI/getDatacenterData',
- method: 'GET',
- headers: {'Content-Type': 'application/json'}
- }).then(function(response){
- //$log.info(response);
- return response.data;
- });*/
return DataService.get(uri)
.then(function(response){
$log.info("in get data service data is :"+response);
@@ -35,17 +26,7 @@ app.factory("datacenterDataService", function($http,DataService, $log){ });
},
deleteDatacenterData : function(id) {
- /*return $http({
- url: 'http://localhost:3000/datacenterAPI/deleteDatacenterData',
- method: 'POST',
- data: {'idList':idList},
- headers: {'Content-Type': 'application/json'}
- }).then(function(response){
- console.log("Successfully Deleted..");
- $log.info(response);
- return response.data;
- });*/
- return DataService.delete(uri+"/"+id)
+ return DataService.delete(uri+id)
.then(function(response){
$log.info("in delete data service data is :"+response);
console.log(response);
@@ -69,4 +50,78 @@ app.factory("datacenterDataService", function($http,DataService, $log){ });
}
}
-});
\ No newline at end of file +});
+
+
+
+function fillCountryData() {
+
+ var requestUrl = "/openoapi/resmgr/v1/locations/country";
+ var htmlContent = "";
+ $.ajax({
+ type: "GET",
+ url: requestUrl,
+ contentType: "application/json",
+ success: function (jsonobj) {
+ var str = jsonobj.data.replace('[', '').replace(']', '').split(',')
+ $.each(str, function (n, v) {
+ htmlContent += "<option value=" + v + ">" + v + "</option>";
+ $("#countrydropdown").html(htmlContent);
+
+ });
+ },
+ error: function (xhr, ajaxOptions, thrownError) {
+ bootbox.alert("Error on getting country data : " + xhr.responseText);
+ }
+ });
+}
+
+function fillVimNameData() {
+
+ var requestUrl = "/openoapi/resmgr/v1/locations/cloudservice";
+ var htmlContent = "";
+ $.ajax({
+ type: "GET",
+ url: requestUrl,
+ contentType: "application/json",
+ success: function (jsonobj) {
+ var str = jsonobj.data.replace('[', '').replace(']', '').split(',')
+ $.each(str, function (n, v) {
+ htmlContent += "<option value='" + v + "'>" + v + "</option>";
+ $("#servicenamedropdown").html(htmlContent);
+
+ });
+ },
+ error: function (xhr, ajaxOptions, thrownError) {
+ bootbox.alert("Error on getting country data : " + xhr.responseText);
+ }
+ });
+}
+function regChangeAction(){
+ $('#countrydropdown').change(function () {
+ var country = $(this).children('option:selected').val();
+ var requestUrl = "/openoapi/resmgr/v1/locations/locationbycountry?country=" + country;
+
+ var htmlContent = "<option value=''>--select--</option>";
+ $.ajax({
+ type: "GET",
+ url: requestUrl,
+ contentType: "application/json",
+ success: function (jsonobj) {
+ console.log(jsonobj.data);
+ var str = jsonobj.data.replace('[', '').replace(']', '').split(',');
+ console.log(str);
+ $.each(str, function (n, v) {
+ htmlContent += "<option value='" + v + "'>" + v + "</option>";
+ $("#locationdropdown").html(htmlContent);
+
+ });
+
+ },
+ error: function (xhr, ajaxOptions, thrownError) {
+ bootbox.alert("Error on getting location data : " + xhr.responseText);
+ }
+ });
+
+ });
+}
\ No newline at end of file diff --git a/resmgr/src/main/webapp/resmgr/nfv-resmgr/location/location.html b/resmgr/src/main/webapp/resmgr/nfv-resmgr/location/location.html index 9c0f72eb..cafdca2c 100644 --- a/resmgr/src/main/webapp/resmgr/nfv-resmgr/location/location.html +++ b/resmgr/src/main/webapp/resmgr/nfv-resmgr/location/location.html @@ -23,32 +23,30 @@ <table ng-table="neTableParams" class="table table-bordered table-striped customtable" show-filter="true">
<tr ng-repeat="locationData in $data">
<td header="'ng-table/headers/checkbox.html'">
- <input type="checkbox" ng-model="checkboxes.items[locationData.Id]" />
+ <input type="checkbox" ng-model="checkboxes.items[locationData.id]" />
</td>
- <td title="'Id'" filter="{ Id: 'text'}" sortable="'Id'">
- {{locationData.Id}}
+ <td title="'Id'" filter="{ id: 'text'}" sortable="'id'">
+ {{locationData.id}}
</td>
- <td title="'Country'" filter="{ Country: 'text'}" sortable="'Country'">
- {{locationData.Country}}
+ <td title="'Country'" filter="{ country: 'text'}" sortable="'country'">
+ {{locationData.country}}
</td>
- <td title="'Location'" filter="{ Location: 'text'}" sortable="'Location'">
- {{locationData.Location}}
+ <td title="'Location'" filter="{ location: 'text'}" sortable="'location'">
+ {{locationData.location}}
</td>
</td>
- <td title="'Description'" filter="{ Description: 'text'}" sortable="'Description'">
- {{locationData.Description}}
+ <td title="'Description'" filter="{ description: 'text'}" sortable="'description'">
+ {{locationData.description}}
</td>
- <td title="'Latitude'" filter="{ Latitude: 'text'}" sortable="'Latitude'">
- {{locationData.Latitude}}
+ <td title="'Latitude'" filter="{ latitude: 'text'}" sortable="'latitude'">
+ {{locationData.latitude}}
</td>
- <td title="'Longitude'" filter="{ Longitude: 'text'}" sortable="'Longitude'">
- {{locationData.Longitude}}
+ <td title="'Longitude'" filter="{ longitude: 'text'}" sortable="'longitude'">
+ {{locationData.longitude}}
</td>
<td title="'Action'">
- <!--<span class="pull-right glyphicon glyphicon-edit" ng-click="editData(locationData.Id)" style="cursor: pointer;margin: 0 5px"></span>
- <span class="pull-right glyphicon glyphicon-trash" ng-click="deleteData(locationData.Id)" style="cursor: pointer;margin: 0 5px"></span>-->
- <span ng-click="editData(locationData.Id)" style="cursor: pointer;margin: 0 5px"> <img src="/openoui/framework/browser/thirdparty/images/edit.png" height="15" align="left"/></span>
- <span ng-click="deleteData(locationData.Id)" style="cursor: pointer;margin: 0 5px"><img src="/openoui/framework/browser/thirdparty/images/delete.png" height="15" align="middle"/></span>
+ <span ng-click="editData(locationData.id)" style="cursor: pointer;margin: 0 5px"> <img src="/openoui/framework/browser/thirdparty/images/edit.png" height="15" align="left"/></span>
+ <span ng-click="deleteData(locationData.id)" style="cursor: pointer;margin: 0 5px"><img src="/openoui/framework/browser/thirdparty/images/delete.png" height="15" align="middle"/></span>
</td>
</tr>
</table>
diff --git a/resmgr/src/main/webapp/resmgr/nfv-resmgr/location/locationRest.js b/resmgr/src/main/webapp/resmgr/nfv-resmgr/location/locationRest.js index 4bfb2f58..e940a588 100644 --- a/resmgr/src/main/webapp/resmgr/nfv-resmgr/location/locationRest.js +++ b/resmgr/src/main/webapp/resmgr/nfv-resmgr/location/locationRest.js @@ -45,7 +45,7 @@ app.factory("locationDataService", function($http,DataService, $log){ $log.info(response);
return response.data;
});*/
- return DataService.delete(uri+"/"+id)
+ return DataService.delete(uri+id)
.then(function(response){
$log.info("in delete data service data is :"+response);
console.log(response);
diff --git a/resmgr/src/main/webapp/resmgr/nfv-resmgr/vim/vimgraph.html b/resmgr/src/main/webapp/resmgr/nfv-resmgr/vim/vimgraph.html index badaa021..2bde05b5 100644 --- a/resmgr/src/main/webapp/resmgr/nfv-resmgr/vim/vimgraph.html +++ b/resmgr/src/main/webapp/resmgr/nfv-resmgr/vim/vimgraph.html @@ -50,7 +50,7 @@ <br>
<label style="font-size:14px;">Cpu status</label>
</div>
- <div style="width:30%;float: left;text-align:center;display: inline">
+ <div style="...">
<canvas id="memoryChart"></canvas>
<br>
<label style="font-size:14px;">Memory status</label>
|