diff options
author | jin xin <j00101220@huawei.com> | 2016-11-02 08:09:18 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@open-o.org> | 2016-11-02 08:09:18 +0000 |
commit | 60597c40035614d8b62e112b278c7526fa1a3a4d (patch) | |
tree | 39181dbaab69e65873f280791a51da126811c05b /openo-portal | |
parent | ec50ab686203fa7a1775f62220752b5e5aeffc52 (diff) | |
parent | be140a074087be31101dc6118d44887424b54a9b (diff) |
Merge "fix gui NFVO-39" into sun
Diffstat (limited to 'openo-portal')
13 files changed, 91 insertions, 242 deletions
diff --git a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/conf/globalconfig.json b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/conf/globalconfig.json index 93714d49..367b974d 100644 --- a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/conf/globalconfig.json +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/conf/globalconfig.json @@ -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 diff --git a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/css/RMain.css b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/css/RMain.css index b796708d..43160f5a 100644 --- a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/css/RMain.css +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/css/RMain.css @@ -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; diff --git a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/css/VMMain.css b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/css/VMMain.css index 1ade87f3..25653069 100644 --- a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/css/VMMain.css +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/css/VMMain.css @@ -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; diff --git a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/css/resmgr.css b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/css/resmgr.css index 37074d13..e79d125a 100644 --- a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/css/resmgr.css +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/css/resmgr.css @@ -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; } diff --git a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/datacenter.html b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/datacenter.html index fc3de5d7..f0ae9679 100644 --- a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/datacenter.html +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/datacenter.html @@ -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> diff --git a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/SendMsg.js b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/SendMsg.js index 97c57506..e42c0333 100644 --- a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/SendMsg.js +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/SendMsg.js @@ -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" diff --git a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/datacenter.js b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/datacenter.js index 8dd613f7..a861165a 100644 --- a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/datacenter.js +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/datacenter.js @@ -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); }); diff --git a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/resmgr.js b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/resmgr.js index 41ed432c..5a6e66cb 100644 --- a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/resmgr.js +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/resmgr.js @@ -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(); diff --git a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/validateset.js b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/validateset.js index 4989ea3a..d6e47d27 100644 --- a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/validateset.js +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/validateset.js @@ -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, diff --git a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/vim.js b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/vim.js index ff6277d1..bf55aaee 100644 --- a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/vim.js +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/vim.js @@ -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 diff --git a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/location.html b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/location.html index 61bd7c09..b6647abc 100644 --- a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/location.html +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/location.html @@ -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> diff --git a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/resource.html b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/resource.html index 5998250e..281e86c5 100644 --- a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/resource.html +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/resource.html @@ -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> diff --git a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/vim.html b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/vim.html index aaef6251..7bdb9b9c 100644 --- a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/vim.html +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/vim.html @@ -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 |