aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenter.html134
-rw-r--r--resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenterRest.js72
-rw-r--r--resmgr/src/main/webapp/resmgr/nfv-resmgr/location/location.html109
-rw-r--r--resmgr/src/main/webapp/resmgr/nfv-resmgr/location/locationRest.js72
-rw-r--r--resmgr/src/main/webapp/resmgr/nfv-resmgr/vim/vim.html69
-rw-r--r--resmgr/src/main/webapp/resmgr/nfv-resmgr/vim/vim.js93
6 files changed, 549 insertions, 0 deletions
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
index 00000000..91a1c191
--- /dev/null
+++ b/resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenter.html
@@ -0,0 +1,134 @@
+<!--/* 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.
+*/-->
+
+<h4>{{title}}</h4>
+<br>
+<br>
+<div id="datacenterAction" ng-init="init()">
+
+</div>
+<br><br>
+
+<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]" />
+ </td>
+ <td title="'Id'" filter="{ Id: 'text'}" sortable="'Id'">
+ {{datacenterData.Id}}
+ </td>
+ <td title="'Name'" filter="{ Name: 'number'}" sortable="'Name'">
+ {{datacenterData.Name}}
+ </td>
+ <td title="'Status'" filter="{ Status: 'text'}" sortable="'Status'">
+ {{datacenterData.Status}}
+ </td>
+ </td>
+ <td title="'Country'" filter="{ Country: 'text'}" sortable="'Country'">
+ {{datacenterData.Country}}
+ </td>
+ <td title="'Location'" filter="{ Location: 'text'}" sortable="'Location'">
+ {{datacenterData.Location}}
+ </td>
+ <td title="'Service Name'" filter="{ ServiceName: 'text'}" sortable="'ServiceName'">
+ {{datacenterData.ServiceName}}
+ </td>
+ <td title="'Cpu(Cores)'" filter="{ Cpu: 'number'}" sortable="'Cpu'">
+ {{datacenterData.Cpu}}
+ </td>
+ <td title="'Memory(MB)'" filter="{ Memory: 'number'}" sortable="'Memory'">
+ {{datacenterData.Memory}}
+ </td>
+ <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="framework/images/edit.png" height="15" align="left"/></span>
+ <span ng-click="deleteData(datacenterData.Id)" style="cursor: pointer;margin: 0 5px"><img src="framework/images/delete.png" height="15" align="middle"/></span>
+ </td>
+ </tr>
+</table>
+
+<script type="text/ng-template" id="ng-table/headers/checkbox.html">
+ <input type="checkbox" ng-model="checkboxes.checked" name="filter-checkbox" value="" />
+</script>
+
+<div id="myTable"></div>
+
+<!-- Modal -->
+<div id="myModal" class="modal fade" role="dialog">
+ <div class="modal-dialog">
+
+ <!-- Modal content-->
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal">&times;</button>
+ <h5 class="modal-title labelstyle">Modal Header</h5>
+ </div>
+ <form ng-submit="saveData(province.id)" name="provinceForm" method="post">
+ <div class="modal-body">
+
+ <div class="form-group row">
+ <label class="col-xs-4 col-form-label">Name</label>
+ <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">
+ <label class="col-xs-4 col-form-label">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">
+ <label class="col-xs-4 col-form-label">ServiceName</label>
+ <div id="ServiceName" class="col-xs-8" >
+ </div>
+ </div>
+ <div class="form-group row">
+ <label class="col-xs-4 col-form-label">CPU(Cores)</label>
+ <div id="Cpu" class="col-xs-8" >
+ </div>
+ </div>
+ <div class="form-group row">
+ <label class="col-xs-4 col-form-label">Memory</label>
+ <div id="Memory" class="col-xs-8" >
+ </div>
+ </div>
+ <div class="form-group row">
+ <label class="col-xs-4 col-form-label">HardDisk</label>
+ <div id="HardDisk" class="col-xs-8" >
+ </div>
+ </div>
+
+ </div>
+
+ <div id="footerBtns" class="modal-footer">
+
+ </div>
+ </form>
+ </div>
+
+
+ </div>
+</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
index 00000000..3424afec
--- /dev/null
+++ b/resmgr/src/main/webapp/resmgr/nfv-resmgr/datacenter/datacenterRest.js
@@ -0,0 +1,72 @@
+/* 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.
+ */
+
+app.factory("datacenterDataService", function($http,DataService, $log){
+ var uri = 'http://192.168.9.13:18008';
+ 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);
+ console.log(response);
+ return response;
+ });
+ },
+ 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)
+ .then(function(response){
+ $log.info("in delete data service data is :"+response);
+ console.log(response);
+ return response;
+ });
+ },
+ editDatacenterData : function(datacenterData) {
+ return DataService.put(uri, datacenterData)
+ .then(function(response){
+ console.log("Successfully edited.. Data returned in DataService is");
+ console.log(response);
+ return response;
+ });
+ },
+ addDatacenterData : function(datacenterData) {
+ return DataService.post(uri, datacenterData)
+ .then(function(response){
+ console.log("Successfully added.. Data returned in DataService is");
+ console.log(response);
+ return response;
+ });
+ }
+ }
+}); \ 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
index 00000000..22e18134
--- /dev/null
+++ b/resmgr/src/main/webapp/resmgr/nfv-resmgr/location/location.html
@@ -0,0 +1,109 @@
+<!--/* 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.
+*/-->
+
+<h4>{{title}}</h4>
+<br><br>
+<div id="locationAction" ng-init="init()">
+
+</div>
+<br><br>
+
+<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]" />
+ </td>
+ <td title="'Id'" filter="{ Id: 'text'}" sortable="'Id'">
+ {{locationData.Id}}
+ </td>
+ <td title="'Country'" filter="{ Country: 'text'}" sortable="'Country'">
+ {{locationData.Country}}
+ </td>
+ <td title="'Location'" filter="{ Location: 'text'}" sortable="'Location'">
+ {{locationData.Location}}
+ </td>
+ </td>
+ <td title="'Description'" filter="{ Description: 'text'}" sortable="'Description'">
+ {{locationData.Description}}
+ </td>
+ <td title="'Latitude'" filter="{ Latitude: 'text'}" sortable="'Latitude'">
+ {{locationData.Latitude}}
+ </td>
+ <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="framework/images/edit.png" height="15" align="left"/></span>
+ <span ng-click="deleteData(locationData.Id)" style="cursor: pointer;margin: 0 5px"><img src="framework/images/delete.png" height="15" align="middle"/></span>
+ </td>
+ </tr>
+</table>
+
+<script type="text/ng-template" id="ng-table/headers/checkbox.html">
+ <input type="checkbox" ng-model="checkboxes.checked" name="filter-checkbox" value="" />
+</script>
+
+<div id="myTable"></div>
+
+
+<!-- Modal -->
+<div id="myModal" class="modal fade" role="dialog">
+ <div class="modal-dialog">
+
+ <!-- Modal content-->
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal">&times;</button>
+ <h5 class="modal-title">Modal Header</h5>
+ </div>
+ <form name="locationForm" method="post"> <!--ng-submit="saveData(province.id)"-->
+ <div class="modal-body">
+
+ <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">
+ <label class="col-xs-4 col-form-label">Location</label>
+ <div id="Location" class="col-xs-8" >
+ </div>
+ </div>
+ <div class="form-group row">
+ <label class="col-xs-4 col-form-label">Latitude</label>
+ <div id="Latitude" class="col-xs-8" >
+ </div>
+ </div>
+ <div class="form-group row">
+ <label class="col-xs-4 col-form-label">Longitude</label>
+ <div id="Longitude" class="col-xs-8" >
+ </div>
+ </div>
+ <div class="form-group row">
+ <label class="col-xs-4 col-form-label">Description</label>
+ <div id="Description" class="col-xs-8" >
+ </div>
+ </div>
+
+ <div id="footerBtns" class="modal-footer">
+ </div>
+ </form>
+ </div>
+
+
+ </div>
+</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
index 00000000..512bf77e
--- /dev/null
+++ b/resmgr/src/main/webapp/resmgr/nfv-resmgr/location/locationRest.js
@@ -0,0 +1,72 @@
+/* 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.
+ */
+
+app.factory("locationDataService", function($http,DataService, $log){
+ var uri = 'http://192.168.9.13:18008';
+ uri += "/openoapi/resmgr/v1/locations/";
+ return {
+ getLocationData : function() {
+ /*console.log("hi in dataservice");
+ return $http({
+ url: 'http://localhost:3000/locationAPI/getLocationData',
+ 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);
+ console.log(response);
+ return response;
+ });
+ },
+ deleteLocationData : function(id) {
+ /*return $http({
+ url: 'http://localhost:3000/locationAPI/deleteLocationData',
+ 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)
+ .then(function(response){
+ $log.info("in delete data service data is :"+response);
+ console.log(response);
+ return response;
+ });
+ },
+ editLocationData : function(locationData) {
+ return DataService.put(uri, locationData)
+ .then(function(response){
+ console.log("Successfully edited.. Data returned in DataService is");
+ console.log(response);
+ return response;
+ });
+ },
+ addLocationData : function(locationData) {
+ return DataService.post(uri, locationData)
+ .then(function(response){
+ console.log("Successfully added.. Data returned in DataService is");
+ console.log(response);
+ return response;
+ });
+ }
+ }
+}); \ 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
index 00000000..9985552a
--- /dev/null
+++ b/resmgr/src/main/webapp/resmgr/nfv-resmgr/vim/vim.html
@@ -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
index 00000000..ec5fb464
--- /dev/null
+++ b/resmgr/src/main/webapp/resmgr/nfv-resmgr/vim/vim.js
@@ -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