aboutsummaryrefslogtreecommitdiffstats
path: root/openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js
diff options
context:
space:
mode:
Diffstat (limited to 'openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js')
-rw-r--r--openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/datacenter.js18
-rw-r--r--openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/gconf.js31
-rw-r--r--openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/resmgr.js8
-rw-r--r--openo-portal/portal-resmgr/src/main/webapp/resmgr-nfv/js/vim.js2
4 files changed, 45 insertions, 14 deletions
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,