NFVO Resource Manager pages
authorSeshu-Kumar-M <seshu.kumar.m@huawei.com>
Wed, 1 Mar 2017 08:53:12 +0000 (14:23 +0530)
committerSeshu-Kumar-M <seshu.kumar.m@huawei.com>
Wed, 1 Mar 2017 08:53:12 +0000 (14:23 +0530)
Issue-Id : CLIENT-16

Change-Id: Ib358b0e243c4d21c690d5b45d83385d02e82bde6
Signed-off-by: Seshu-Kumar-M <seshu.kumar.m@huawei.com>
resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenter.html [new file with mode: 0644]
resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenterRest.js [new file with mode: 0644]
resmgr/src/main/webapp/resmgr/nfv-resmgr/location/location.html [new file with mode: 0644]
resmgr/src/main/webapp/resmgr/nfv-resmgr/location/locationRest.js [new file with mode: 0644]
resmgr/src/main/webapp/resmgr/nfv-resmgr/vim/vim.html [new file with mode: 0644]
resmgr/src/main/webapp/resmgr/nfv-resmgr/vim/vim.js [new file with mode: 0644]

diff --git a/resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenter.html b/resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenter.html
new file mode 100644 (file)
index 0000000..91a1c19
--- /dev/null
@@ -0,0 +1,134 @@
+<!--/* Copyright 2017, Huawei Technologies Co., Ltd.\r
+*\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+*    http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+*/-->\r
+\r
+<h4>{{title}}</h4>\r
+<br>\r
+<br>\r
+<div id="datacenterAction" ng-init="init()">\r
+\r
+</div>\r
+<br><br>\r
+\r
+<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
+        </td>\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>\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>\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>\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>\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="framework/images/edit.png" height="15" align="left"/></span>\r
+            <span  ng-click="deleteData(datacenterData.Id)" style="cursor: pointer;margin: 0 5px"><img src="framework/images/delete.png" height="15" align="middle"/></span>\r
+        </td>\r
+    </tr>\r
+</table>\r
+\r
+<script type="text/ng-template" id="ng-table/headers/checkbox.html">\r
+    <input type="checkbox" ng-model="checkboxes.checked" name="filter-checkbox" value="" />\r
+</script>\r
+\r
+<div id="myTable"></div>\r
+\r
+<!-- Modal -->\r
+<div id="myModal" class="modal fade" role="dialog">\r
+    <div class="modal-dialog">\r
+\r
+        <!-- Modal content-->\r
+        <div class="modal-content">\r
+            <div class="modal-header">\r
+                <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
+                <div class="modal-body">\r
+\r
+                    <div class="form-group row">\r
+                        <label class="col-xs-4 col-form-label">Name</label>\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">\r
+                        <label class="col-xs-4 col-form-label">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">\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">\r
+                        <label class="col-xs-4 col-form-label">CPU(Cores)</label>\r
+                        <div id="Cpu" class="col-xs-8" >\r
+                        </div>\r
+                    </div>\r
+                    <div class="form-group row">\r
+                        <label class="col-xs-4 col-form-label">Memory</label>\r
+                        <div id="Memory" class="col-xs-8" >\r
+                        </div>\r
+                    </div>\r
+                    <div class="form-group row">\r
+                        <label class="col-xs-4 col-form-label">HardDisk</label>\r
+                        <div id="HardDisk" class="col-xs-8" >\r
+                        </div>\r
+                    </div>\r
+\r
+                </div>\r
+\r
+                <div id="footerBtns" class="modal-footer">\r
+\r
+                </div>\r
+            </form>\r
+        </div>\r
+\r
+\r
+    </div>\r
+</div>
\ No newline at end of file
diff --git a/resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenterRest.js b/resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenterRest.js
new file mode 100644 (file)
index 0000000..3424afe
--- /dev/null
@@ -0,0 +1,72 @@
+/* Copyright 2017, Huawei Technologies Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *    http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+app.factory("datacenterDataService", function($http,DataService, $log){\r
+    var uri = 'http://192.168.9.13:18008';\r
+    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
+                    console.log(response);\r
+                    return response;\r
+                });\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
+                .then(function(response){\r
+                    $log.info("in delete data service data is  :"+response);\r
+                    console.log(response);\r
+                    return response;\r
+                });\r
+        },\r
+        editDatacenterData : function(datacenterData) {\r
+            return DataService.put(uri, datacenterData)\r
+                .then(function(response){\r
+                    console.log("Successfully edited.. Data returned in DataService is");\r
+                    console.log(response);\r
+                    return response;\r
+                });\r
+        },\r
+        addDatacenterData : function(datacenterData) {\r
+            return DataService.post(uri, datacenterData)\r
+                .then(function(response){\r
+                    console.log("Successfully added.. Data returned in DataService is");\r
+                    console.log(response);\r
+                    return response;\r
+                });\r
+        }\r
+    }\r
+});
\ 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
new file mode 100644 (file)
index 0000000..22e1813
--- /dev/null
@@ -0,0 +1,109 @@
+<!--/* Copyright 2017, Huawei Technologies Co., Ltd.\r
+*\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+*    http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+*/-->\r
+\r
+<h4>{{title}}</h4>\r
+<br><br>\r
+<div id="locationAction" ng-init="init()">\r
+\r
+</div>\r
+<br><br>\r
+\r
+<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
+        </td>\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>\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>\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>\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="framework/images/edit.png" height="15" align="left"/></span>\r
+            <span  ng-click="deleteData(locationData.Id)" style="cursor: pointer;margin: 0 5px"><img src="framework/images/delete.png" height="15" align="middle"/></span>\r
+        </td>\r
+    </tr>\r
+</table>\r
+\r
+<script type="text/ng-template" id="ng-table/headers/checkbox.html">\r
+    <input type="checkbox" ng-model="checkboxes.checked" name="filter-checkbox" value="" />\r
+</script>\r
+\r
+<div id="myTable"></div>\r
+\r
+\r
+<!-- Modal -->\r
+<div id="myModal" class="modal fade" role="dialog">\r
+    <div class="modal-dialog">\r
+\r
+        <!-- Modal content-->\r
+        <div class="modal-content">\r
+            <div class="modal-header">\r
+                <button type="button" class="close" data-dismiss="modal">&times;</button>\r
+                <h5 class="modal-title">Modal Header</h5>\r
+            </div>\r
+            <form  name="locationForm" method="post">  <!--ng-submit="saveData(province.id)"-->\r
+                <div class="modal-body">\r
+\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">\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">\r
+                    <label class="col-xs-4 col-form-label">Latitude</label>\r
+                    <div id="Latitude" class="col-xs-8" >\r
+                    </div>\r
+                </div>\r
+                <div class="form-group row">\r
+                    <label class="col-xs-4 col-form-label">Longitude</label>\r
+                    <div id="Longitude" class="col-xs-8" >\r
+                    </div>\r
+                </div>\r
+                <div class="form-group row">\r
+                    <label class="col-xs-4 col-form-label">Description</label>\r
+                    <div id="Description" class="col-xs-8" >\r
+                    </div>\r
+                </div>\r
+\r
+                <div id="footerBtns" class="modal-footer">\r
+                </div>\r
+            </form>\r
+        </div>\r
+\r
+\r
+    </div>\r
+</div>
\ No newline at end of file
diff --git a/resmgr/src/main/webapp/resmgr/nfv-resmgr/location/locationRest.js b/resmgr/src/main/webapp/resmgr/nfv-resmgr/location/locationRest.js
new file mode 100644 (file)
index 0000000..512bf77
--- /dev/null
@@ -0,0 +1,72 @@
+/* Copyright 2017, Huawei Technologies Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *    http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+app.factory("locationDataService", function($http,DataService, $log){\r
+    var uri = 'http://192.168.9.13:18008';\r
+    uri += "/openoapi/resmgr/v1/locations/";\r
+    return {\r
+        getLocationData : function() {\r
+            /*console.log("hi in dataservice");\r
+            return $http({\r
+                url: 'http://localhost:3000/locationAPI/getLocationData',\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
+                    console.log(response);\r
+                    return response;\r
+                });\r
+        },\r
+        deleteLocationData : function(id) {\r
+            /*return $http({\r
+                url: 'http://localhost:3000/locationAPI/deleteLocationData',\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
+                .then(function(response){\r
+                    $log.info("in delete data service data is  :"+response);\r
+                    console.log(response);\r
+                    return response;\r
+                });\r
+        },\r
+        editLocationData : function(locationData) {\r
+            return DataService.put(uri, locationData)\r
+                .then(function(response){\r
+                    console.log("Successfully edited.. Data returned in DataService is");\r
+                    console.log(response);\r
+                    return response;\r
+                });\r
+        },\r
+        addLocationData : function(locationData) {\r
+            return DataService.post(uri, locationData)\r
+                .then(function(response){\r
+                    console.log("Successfully added.. Data returned in DataService is");\r
+                    console.log(response);\r
+                    return response;\r
+                });\r
+        }\r
+    }\r
+});
\ No newline at end of file
diff --git a/resmgr/src/main/webapp/resmgr/nfv-resmgr/vim/vim.html b/resmgr/src/main/webapp/resmgr/nfv-resmgr/vim/vim.html
new file mode 100644 (file)
index 0000000..9985552
--- /dev/null
@@ -0,0 +1,69 @@
+<!--
+    Copyright 2017, Huawei Technologies Co., Ltd.
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+            http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<!DOCTYPE html>
+<html>
+<head>
+    <head lang="en">
+        <meta charset="UTF-8">
+        <title></title>
+        <link href="css/bootstrap.min.css" rel="stylesheet"/>
+        <link href="css/VMMain.css" rel="stylesheet"/>
+        <link href="css/bootstrap-table.min.css" rel="stylesheet"/>
+
+        <script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
+        <script type="text/javascript" src="js/bootstrap.min.js"></script>
+        <script type="text/javascript" src="js/bootstrap-table.min.js"></script>
+        <script type="text/javascript" src="js/bootbox.min.js"></script>
+        <script type="text/javascript" src="js/jquery.validate.min.js"></script>
+        <script type="text/javascript" src="js/chart.min.js"></script>
+
+               <script type="text/javascript" src="js/gconf.js"></script>
+        <script type="text/javascript" src="js/vim.js"></script>
+
+        <style type="text/css">
+        </style>
+
+    </head>
+<body id="open_base_site_cotentBody" class="cotentBody ng-scope">
+
+<div class="container-fluid ms-controller">
+    <br>
+    <div style="font-size:18px">resource using status:</div>
+    <hr>
+    <!-- chart area -->
+    <div style="width:30%;float: left;text-align:center;display: inline">
+        <canvas id="cpuChart"></canvas>
+        <br>
+        <label style="font-size:14px;">Cpu status</label>
+    </div>
+    <div style="width:30%;float: left;text-align:center;display: inline">
+        <canvas id="memoryChart"></canvas>
+        <br>
+        <label style="font-size:14px;">Memory status</label>
+    </div>
+    <div style="width:30%;float: left;text-align:center;display: inline">
+        <canvas id="diskChart"></canvas>
+        <br>
+        <label style="font-size:14px;">Disk status</label>
+    </div>
+    <script type="text/javascript">
+
+
+    </script>
+</div>
+</body>
+</html>
\ No newline at end of file
diff --git a/resmgr/src/main/webapp/resmgr/nfv-resmgr/vim/vim.js b/resmgr/src/main/webapp/resmgr/nfv-resmgr/vim/vim.js
new file mode 100644 (file)
index 0000000..ec5fb46
--- /dev/null
@@ -0,0 +1,93 @@
+/* Copyright 2017, Huawei Technologies Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+function loadVimData() {
+    var requestUrl = app_url+"/v1/resmanage/vim/vimInfo";
+    $.ajax({
+        type: "GET",
+        url: requestUrl,
+        contentType: "application/json",
+        success: function (jsonobj) {
+            printCharts(jsonobj.data[0].used.cpu,
+                jsonobj.data[0].total.cpu, jsonobj.data[0].used.memory, jsonobj.data[0].total.memory, jsonobj.data[0].used.disk, jsonobj.data[0].total.disk);
+
+        },
+        error: function (xhr, ajaxOptions, thrownError) {
+            bootbox.alert("Error on getting data (here display the test data) : " + xhr.responseText);
+            printCharts(11, 12, 21, 22, 31, 32);
+        }
+    });
+}
+function printCharts(v11, v12, v21, v22, v31, v32) {
+    var cpuChart = new Chart($("#cpuChart"), {
+        type: 'doughnut',
+        data: {
+            labels: ["used", "available"],
+            datasets: [{
+                data: [v11, v12],
+                backgroundColor: ["#FFCE56", "#36A2EB"],
+                hoverBackgroundColor: ["#FFCE56", "#36A2EB"]
+            }]
+        },
+        options: {
+            animation: {
+                animateScale: true,
+                animateRotate: true
+
+            }
+        }
+    });
+    var memoryChart = new Chart($("#memoryChart"), {
+        type: 'doughnut',
+        data: {
+            labels: ["used", "available"],
+            datasets: [{
+                data: [v21, v22],
+                backgroundColor: ["#FF6384", "#36A2EB"],
+                hoverBackgroundColor: ["#FF6384", "#36A2EB"]
+            }]
+        },
+        options: {
+
+            animation: {
+                animateScale: true,
+                animateRotate: true
+
+            }
+        }
+    });
+    var diskChart = new Chart($("#diskChart"), {
+        type: 'doughnut',
+        data: {
+            labels: ["used", "available"],
+            datasets: [{
+                data: [v31, v32],
+                backgroundColor: ["#FF6384", "green"],
+                hoverBackgroundColor: ["#FF6384", "green"]
+            }]
+        },
+        options: {
+            animation: {
+                animateScale: true,
+                animateRotate: true
+
+            }
+        }
+    });
+}
+
+$(function () {
+    loadVimData();
+
+})
\ No newline at end of file