fix datacenter.js
authorQuan-Zhong <quanzhong@huawei.com>
Wed, 2 Nov 2016 08:04:42 +0000 (16:04 +0800)
committerQuan-Zhong <quanzhong@huawei.com>
Wed, 2 Nov 2016 08:04:42 +0000 (16:04 +0800)
NFVO-39

Change-Id: I3820e6a02be41e9f7c365e79f36edcaa518d2d52
Signed-off-by: Quan-Zhong <quanzhong@huawei.com>
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/conf/globalconfig.json
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/datacenter.js
openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/gconf.js

index 367b974..9df8207 100644 (file)
@@ -1,5 +1,3 @@
 {
-  "url": "http://192.168.233.226",
-  "port": "80",
-  "context_name":""
+  "url": "http://127.0.0.1:8080/resmgr"
 }
\ No newline at end of file
index a861165..3a74ce1 100644 (file)
@@ -227,12 +227,11 @@ $(function () {
             type: "GET",
             url: requestUrl,
             contentType: "application/json",
-            success: function (jsonobj) {
-                $.each(jsonobj.data, function (n, v) {
-                    htmlContent += "<option value='" + v + "'>" + v + "</option>";
-                    $("#location").html(htmlContent);
-
-                });
+            success: function (jsonobj) {var str = jsonobj.data.replace('[', '').replace(']', '').split(',')
+                    $.each(str, function (n, v) {
+                        htmlContent += "<option value='" + v + "'>" + v + "</option>";
+                         $("#location").html(htmlContent);
+                    });
 
             },
             error: function (xhr, ajaxOptions, thrownError) {
index bf8f829..06814d1 100644 (file)
@@ -22,7 +22,7 @@ function getUrl(){
                async:false,
                dataType:"json",
                success:function(jsonData) {
-                       url = jsonData.url + ":" + jsonData.port +jsonData.context_name;
+                       url = jsonData.url;
                        console.log("url = " + url);
                }
        });