modify resmgr-nfv
authorQuan-Zhong <quanzhong@huawei.com>
Fri, 21 Apr 2017 02:54:24 +0000 (10:54 +0800)
committerQuan-Zhong <quanzhong@huawei.com>
Fri, 21 Apr 2017 02:54:24 +0000 (10:54 +0800)
NFVO-171

Change-Id: Iab216c4009ab4c4c78107bad1f34016afe4334d6
Signed-off-by: Quan-Zhong <quanzhong@huawei.com>
resmgr/src/main/webapp/resmgr/js/app.js
resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenter.html
resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenterRest.js
resmgr/src/main/webapp/resmgr/nfv-resmgr/location/location.html
resmgr/src/main/webapp/resmgr/nfv-resmgr/location/locationRest.js
resmgr/src/main/webapp/resmgr/nfv-resmgr/vim/vimgraph.html

index aea4a20..b8d5cb1 100644 (file)
@@ -643,8 +643,8 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
         $scope.init = function() {\r
             locationDataService.getLocationData()\r
                 .then(function (data) {\r
-                    $scope.data = data;\r
-                    console.log("Data: ");\r
+                    $scope.data = data.locations;\r
+                    console.log(JSON.stringify($scope.data));\r
                     $log.info(data);\r
                     loadButtons();\r
                 }, function (reason) {\r
@@ -665,7 +665,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
             $('#locationAction').html($compile(addhtml)($scope));\r
             $('#locationAction').append($compile(deletehtml)($scope));\r
 \r
-            var modelSubmit_data = {"title":"OK", "clickAction":"saveData(loc.Id)"};\r
+            var modelSubmit_data = {"title":"OK", "clickAction":"saveData(loc.id)"};\r
             var modelSubmit_html = Mustache.to_html(def_button_tpl, modelSubmit_data);\r
             $('#myModal #footerBtns').html($compile(modelSubmit_html)($scope));\r
 \r
@@ -678,34 +678,34 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
             var ipv4 = $(modelTemplate).filter('#ipv4').html();\r
             var number = $(modelTemplate).filter('#numeric').html();\r
 \r
-            var locId = {"ErrMsg" :     {"errmsg" : "Name is required.", "modalVar":"loc.Id", "errtag":"textboxErrId", "errfunc":"validatetextboxId"}};\r
+            var locId = {"ErrMsg" :     {"errmsg" : "Name is required.", "modalVar":"loc.id", "errtag":"textboxErrId", "errfunc":"validatetextboxId"}};\r
             $('#myModal #Name').append($compile(Mustache.to_html(text, locId.ErrMsg))($scope));\r
 \r
-            var locCountry = {"ErrMsg" :     {"errmsg" : "Country is required.", "modalVar":"loc.Country", "errtag":"textboxErrCountry", "errfunc":"validatetextboxCountry","required":true}};\r
+            var locCountry = {"ErrMsg" :     {"errmsg" : "Country is required.", "modalVar":"loc.country", "errtag":"textboxErrCountry", "errfunc":"validatetextboxCountry","required":true}};\r
             $('#myModal #Country').append($compile(Mustache.to_html(text, locCountry.ErrMsg))($scope));\r
 \r
-            var locLocation = {"ErrMsg" :     {"errmsg" : "Location is required.", "modalVar":"loc.Location", "errtag":"textboxErrLocation", "errfunc":"validatetextboxLocation","required":true}};\r
+            var locLocation = {"ErrMsg" :     {"errmsg" : "Location is required.", "modalVar":"loc.location", "errtag":"textboxErrLocation", "errfunc":"validatetextboxLocation","required":true}};\r
             $('#myModal #Location').append($compile(Mustache.to_html(text, locLocation.ErrMsg))($scope));\r
 \r
-            var locDescription = {"ErrMsg" :     {"errmsg" : "The name is required.", "modalVar":"loc.Description", "errtag":"textboxErr", "errfunc":"validatetextbox"}};\r
+            var locDescription = {"ErrMsg" :     {"errmsg" : "The name is required.", "modalVar":"loc.description", "errtag":"textboxErr", "errfunc":"validatetextbox"}};\r
             $('#myModal #Description').append($compile(Mustache.to_html(text, locDescription.ErrMsg))($scope));\r
 \r
-            var locLatitude = {"ErrMsg" :     {"errmsg" : "Latitude is required.", "modalVar":"loc.Latitude", "errtag":"textboxErrLatitude", "errfunc":"validatetextboxLatitude", "required":true}};\r
+            var locLatitude = {"ErrMsg" :     {"errmsg" : "Latitude is required.", "modalVar":"loc.latitude", "errtag":"textboxErrLatitude", "errfunc":"validatetextboxLatitude", "required":true}};\r
             $('#myModal #Latitude').append($compile(Mustache.to_html(text, locLatitude.ErrMsg))($scope));\r
 \r
-            var locLongitude = {"ErrMsg" :     {"errmsg" : "Longitude is required.", "modalVar":"loc.Longitude", "errtag":"textboxErrLongitude", "errfunc":"validatetextboxLongitude", "required":true}};\r
+            var locLongitude = {"ErrMsg" :     {"errmsg" : "Longitude is required.", "modalVar":"loc.longitude", "errtag":"textboxErrLongitude", "errfunc":"validatetextboxLongitude", "required":true}};\r
             $('#myModal #Longitude').append($compile(Mustache.to_html(text, locLongitude.ErrMsg))($scope));\r
 \r
             $scope.checkboxes = { 'checked': false, items: {} };\r
 \r
-            $scope.neTableParams = new NgTableParams({count: 5, sorting: {Id: 'asc'}    //{page: 1,count: 10,filter: {name: 'M'},sorting: {name: 'desc'}\r
-            }, { counts:[5, 10, 20, 50], dataset: $scope.data.locationData});\r
+            $scope.neTableParams = new NgTableParams({count: 5, sorting: {Id: 'asc'}    \r
+            }, { counts:[5, 10, 20, 50], dataset: $scope.data});\r
 \r
             $scope.$watch('checkboxes.checked', function(value) {\r
                 $scope.checkboxes.items = {};\r
                 angular.forEach($scope.neTableParams.data, function(item) {\r
-                    if (angular.isDefined(item.Id)) {\r
-                        $scope.checkboxes.items[item.Id] = value;\r
+                    if (angular.isDefined(item.id)) {\r
+                        $scope.checkboxes.items[item.id] = value;\r
                     }\r
                 });\r
             });\r
@@ -713,7 +713,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
         }\r
 \r
         $scope.validatetextboxCountry = function (value){\r
-            if($scope.loc.Country) {\r
+            if($scope.loc.country) {\r
                 $scope.textboxErrCountry = false;\r
             }\r
             else\r
@@ -721,7 +721,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
         }\r
 \r
         $scope.validatetextboxLocation = function (value){\r
-            if($scope.loc.Location) {\r
+            if($scope.loc.location) {\r
                 $scope.textboxErrLocation = false;\r
             }\r
             else\r
@@ -729,7 +729,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
         }\r
 \r
         $scope.validatetextboxLatitude = function (value){\r
-            if($scope.loc.Latitude) {\r
+            if($scope.loc.latitude) {\r
                 $scope.textboxErrLatitude = false;\r
             }\r
             else\r
@@ -737,7 +737,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
         }\r
 \r
         $scope.validatetextboxLongitude = function (value){\r
-            if($scope.loc.Longitude) {\r
+            if($scope.loc.longitude) {\r
                 $scope.textboxErrLongitude = false;\r
             }\r
             else\r
@@ -771,7 +771,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
             if (!$scope.textboxErrLocation && !$scope.textboxErrCountry && !$scope.textboxErrLatitude && !$scope.textboxErrLongitude) {\r
                                \r
                                var locs = {}\r
-                                       locs.location = $scope.loc\r
+                                       locs = $scope.loc\r
                 if(id) {\r
                                        \r
                                        \r
@@ -861,10 +861,10 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
         $scope.editData = function(id) {\r
             console.log("To be edited : " + id);\r
             var dataFound = false;\r
-            angular.forEach($scope.data.locationData, function(data) {\r
+            angular.forEach($scope.data, function(data) {\r
                 if(!dataFound) {\r
-                    if (data.Id == id) {\r
-                        console.log("Found : " + data.Id);\r
+                    if (data.id == id) {\r
+                        console.log("Found : " + data.id);\r
                         $scope.loc = data;\r
                         $("#myModal").modal();\r
                         dataFound = true;\r
@@ -1205,9 +1205,9 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
 \r
             $('#myModal #controller').append($compile(Mustache.to_html(dropDown, dropSimple_data))($scope));*/\r
                        \r
-                       /*var dropdownResponse=[{"serviceTemplateId":"meCtrl","templateName":"mecontroller1"},{"serviceTemplateId":"meCtrl2","templateName":"mecontroller"}];\r
+                       var dropdownResponse=[{"serviceTemplateId":"meCtrl","templateName":"mecontroller1"},{"serviceTemplateId":"meCtrl2","templateName":"mecontroller"}];\r
                        var dropdownInfo = translateToDropdownInfo(dropdownResponse);\r
-            document.getElementById("medropdown").innerHTML = dropdownInfo;*/\r
+            document.getElementById("medropdown").innerHTML = dropdownInfo;\r
 \r
 \r
             neDataService.getNECtrlDDList()\r
@@ -1476,7 +1476,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
         $scope.init = function() {\r
             datacenterDataService.getDatacenterData()\r
                 .then(function (data) {\r
-                    $scope.data = data;\r
+                    $scope.data = data.datacenters;\r
                     console.log("Data: ");\r
                     $log.info(data);\r
                     loadButtons();\r
@@ -1498,7 +1498,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
             $('#datacenterAction').html($compile(addhtml)($scope));\r
             $('#datacenterAction').append($compile(deletehtml)($scope));\r
 \r
-            var modelSubmit_data = {"title":"OK", "clickAction":"saveData(datacenter.Id)"};\r
+            var modelSubmit_data = {"title":"OK", "clickAction":"saveData(datacenter.id)"};\r
             var modelSubmit_html = Mustache.to_html(def_button_tpl, modelSubmit_data);\r
             $('#myModal #footerBtns').html($compile(modelSubmit_html)($scope));\r
 \r
@@ -1511,10 +1511,10 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
             var number = $(modelTemplate).filter('#numeric').html();\r
             var dropDown = $(modelTemplate).filter('#simpleDropdownTmpl').html();\r
 \r
-            var dataId = {"ErrMsg" :     {"textboxErr" : "The name is required.", "modalVar":"datacenter.Id"}};\r
+            var dataId = {"ErrMsg" :     {"textboxErr" : "The name is required.", "modalVar":"datacenter.id"}};\r
             $('#myModal #Id').append($compile(Mustache.to_html(text, dataId.ErrMsg))($scope));\r
 \r
-            var dataName = {"ErrMsg" :     {"errmsg" : "The name is required.", "modalVar":"datacenter.Name","errtag":"textboxErr", "errfunc":"validatetextbox","required":true}};\r
+            var dataName = {"ErrMsg" :     {"errmsg" : "The name is required.", "modalVar":"datacenter.name","errtag":"textboxErr", "errfunc":"validatetextbox","required":true}};\r
             $('#myModal #Name').append($compile(Mustache.to_html(text, dataName.ErrMsg))($scope));\r
 \r
             var dataStatus = {"ErrMsg" :     {"textboxErr" : "The name is required.", "modalVar":"datacenter.Status"}};\r
@@ -1559,30 +1559,35 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
             var dropdownInfo = translateToDropdownInfo(dropdownResponse);\r
             document.getElementById("servicenamedropdown").innerHTML = dropdownInfo;\r
 \r
-            var dataCPU = {"ErrMsg" :     {"textboxErr" : "The name is required.", "modalVar":"datacenter.Cpu"}};\r
+            var dataCPU = {"ErrMsg" :     {"textboxErr" : "The name is required.", "modalVar":"datacenter.cpu"}};\r
             $('#myModal #Cpu').append($compile(Mustache.to_html(text, dataCPU.ErrMsg))($scope));\r
 \r
-            var dataMemory = {"ErrMsg" :     {"textboxErr" : "The name is required.", "modalVar":"datacenter.Memory"}};\r
+            var dataMemory = {"ErrMsg" :     {"textboxErr" : "The name is required.", "modalVar":"datacenter.memory"}};\r
             $('#myModal #Memory').append($compile(Mustache.to_html(text, dataMemory.ErrMsg))($scope));\r
 \r
-            var dataHarddisk = {"ErrMsg" :     {"textboxErr" : "The name is required.", "modalVar":"datacenter.HardDisk"}};\r
+            var dataHarddisk = {"ErrMsg" :     {"textboxErr" : "The name is required.", "modalVar":"datacenter.hardDisk"}};\r
             $('#myModal #HardDisk').append($compile(Mustache.to_html(text, dataHarddisk.ErrMsg))($scope));\r
 \r
             $scope.checkboxes = { 'checked': false, items: {} };\r
 \r
-            $scope.neTableParams = new NgTableParams({count: 5, sorting: {Id: 'asc'}    //{page: 1,count: 10,filter: {name: 'M'},sorting: {name: 'desc'}\r
-            }, { counts:[5, 10, 20, 50], dataset: $scope.data.datacenterData});\r
+            $scope.neTableParams = new NgTableParams({count: 5, sorting: {Id: 'asc'}  \r
+            }, { counts:[5, 10, 20, 50], dataset: $scope.data});\r
 \r
             $scope.$watch('checkboxes.checked', function(value) {\r
                 $scope.checkboxes.items = {};\r
 \r
                 angular.forEach($scope.neTableParams.data, function(item) {\r
                                        \r
-                    if (angular.isDefined(item.Id)) {\r
-                        $scope.checkboxes.items[item.Id] = value;\r
+                    if (angular.isDefined(item.id)) {\r
+                        $scope.checkboxes.items[item.id] = value;\r
                     }\r
                 });\r
             });\r
+                       \r
+                       //action\r
+                       fillCountryData();\r
+                       fillVimNameData();\r
+                       regChangeAction();\r
 \r
         }\r
                \r
@@ -1597,7 +1602,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
         }\r
 \r
         $scope.validatetextbox = function (value){\r
-            if($scope.datacenter.Name) {\r
+            if($scope.datacenter.name) {\r
                 $scope.textboxErr = false;\r
             }\r
             else\r
@@ -1628,7 +1633,10 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
             if (!$scope.textboxErr) {\r
                                \r
                                var dcs = {}\r
-                               dcs.dc =        $scope.datacenter;\r
+                               dcs =   $scope.datacenter;\r
+                               $scope.datacenter.vimName = $("#servicenamedropdown").val();\r
+                               $scope.datacenter.location = $("#locationdropdown").val();\r
+                               $scope.datacenter.country = $("#countrydropdown").val();\r
                 if(id) {\r
                     //edit data\r
                     console.log("Editing data.." + JSON.stringify(dcs));\r
@@ -1716,9 +1724,9 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"])
         $scope.editData = function(id) {\r
             console.log("To be edited : " + id);\r
             var dataFound = false;\r
-            angular.forEach($scope.data.datacenterData, function(data) {\r
+            angular.forEach($scope.data, function(data) {\r
                 if(!dataFound) {\r
-                    if (data.Id == id) {\r
+                    if (data.id == id) {\r
                         console.log("Found : " + data.id);\r
                         $scope.datacenter = data;\r
                         $("#myModal").modal();\r
index a2caf0a..be46fbe 100644 (file)
 <table ng-table="neTableParams" class="table table-bordered table-striped" show-filter="true">\r
     <tr ng-repeat="datacenterData in $data">\r
         <td header="'ng-table/headers/checkbox.html'">\r
-            <input type="checkbox" ng-model="checkboxes.items[datacenterData.Id]" />\r
+            <input type="checkbox" ng-model="checkboxes.items[datacenterData.id]" />\r
         </td>\r
-        <td title="'Id'" filter="{ Id: 'text'}" sortable="'Id'">\r
-            {{datacenterData.Id}}\r
+        <td title="'Id'" filter="{ id: 'text'}" sortable="'id'">\r
+            {{datacenterData.id}}\r
         </td>\r
-        <td title="'Name'" filter="{ Name: 'number'}" sortable="'Name'">\r
-            {{datacenterData.Name}}\r
+        <td title="'Name'" filter="{ name: 'number'}" sortable="'name'">\r
+            {{datacenterData.name}}\r
         </td>\r
-        <td title="'Status'" filter="{ Status: 'text'}" sortable="'Status'">\r
-            {{datacenterData.Status}}\r
+        <td title="'Status'" filter="{ status: 'text'}" sortable="'status'">\r
+            {{datacenterData.status}}\r
         </td>\r
         </td>\r
-        <td title="'Country'" filter="{ Country: 'text'}" sortable="'Country'">\r
-            {{datacenterData.Country}}\r
+        <td title="'Country'" filter="{ country: 'text'}" sortable="'country'">\r
+            {{datacenterData.country}}\r
         </td>\r
-        <td title="'Location'" filter="{ Location: 'text'}" sortable="'Location'">\r
-            {{datacenterData.Location}}\r
+        <td title="'Location'" filter="{ location: 'text'}" sortable="'location'">\r
+            {{datacenterData.location}}\r
         </td>\r
-        <td title="'Service Name'" filter="{ ServiceName: 'text'}" sortable="'ServiceName'">\r
-            {{datacenterData.ServiceName}}\r
+        <td title="'Service Name'" filter="{ serviceName: 'text'}" sortable="'serviceName'">\r
+            {{datacenterData.vimName}}\r
         </td>\r
-        <td title="'Cpu(Cores)'" filter="{ Cpu: 'number'}" sortable="'Cpu'">\r
-            {{datacenterData.Cpu}}\r
+        <td title="'Cpu(Cores)'" filter="{ cpu: 'number'}" sortable="'cpu'">\r
+            {{datacenterData.cpu}}\r
         </td>\r
-        <td title="'Memory(MB)'" filter="{ Memory: 'number'}" sortable="'Memory'">\r
-            {{datacenterData.Memory}}\r
+        <td title="'Memory(MB)'" filter="{ memory: 'number'}" sortable="'memory'">\r
+            {{datacenterData.memory}}\r
         </td>\r
-        <td title="'HardDisk(GB)'" filter="{ HardDisk: 'number'}" sortable="'HardDisk'">\r
-            {{datacenterData.HardDisk}}\r
+        <td title="'HardDisk(GB)'" filter="{ hardDisk: 'number'}" sortable="'hardDisk'">\r
+            {{datacenterData.hardDisk}}\r
         </td>\r
         <td title="'Action'">\r
-            <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>\r
-            <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>\r
+            <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>\r
+            <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>\r
         </td>\r
     </tr>\r
 </table>\r
@@ -77,7 +77,7 @@
                 <button type="button" class="close" data-dismiss="modal">&times;</button>\r
                 <h5 class="modal-title labelstyle">Modal Header</h5>\r
             </div>\r
-            <form ng-submit="saveData(province.id)" name="provinceForm" method="post">\r
+            <form ng-submit="saveData(province.id)" name="datacenterForm" method="post">\r
                 <div class="modal-body" id="borderSpacing">\r
 \r
                     <div class="form-group row" id="rowSpacing">\r
                         <div id="Name" class="col-xs-8" >\r
                         </div>\r
                     </div>\r
-                    <!--<div class="form-group row">\r
-                        <label class="col-xs-4 col-form-label">Country</label>\r
-                        <div id="Country" class="col-xs-8" >\r
-                        </div>\r
-                    </div>-->\r
                                        <div class="form-group row" id="rowSpacing">\r
                         <label class="col-xs-4 col-form-label" id="textCenter">Country</label>\r
                         <div id="Country" class="col-xs-8" >\r
                             <select id="countrydropdown" class="form-control inputfield" ng-model="datacenterData.optSelect" ng-options="item.templateName for item in optionsValue"></select>\r
                         </div>\r
                     </div>\r
-                    <div class="form-group row" id="rowSpacing">\r
-                        <label class="col-xs-4 col-form-label" id="textCenter">Status</label>\r
-                        <div id="Status" class="col-xs-8" >\r
-                        </div>\r
-                    </div>\r
-                    <!--<div class="form-group row">\r
-                        <label class="col-xs-4 col-form-label">Location</label>\r
-                        <div id="Location" class="col-xs-8" >\r
-                        </div>\r
-                    </div>-->\r
                                        <div class="form-group row" id="rowSpacing">\r
                         <label class="col-xs-4 col-form-label" id="textCenter">Location</label>\r
                         <div id="Location" class="col-xs-8" >\r
                             <select id="locationdropdown" class="form-control inputfield" ng-model="datacenterData.optSelect" ng-options="item.templateName for item in optionsValue"></select>\r
                         </div>\r
                     </div>\r
-                    <!--<div class="form-group row">\r
-                        <label class="col-xs-4 col-form-label">ServiceName</label>\r
-                        <div id="ServiceName" class="col-xs-8" >\r
-                        </div>\r
-                    </div>-->\r
                                        <div class="form-group row" id="rowSpacing">\r
                         <label class="col-xs-4 col-form-label" id="textCenter">ServiceName</label>\r
                         <div id="ServiceName" class="col-xs-8" >\r
                     </div>\r
                     <div class="form-group row" id="rowSpacing">\r
                         <label class="col-xs-4 col-form-label" id="textCenter">CPU(Cores)</label>\r
-                        <div id="Cpu" class="col-xs-8" >\r
+                        <div id="" class="col-xs-8" >\r
                         </div>\r
                     </div>\r
                     <div class="form-group row" id="rowSpacing">\r
                         <label class="col-xs-4 col-form-label" id="textCenter">Memory</label>\r
-                        <div id="Memory" class="col-xs-8" >\r
+                        <div id="" class="col-xs-8" >\r
                         </div>\r
                     </div>\r
                     <div class="form-group row" id="rowSpacing">\r
                         <label class="col-xs-4 col-form-label" id="textCenter">HardDisk</label>\r
-                        <div id="HardDisk" class="col-xs-8" >\r
+                        <div id="" class="col-xs-8" >\r
                         </div>\r
                     </div>\r
 \r
index f125156..61031ee 100644 (file)
@@ -18,15 +18,6 @@ app.factory("datacenterDataService", function($http,DataService, $log){
     uri += "/openoapi/resmgr/v1/datacenters/";\r
     return {\r
         getDatacenterData : function() {\r
-            /*console.log("hi in dataservice");\r
-            return $http({\r
-                url: 'http://localhost:3000/datacenterAPI/getDatacenterData',\r
-                method: 'GET',\r
-                headers: {'Content-Type': 'application/json'}\r
-            }).then(function(response){\r
-                //$log.info(response);\r
-                return response.data;\r
-            });*/\r
             return DataService.get(uri)\r
                 .then(function(response){\r
                     $log.info("in get data service data is  :"+response);\r
@@ -35,17 +26,7 @@ app.factory("datacenterDataService", function($http,DataService, $log){
                 });\r
         },\r
         deleteDatacenterData : function(id) {\r
-            /*return $http({\r
-                url: 'http://localhost:3000/datacenterAPI/deleteDatacenterData',\r
-                method: 'POST',\r
-                data: {'idList':idList},\r
-                headers: {'Content-Type': 'application/json'}\r
-            }).then(function(response){\r
-                console.log("Successfully Deleted..");\r
-                $log.info(response);\r
-                return response.data;\r
-            });*/\r
-            return DataService.delete(uri+"/"+id)\r
+            return DataService.delete(uri+id)\r
                 .then(function(response){\r
                     $log.info("in delete data service data is  :"+response);\r
                     console.log(response);\r
@@ -69,4 +50,78 @@ app.factory("datacenterDataService", function($http,DataService, $log){
                 });\r
         }\r
     }\r
-});
\ No newline at end of file
+});\r
+\r
+\r
+\r
+function fillCountryData() {\r
+\r
+    var requestUrl = "/openoapi/resmgr/v1/locations/country";\r
+    var htmlContent = "";\r
+    $.ajax({\r
+        type: "GET",\r
+        url: requestUrl,\r
+        contentType: "application/json",\r
+        success: function (jsonobj) {\r
+            var str = jsonobj.data.replace('[', '').replace(']', '').split(',')\r
+            $.each(str, function (n, v) {\r
+                htmlContent += "<option value=" + v + ">" + v + "</option>";\r
+                $("#countrydropdown").html(htmlContent);\r
+\r
+            });\r
+        },\r
+        error: function (xhr, ajaxOptions, thrownError) {\r
+            bootbox.alert("Error on getting country data : " + xhr.responseText);\r
+        }\r
+    });\r
+}\r
+\r
+function fillVimNameData() {\r
+\r
+    var requestUrl = "/openoapi/resmgr/v1/locations/cloudservice";\r
+    var htmlContent = "";\r
+    $.ajax({\r
+        type: "GET",\r
+        url: requestUrl,\r
+        contentType: "application/json",\r
+        success: function (jsonobj) {\r
+            var str = jsonobj.data.replace('[', '').replace(']', '').split(',')\r
+            $.each(str, function (n, v) {\r
+                htmlContent += "<option value='" + v + "'>" + v + "</option>";\r
+                $("#servicenamedropdown").html(htmlContent);\r
+\r
+            });\r
+        },\r
+        error: function (xhr, ajaxOptions, thrownError) {\r
+            bootbox.alert("Error on getting country data : " + xhr.responseText);\r
+        }\r
+    });\r
+}\r
+function regChangeAction(){\r
+         $('#countrydropdown').change(function () {\r
+        var country = $(this).children('option:selected').val();\r
+        var requestUrl = "/openoapi/resmgr/v1/locations/locationbycountry?country=" + country;\r
+\r
+        var htmlContent = "<option value=''>--select--</option>";\r
+        $.ajax({\r
+            type: "GET",\r
+            url: requestUrl,\r
+            contentType: "application/json",\r
+            success: function (jsonobj) {\r
+                               console.log(jsonobj.data);\r
+                                  var str = jsonobj.data.replace('[', '').replace(']', '').split(',');\r
+                                  console.log(str);\r
+                $.each(str, function (n, v) {\r
+                    htmlContent += "<option value='" + v + "'>" + v + "</option>";\r
+                    $("#locationdropdown").html(htmlContent);\r
+\r
+                });\r
+\r
+            },\r
+            error: function (xhr, ajaxOptions, thrownError) {\r
+                bootbox.alert("Error on getting location data : " + xhr.responseText);\r
+            }\r
+        });\r
+\r
+    });\r
+}
\ No newline at end of file
index 9c0f72e..cafdca2 100644 (file)
 <table ng-table="neTableParams" class="table table-bordered table-striped customtable" show-filter="true">\r
     <tr ng-repeat="locationData in $data">\r
         <td header="'ng-table/headers/checkbox.html'">\r
-            <input type="checkbox" ng-model="checkboxes.items[locationData.Id]" />\r
+            <input type="checkbox" ng-model="checkboxes.items[locationData.id]" />\r
         </td>\r
-        <td title="'Id'" filter="{ Id: 'text'}" sortable="'Id'">\r
-            {{locationData.Id}}\r
+        <td title="'Id'" filter="{ id: 'text'}" sortable="'id'">\r
+            {{locationData.id}}\r
         </td>\r
-        <td title="'Country'" filter="{ Country: 'text'}" sortable="'Country'">\r
-            {{locationData.Country}}\r
+        <td title="'Country'" filter="{ country: 'text'}" sortable="'country'">\r
+            {{locationData.country}}\r
         </td>\r
-        <td title="'Location'" filter="{ Location: 'text'}" sortable="'Location'">\r
-            {{locationData.Location}}\r
+        <td title="'Location'" filter="{ location: 'text'}" sortable="'location'">\r
+            {{locationData.location}}\r
         </td>\r
         </td>\r
-        <td title="'Description'" filter="{ Description: 'text'}" sortable="'Description'">\r
-            {{locationData.Description}}\r
+        <td title="'Description'" filter="{ description: 'text'}" sortable="'description'">\r
+            {{locationData.description}}\r
         </td>\r
-        <td title="'Latitude'" filter="{ Latitude: 'text'}" sortable="'Latitude'">\r
-            {{locationData.Latitude}}\r
+        <td title="'Latitude'" filter="{ latitude: 'text'}" sortable="'latitude'">\r
+            {{locationData.latitude}}\r
         </td>\r
-        <td title="'Longitude'" filter="{ Longitude: 'text'}" sortable="'Longitude'">\r
-            {{locationData.Longitude}}\r
+        <td title="'Longitude'" filter="{ longitude: 'text'}" sortable="'longitude'">\r
+            {{locationData.longitude}}\r
         </td>\r
         <td title="'Action'">\r
-            <!--<span class="pull-right glyphicon glyphicon-edit" ng-click="editData(locationData.Id)" style="cursor: pointer;margin: 0 5px"></span>\r
-            <span class="pull-right glyphicon glyphicon-trash" ng-click="deleteData(locationData.Id)" style="cursor: pointer;margin: 0 5px"></span>-->\r
-            <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>\r
-            <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>\r
+            <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>\r
+            <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>\r
         </td>\r
     </tr>\r
 </table>\r
index 4bfb2f5..e940a58 100644 (file)
@@ -45,7 +45,7 @@ app.factory("locationDataService", function($http,DataService, $log){
                 $log.info(response);\r
                 return response.data;\r
             });*/\r
-            return DataService.delete(uri+"/"+id)\r
+            return DataService.delete(uri+id)\r
                 .then(function(response){\r
                     $log.info("in delete data service data is  :"+response);\r
                     console.log(response);\r
index badaa02..2bde05b 100644 (file)
@@ -50,7 +50,7 @@
         <br>\r
         <label style="font-size:14px;">Cpu status</label>\r
     </div>\r
-    <div style="width:30%;float: left;text-align:center;display: inline">\r
+    <div style="...">\r
         <canvas id="memoryChart"></canvas>\r
         <br>\r
         <label style="font-size:14px;">Memory status</label>\r