diff options
author | Quan-Zhong <quanzhong@huawei.com> | 2016-10-17 17:52:58 +0800 |
---|---|---|
committer | Quan-Zhong <quanzhong@huawei.com> | 2016-10-17 17:52:58 +0800 |
commit | 1d8ca0874c4b924173c96634a213387dbe58c0d4 (patch) | |
tree | 8902cc588b808df8922bb7a5e192b224361fd76f /openo-portal/portal-resmgr/src | |
parent | ae3a13b740237fbb72fd3a971726936ccd4e785e (diff) |
fix gui
NFVO-22
Change-Id: I5ca2bb76d9a0d935bb7a1934366514ee12f6419a
Signed-off-by: Quan-Zhong <quanzhong@huawei.com>
Diffstat (limited to 'openo-portal/portal-resmgr/src')
9 files changed, 78 insertions, 16 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 new file mode 100644 index 00000000..20ce9a54 --- /dev/null +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/conf/globalconfig.json @@ -0,0 +1,5 @@ +{ + "url": "http://127.0.0.1", + "port": "8080", + "context_name":"resmgr" +}
\ No newline at end of file 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 451d2f4c..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 @@ -13,7 +13,8 @@ <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/gconf.js"></script> <script type="text/javascript" src="js/datacenter.js"></script> <style type="text/css"> 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 e3ff681a..8e77f0cf 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 @@ -4,7 +4,7 @@ function hideFirstCol() { } function deleteDatacenter(objectId) { - var requestUrl = "/resmgr/rest/openoapi/resmgr/v1/datacenters/" + objectId; + var requestUrl = app_url+ "/openoapi/resmgr/v1/datacenters/" + objectId; $.ajax({ type: "DELETE", url: requestUrl, @@ -23,7 +23,7 @@ function deleteDatacenter(objectId) { } function loadDatacenterData() { - var requestUrl = "/resmgr/rest/openoapi/resmgr/v1/datacenters"; + var requestUrl = app_url+"/openoapi/resmgr/v1/datacenters"; $.ajax({ type: "GET", url: requestUrl, @@ -46,7 +46,7 @@ function loadDatacenterData() { }); } function loadNetWorkData() { - var requestUrl = "/resmgr/rest/openoapi/resmgr/v1/networks"; + var requestUrl = app_url+"/openoapi/resmgr/v1/networks"; $.ajax({ type: "GET", url: requestUrl, @@ -62,7 +62,7 @@ function loadNetWorkData() { }); } function loadPortData() { - var requestUrl = "/resmgr/rest/openoapi/resmgr/v1/ports"; + var requestUrl = app_url+"/openoapi/resmgr/v1/ports"; $.ajax({ type: "GET", url: requestUrl, @@ -78,7 +78,7 @@ function loadPortData() { }); } function loadHostData() { - var requestUrl = "/resmgr/rest/openoapi/resmgr/v1/hosts"; + var requestUrl = app_url+"/openoapi/resmgr/v1/hosts"; $.ajax({ type: "GET", url: requestUrl, @@ -97,7 +97,7 @@ function loadHostData() { function fillCountryData() { - var requestUrl = "/resmgr/rest/openoapi/resmgr/v1/locations/country"; + var requestUrl = app_url+"/openoapi/resmgr/v1/locations/country"; var htmlContent = ""; $.ajax({ type: "GET", @@ -119,7 +119,7 @@ function fillCountryData() { function fillVimNameData() { - var requestUrl = "/resmgr/rest/openoapi/resmgr/v1/locations/cloudservice"; + var requestUrl = app_url+"/openoapi/resmgr/v1/locations/cloudservice"; var htmlContent = ""; $.ajax({ type: "GET", @@ -198,7 +198,7 @@ $(function () { var formData = JSON.stringify($("#vmAppForm").serializeObject()); var jsonobj = JSON.parse(formData); - var requestUrl = "/resmgr/rest/openoapi/resmgr/v1/datacenters"; + var requestUrl = app_url+"/openoapi/resmgr/v1/datacenters"; $.ajax({ type: "POST", url: requestUrl, @@ -220,7 +220,7 @@ $(function () { $('#country').change(function () { var country = $(this).children('option:selected').val(); - var requestUrl = "/resmgr/rest/openoapi/resmgr/v1/locations/locationbycountry?country=" + country; + var requestUrl = app_url+"/openoapi/resmgr/v1/locations/locationbycountry?country=" + country; var htmlContent = "<option value=''>--select--</option>"; $.ajax({ diff --git a/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/gconf.js b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/gconf.js new file mode 100644 index 00000000..df55a1d0 --- /dev/null +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/gconf.js @@ -0,0 +1,31 @@ +/* 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 app_url; +function getUrl(){ + var url=""; + $.ajax({ + url:"./conf/globalconfig.json", + async:false, + dataType:"json", + success:function(jsonData) { + url = jsonData.url + ":" + jsonData.port +"/"+jsonData.context_name; + console.log("url = " + url); + } + }); + return url; +} +app_url = getUrl(); 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 a0ad9921..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 @@ -3,7 +3,7 @@ function hideFirstCol() { // $('table tr').find('td:eq(0)').hide(); } function deleteLocation(objectId) { - var requestUrl = "/resmgr/rest/openoapi/resmgr/v1/locations/" + objectId; + var requestUrl = app_url+"/openoapi/resmgr/v1/locations/" + objectId; $.ajax({ type: "DELETE", url: requestUrl, @@ -34,7 +34,7 @@ function editLocation(row) { } function loadLocationData() { - var requestUrl = "/resmgr/rest/openoapi/resmgr/v1/locations"; + var requestUrl = app_url+"/openoapi/resmgr/v1/locations"; $.ajax({ type: "GET", url: requestUrl, @@ -146,8 +146,8 @@ $(function () { function () { var formData = JSON.stringify($("#vmAppForm").serializeObject()); var jsonobj = JSON.parse(formData); - var requestUrl = "/resmgr/rest/openoapi/resmgr/v1/locations"; - var requestUrl_query = "/resmgr/rest/openoapi/resmgr/v1/locations"; + var requestUrl = app_url+"/openoapi/resmgr/v1/locations"; + var requestUrl_query = app_url+"/openoapi/resmgr/v1/locations"; if ($('#id').val().length === 0) {//create 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 6de43718..68ffe3f3 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,5 +1,5 @@ function loadVimData() { - var requestUrl = "/resmgr/rest/v1/resmanage/vim/vimInfo"; + var requestUrl = app_url+"/v1/resmanage/vim/vimInfo"; $.ajax({ type: "GET", url: requestUrl, 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 187bee32..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 @@ -15,7 +15,8 @@ <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/validateset.js"></script> - + + <script type="text/javascript" src="js/gconf.js"></script> <script type="text/javascript" src="js/resmgr.js"></script> <style type="text/css"> 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 d4697da3..f917489e 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 @@ -15,6 +15,7 @@ <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"> diff --git a/openo-portal/portal-resmgr/src/main/webapp/resmgr-sdn/resource.html b/openo-portal/portal-resmgr/src/main/webapp/resmgr-sdn/resource.html index 0625f70c..0e0f1ec3 100644 --- a/openo-portal/portal-resmgr/src/main/webapp/resmgr-sdn/resource.html +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-sdn/resource.html @@ -69,6 +69,16 @@ $('#accordionmenuid_ul_0_0_brAppTopMenuID_UL_1_3_brAppTlMenuID').click(function () {
$('#accordionContent').attr('src', 'link.html');
});
+
+ $('#accordionmenuid_ul_0_0_brAppTopMenuID_UL_1_4_locationID').click(function () {
+ $('#accordionContent').attr('src', '../resmgr-nfv/location.html');
+ });
+ $('#accordionmenuid_ul_0_0_brAppTopMenuID_UL_1_5_vimID').click(function () {
+ $('#accordionContent').attr('src', '../resmgr-nfv/vim.html');
+ });
+ $('#accordionmenuid_ul_0_0_brAppTopMenuID_UL_1_6_datacenterID').click(function () {
+ $('#accordionContent').attr('src', '../resmgr-nfv/datacenter.html');
+ });
})
</script>
@@ -117,6 +127,19 @@ nodeid="brAppTlMenuID" style="display: list-item;">
<a title="Link" style="padding-left: 62px;">Link</a>
</li>
+
+ <li id="accordionmenuid_ul_0_0_brAppTopMenuID_UL_1_4_locationID"
+ nodeid="brAppSiteMenuID" class="" style="display: list-item;">
+ <a title="Click to visit location" class="" style="padding-left: 62px;">Location</a>
+ </li>
+ <li id="accordionmenuid_ul_0_0_brAppTopMenuID_UL_1_5_vimID"
+ nodeid="brAppMeMenuID" style="display: list-item;">
+ <a title="Click to visit vim" style="padding-left: 62px;">Vim</a>
+ </li>
+ <li id="accordionmenuid_ul_0_0_brAppTopMenuID_UL_1_6_datacenterID"
+ nodeid="brAppTpMenuID" style="display: list-item;">
+ <a title="Click to visit datacenter" style="padding-left: 62px;">DataCenter</a>
+ </li>
</ul>
</li>
</ul>
|