fix gui
authorQuan-Zhong <quanzhong@huawei.com>
Mon, 17 Oct 2016 09:52:58 +0000 (17:52 +0800)
committerQuan-Zhong <quanzhong@huawei.com>
Mon, 17 Oct 2016 09:52:58 +0000 (17:52 +0800)
NFVO-22

Change-Id: I5ca2bb76d9a0d935bb7a1934366514ee12f6419a
Signed-off-by: Quan-Zhong <quanzhong@huawei.com>
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/conf/globalconfig.json [new file with mode: 0644]
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/datacenter.html
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/datacenter.js
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/gconf.js [new file with mode: 0644]
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/resmgr.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/vim.html
openo-portal/portal-resmgr/src/main/webapp/resmgr-sdn/resource.html

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 (file)
index 0000000..20ce9a5
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "url": "http://127.0.0.1",
+  "port": "8080",
+  "context_name":"resmgr"
+}
\ No newline at end of file
index 451d2f4..f0ae967 100644 (file)
@@ -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">
index e3ff681..8e77f0c 100644 (file)
@@ -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 (file)
index 0000000..df55a1d
--- /dev/null
@@ -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();
index a0ad992..5a6e66c 100644 (file)
@@ -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
 
 
index 6de4371..68ffe3f 100644 (file)
@@ -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,
index 187bee3..b6647ab 100644 (file)
@@ -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">
index d4697da..f917489 100644 (file)
@@ -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">
index 0625f70..0e0f1ec 100644 (file)
         $('#accordionmenuid_ul_0_0_brAppTopMenuID_UL_1_3_brAppTlMenuID').click(function () {\r
             $('#accordionContent').attr('src', 'link.html');\r
         });\r
+        \r
+        $('#accordionmenuid_ul_0_0_brAppTopMenuID_UL_1_4_locationID').click(function () {\r
+            $('#accordionContent').attr('src', '../resmgr-nfv/location.html');\r
+        });\r
+        $('#accordionmenuid_ul_0_0_brAppTopMenuID_UL_1_5_vimID').click(function () {\r
+            $('#accordionContent').attr('src', '../resmgr-nfv/vim.html');\r
+        });\r
+        $('#accordionmenuid_ul_0_0_brAppTopMenuID_UL_1_6_datacenterID').click(function () {\r
+            $('#accordionContent').attr('src', '../resmgr-nfv/datacenter.html');\r
+        });\r
 \r
     })\r
 </script>\r
                                                 nodeid="brAppTlMenuID" style="display: list-item;">\r
                                                 <a title="Link" style="padding-left: 62px;">Link</a>\r
                                             </li>\r
+                                            \r
+                                            <li id="accordionmenuid_ul_0_0_brAppTopMenuID_UL_1_4_locationID"\r
+                                                nodeid="brAppSiteMenuID" class="" style="display: list-item;">\r
+                                                <a title="Click to visit location" class="" style="padding-left: 62px;">Location</a>\r
+                                            </li>\r
+                                            <li id="accordionmenuid_ul_0_0_brAppTopMenuID_UL_1_5_vimID"\r
+                                                nodeid="brAppMeMenuID" style="display: list-item;">\r
+                                                <a title="Click to visit vim" style="padding-left: 62px;">Vim</a>\r
+                                            </li>\r
+                                            <li id="accordionmenuid_ul_0_0_brAppTopMenuID_UL_1_6_datacenterID"\r
+                                                nodeid="brAppTpMenuID" style="display: list-item;">\r
+                                                <a title="Click to visit datacenter" style="padding-left: 62px;">DataCenter</a>\r
+                                            </li>\r
                                         </ul>\r
                                     </li>\r
                                 </ul>\r