aboutsummaryrefslogtreecommitdiffstats
path: root/gui-editors/gui-editor-apex
diff options
context:
space:
mode:
authorLiam Fallon <liam.fallon@est.tech>2021-10-29 08:32:36 +0000
committerGerrit Code Review <gerrit@onap.org>2021-10-29 08:32:36 +0000
commit6df019389c1f5de9dd5b7601e270f0ef17ea2491 (patch)
tree0007ed8e093258892ab49beff5cdbcb57b1a159e /gui-editors/gui-editor-apex
parent5bd5e5a0e64afff9c285860f1f5069e6acc25d67 (diff)
parent95a6260a715cdf46234ced9c797316685d1be918 (diff)
Merge "Fix APEX policy creation issue"
Diffstat (limited to 'gui-editors/gui-editor-apex')
-rw-r--r--gui-editors/gui-editor-apex/src/main/resources/webapp/js/ApexMain.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/gui-editors/gui-editor-apex/src/main/resources/webapp/js/ApexMain.js b/gui-editors/gui-editor-apex/src/main/resources/webapp/js/ApexMain.js
index d7019d3..ce491ec 100644
--- a/gui-editors/gui-editor-apex/src/main/resources/webapp/js/ApexMain.js
+++ b/gui-editors/gui-editor-apex/src/main/resources/webapp/js/ApexMain.js
@@ -111,21 +111,21 @@ $("#menu li").not(".emptyMessage").click(function() {
});
function main_getRestRootURL() {
- var href = location.protocol
+ const href = location.protocol
+ "//"
+ window.location.hostname
+ (location.port ? ':' + location.port : '')
+ (location.pathname.endsWith("/editor/") ? location.pathname.substring(0, location.pathname
.indexOf("editor/")) : location.pathname);
- var restContext = "apexservices/editor/";
+ const restContext = "apexservices/editor/";
if (localStorage.getItem("apex_session")) {
restRootURL = href + restContext + localStorage.getItem("apex_session");
- window.restRootURL = href + restContext + localStorage.getItem("apex_session");
- var requestURL = restRootURL + "/Model/GetKey";
+ window.restRootURL = restRootURL;
+ const requestURL = restRootURL + "/Model/GetKey";
ajax_get(requestURL, function(data) {
$("#statusMessageTable").append("<tr><td> REST root URL set to: " + restRootURL + "</td></tr>");
if (localStorage.getItem("apex_model_loaded")) {
- var modelKey = JSON.parse(data.messages.message[0]).apexArtifactKey;
+ const modelKey = JSON.parse(data.messages.message[0]).apexArtifactKey;
pageControl_modelMode(modelKey.name, modelKey.version, modelFileName);
if (localStorage.getItem("apex_tab_index")) {
$("#mainTabs").tabs({
@@ -135,11 +135,12 @@ function main_getRestRootURL() {
}
});
} else {
- var createSessionURL = href + restContext + "-1/Session/Create";
+ const createSessionURL = href + restContext + "-1/Session/Create";
ajax_get(createSessionURL, function(data) {
localStorage.setItem("apex_session", data.messages.message[0]);
restRootURL = href + restContext + localStorage.getItem("apex_session");
+ window.restRootURL = restRootURL;
$("#statusMessageTable").append("<tr><td> REST root URL set to: " + restRootURL + "</td></tr>");
});
}
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343