summaryrefslogtreecommitdiffstats
path: root/openo-portal/portal-extsys
diff options
context:
space:
mode:
authorSeshu-Kumar-M <seshu.kumar.m@huawei.com>2016-10-05 19:15:31 +0800
committerSeshu-Kumar-M <seshu.kumar.m@huawei.com>2016-10-05 19:19:49 +0800
commit80d4beebf2e74a07a9b118f9139f713906187819 (patch)
tree9470caaa84e1961d358c06fddd6938ebea958899 /openo-portal/portal-extsys
parent0443c850719d9059906ed8b1c844265f1ac104cb (diff)
Dynamic config for the server IP and port
Change-Id: I49d1f9bbbfb1b69765cf87c1250e9a76cefa5f1d Signed-off-by: Seshu-Kumar-M <seshu.kumar.m@huawei.com>
Diffstat (limited to 'openo-portal/portal-extsys')
-rw-r--r--openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/conf/dataconfig.json4
-rw-r--r--openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/js/controller.js12
2 files changed, 13 insertions, 3 deletions
diff --git a/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/conf/dataconfig.json b/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/conf/dataconfig.json
new file mode 100644
index 00000000..87e36cfd
--- /dev/null
+++ b/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/conf/dataconfig.json
@@ -0,0 +1,4 @@
+{
+ "url": "http://localhost",
+ "port": "8080"
+} \ No newline at end of file
diff --git a/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/js/controller.js b/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/js/controller.js
index fa2f88f1..04437df9 100644
--- a/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/js/controller.js
+++ b/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/js/controller.js
@@ -13,6 +13,12 @@
* limitations under the License.
*/
+var url = "";
+$.getJSON("./conf/dataconfig.json", function (jsonData){
+ url = jsonData.url +":"+ jsonData.port;
+ console.log("URL = " + url);
+});
+
$('.siteDeleteImg').click(
function () {
var data = $(this).parent().parent().parent().find('td:last').find(
@@ -29,7 +35,7 @@ $('.siteDeleteImg').click(
});
function deleteController(objectId) {
- var requestUrl = "/openoapi/extsys/v1/sdncontrollers/" + objectId;
+ var requestUrl = url + "/openoapi/extsys/v1/sdncontrollers/" + objectId;
$.ajax({
type: "DELETE",
url: requestUrl,
@@ -48,7 +54,7 @@ function deleteController(objectId) {
}
function loadControllerData() {
- var requestUrl = "/openoapi/extsys/v1/sdncontrollers";
+ var requestUrl = url + "/openoapi/extsys/v1/sdncontrollers";
$.ajax({
type: "GET",
url: requestUrl,
@@ -148,7 +154,7 @@ $(function () {
"topologicalController": jsonobj
};
formData = JSON.stringify(newJson);
- var requestUrl = "/openoapi/extsys/v1/sdncontrollers";
+ var requestUrl = url + "/openoapi/extsys/v1/sdncontrollers";
$.ajax({
type: "POST",
url: requestUrl,