From be140a074087be31101dc6118d44887424b54a9b Mon Sep 17 00:00:00 2001 From: Quan-Zhong Date: Wed, 2 Nov 2016 15:17:15 +0800 Subject: fix gui NFVO-39 Change-Id: Ifad58ba989eec5ee798c5db37367e8a3eb9a008d Signed-off-by: Quan-Zhong --- .../main/webapp/resmgr-nfv/conf/globalconfig.json | 6 +- .../src/main/webapp/resmgr-nfv/css/RMain.css | 15 --- .../src/main/webapp/resmgr-nfv/css/VMMain.css | 15 --- .../src/main/webapp/resmgr-nfv/css/resmgr.css | 15 --- .../src/main/webapp/resmgr-nfv/datacenter.html | 15 --- .../src/main/webapp/resmgr-nfv/js/SendMsg.js | 14 --- .../src/main/webapp/resmgr-nfv/js/datacenter.js | 20 +--- .../src/main/webapp/resmgr-nfv/js/resmgr.js | 14 --- .../src/main/webapp/resmgr-nfv/js/validateset.js | 14 --- .../src/main/webapp/resmgr-nfv/js/vim.js | 60 ++++++----- .../src/main/webapp/resmgr-nfv/location.html | 16 --- .../src/main/webapp/resmgr-nfv/resource.html | 18 ---- .../src/main/webapp/resmgr-nfv/vim.html | 111 +++++++++------------ 13 files changed, 91 insertions(+), 242 deletions(-) (limited to 'openo-portal/portal-resmgr') 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 @@ - 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 = ""; $.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 += ""; + htmlContent += ""; $("#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= '

DataCenter[ '+dc_id+' ]



'; + $('#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 @@ - 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 @@ - - 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 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + -
-
-
resource using status:
-
- -
- -
- -
-
- -
- -
-
- -
- -
- -
+
+
+
Resource using status:
+
+ +
+ +
+ +
\ No newline at end of file -- cgit 1.2.3-korg