fix gui
authorQuan-Zhong <quanzhong@huawei.com>
Wed, 2 Nov 2016 07:17:15 +0000 (15:17 +0800)
committerQuan-Zhong <quanzhong@huawei.com>
Wed, 2 Nov 2016 07:17:15 +0000 (15:17 +0800)
NFVO-39

Change-Id: Ifad58ba989eec5ee798c5db37367e8a3eb9a008d
Signed-off-by: Quan-Zhong <quanzhong@huawei.com>
13 files changed:
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/conf/globalconfig.json
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/css/RMain.css
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/css/VMMain.css
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/css/resmgr.css
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/datacenter.html
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/SendMsg.js
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/datacenter.js
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/resmgr.js
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/validateset.js
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/vim.js
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/location.html
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/resource.html
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/vim.html

index 93714d4..367b974 100644 (file)
@@ -1,5 +1,5 @@
 {
-  "url": "http://127.0.0.1",
-  "port": "8080",
-  "context_name":"/resmgr"
+  "url": "http://192.168.233.226",
+  "port": "80",
+  "context_name":""
 }
\ No newline at end of file
index b796708..43160f5 100644 (file)
@@ -1,18 +1,3 @@
-/* Copyright 2016, 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.
- */
-
 #iemp_layout_container {
     padding: 0px;
     margin: 1px auto;
index 1ade87f..2565306 100644 (file)
@@ -1,18 +1,3 @@
-/* Copyright 2016, 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.
- */
-
 body {
     font-family: '微软雅黑';
     font-size: 12px;
index 37074d1..e79d125 100644 (file)
@@ -1,18 +1,3 @@
-/* Copyright 2016, 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.
- */
 fieldset {
     width: 680px;
 }
index fc3de5d..f0ae967 100644 (file)
@@ -1,18 +1,3 @@
-<!--
-    Copyright 2016, 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>
index 97c5750..e42c033 100644 (file)
@@ -1,17 +1,3 @@
-/* Copyright 2016, 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.
- */
 var sendMsg = {
     get: "get",
     post: "post"
index 8dd613f..a861165 100644 (file)
@@ -1,17 +1,3 @@
-/* Copyright 2016, 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 hideFirstCol() {
 //     $('table tr').find('th:eq(0)').hide();
 //     $('table tr').find('td:eq(0)').hide();
@@ -112,7 +98,7 @@ function loadHostData() {
 function fillCountryData() {
 
     var requestUrl = app_url+"/openoapi/resmgr/v1/locations/country";
-    var htmlContent = "";
+    var htmlContent = "<option value=''>--select--</option>";
     $.ajax({
         type: "GET",
         url: requestUrl,
@@ -133,7 +119,7 @@ function fillCountryData() {
 
 function fillVimNameData() {
 
-    var requestUrl = app_url+"/openoapi/resmgr/v1/locations/cloudservice";
+    var requestUrl = app_url+"/openoapi/resmgr/v1/datacenters/vims";
     var htmlContent = "";
     $.ajax({
         type: "GET",
@@ -142,7 +128,7 @@ function fillVimNameData() {
         success: function (jsonobj) {
             var str = jsonobj.data.replace('[', '').replace(']', '').split(',')
             $.each(str, function (n, v) {
-                htmlContent += "<option value='" + v + "'>" + v + "</option>";
+                htmlContent += "<option value='" + v.vimId + "'>" + v.name + "</option>";
                 $("#vimName").html(htmlContent);
 
             });
index 41ed432..5a6e66c 100644 (file)
@@ -1,17 +1,3 @@
-/* Copyright 2016, 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 hideFirstCol() {
 //     $('table tr').find('th:eq(0)').hide();
 //     $('table tr').find('td:eq(0)').hide();
index 4989ea3..d6e47d2 100644 (file)
@@ -1,17 +1,3 @@
-/* Copyright 2016, 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 () {
     $.validator.setDefaults({
         onkeyup: null,
index ff6277d..bf55aae 100644 (file)
@@ -1,17 +1,22 @@
-/* Copyright 2016, 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 loadDatacenterData() {
+    var requestUrl = app_url+"/openoapi/resmgr/v1/datacenters";
+    $.ajax({
+        type: "GET",
+        url: requestUrl,
+        contentType: "application/json",
+        success: function (jsonobj) {
+            $.each(jsonobj.datacenters, function (n, v) {
+                printCharts(v.usedCPU, v.totalCPU, v.usedMemory, v.totalMemory, v.usedDisk, v.totalDisk,v.name);
+            });
+        },
+        error: function (xhr, ajaxOptions, thrownError) {
+            bootbox.alert("Error on getting site data : " + xhr.responseText);
+            printCharts(11, 12, 21, 22, 31, 32,1);
+        }
+    });
+}
+
+
 function loadVimData() {
     var requestUrl = app_url+"/v1/resmanage/vim/vimInfo";
     $.ajax({
@@ -20,22 +25,29 @@ function loadVimData() {
         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);
+                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,1);
 
         },
         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);
+            printCharts(11, 12, 21, 22, 31, 32,1);
         }
     });
 }
-function printCharts(v11, v12, v21, v22, v31, v32) {
-    var cpuChart = new Chart($("#cpuChart"), {
+
+function addHtmlTemplate(dc_id){
+       var htmlTemplate= '<div><br/><div>DataCenter[ '+dc_id+' ]</div><div style="width: 33%; float: left; text-align: center; display: inline"> <canvas id="cpuChart_'+dc_id+'"></canvas> <br> <label style="font-size: 14px;">Cpu status</label> </div> <div style="width: 33%; float: left; text-align: center; display: inline"> <canvas id="memoryChart_'+dc_id+'"></canvas> <br> <label style="font-size: 14px;">Memory status</label> </div> <div style="width: 34%; float: left; text-align: center; display: inline"> <canvas id="diskChart_'+dc_id+'"></canvas> <br> <label style="font-size: 14px;">Disk status</label> </div> </div>';
+       $('#chartArea').append(htmlTemplate);
+}
+
+function printCharts(v11, v12, v21, v22, v31, v32,dc_id) {
+       addHtmlTemplate(dc_id);
+    var cpuChart = new Chart($("#cpuChart_"+dc_id+""), {
         type: 'doughnut',
         data: {
             labels: ["used", "available"],
             datasets: [{
-                data: [v11, v12],
+                data: [v11, v12-v11],
                 backgroundColor: ["#FFCE56", "#36A2EB"],
                 hoverBackgroundColor: ["#FFCE56", "#36A2EB"]
             }]
@@ -48,12 +60,12 @@ function printCharts(v11, v12, v21, v22, v31, v32) {
             }
         }
     });
-    var memoryChart = new Chart($("#memoryChart"), {
+    var memoryChart = new Chart($("#memoryChart_"+dc_id+""), {
         type: 'doughnut',
         data: {
             labels: ["used", "available"],
             datasets: [{
-                data: [v21, v22],
+                data: [v21, v22-v21],
                 backgroundColor: ["#FF6384", "#36A2EB"],
                 hoverBackgroundColor: ["#FF6384", "#36A2EB"]
             }]
@@ -67,12 +79,12 @@ function printCharts(v11, v12, v21, v22, v31, v32) {
             }
         }
     });
-    var diskChart = new Chart($("#diskChart"), {
+    var diskChart = new Chart($("#diskChart_"+dc_id+""), {
         type: 'doughnut',
         data: {
             labels: ["used", "available"],
             datasets: [{
-                data: [v31, v32],
+                data: [v31, v32-v31],
                 backgroundColor: ["#FF6384", "green"],
                 hoverBackgroundColor: ["#FF6384", "green"]
             }]
@@ -88,6 +100,6 @@ function printCharts(v11, v12, v21, v22, v31, v32) {
 }
 
 $(function () {
-    loadVimData();
+       loadDatacenterData();
 
 })
\ No newline at end of file
index 61bd7c0..b6647ab 100644 (file)
@@ -1,19 +1,3 @@
-<!--
-    Copyright 2016, 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>
index 5998250..281e86c 100644 (file)
@@ -1,21 +1,3 @@
-<!--
-
-    Copyright 2016, 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>
index aaef625..7bdb9b9 100644 (file)
@@ -1,69 +1,56 @@
-<!--
-    Copyright 2016, 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>
+<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>
+       <div class="container-fluid ms-controller">
+               <br>
+               <div style="font-size: 18px">Resource using status:</div>
+               <hr>
+               <!-- chart area -->
+               <div id="chartArea">
+                       <!-- <div>
+                               <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>
+                       </div> -->
+               </div>
+               <script type="text/javascript">
+                       
+               </script>
+       </div>
 </body>
 </html>
\ No newline at end of file