X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fframework%2Fwidgets%2Fskyquake_container%2FskyquakeContainerSource.js;h=76dffea145fd3d1024eecc8be497766cc6143732;hb=3a533017a7a7213c0a63cd755bd6cd50c22ec004;hp=2ee50c02c31f8876146908d4c5aa666b40507740;hpb=e29efc315df33d546237e270470916e26df391d6;p=osm%2FUI.git diff --git a/skyquake/framework/widgets/skyquake_container/skyquakeContainerSource.js b/skyquake/framework/widgets/skyquake_container/skyquakeContainerSource.js index 2ee50c02c..76dffea14 100644 --- a/skyquake/framework/widgets/skyquake_container/skyquakeContainerSource.js +++ b/skyquake/framework/widgets/skyquake_container/skyquakeContainerSource.js @@ -1,5 +1,5 @@ /* - * + * * Copyright 2016 RIFT.IO Inc * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,13 +18,14 @@ import Alt from './skyquakeAltInstance.js'; import $ from 'jquery'; import SkyquakeContainerActions from './skyquakeContainerActions' +import rw from 'utils/rw.js'; +import Utils from 'utils/utils.js'; -let Utils = require('utils/utils.js'); -let API_SERVER = require('utils/rw.js').getSearchParams(window.location).api_server; +let API_SERVER = rw.getSearchParams(window.location).api_server; let HOST = API_SERVER; -let NODE_PORT = require('utils/rw.js').getSearchParams(window.location).api_port || ((window.location.protocol == 'https:') ? 8443 : 8000); -let DEV_MODE = require('utils/rw.js').getSearchParams(window.location).dev_mode || false; -let RW_REST_API_PORT = require('utils/rw.js').getSearchParams(window.location).rw_rest_api_port || 8008; +let NODE_PORT = rw.getSearchParams(window.location).api_port || ((window.location.protocol == 'https:') ? 8443 : 8000); +let DEV_MODE = rw.getSearchParams(window.location).dev_mode || false; +let RW_REST_API_PORT = rw.getSearchParams(window.location).rw_rest_api_port || 8008; if (DEV_MODE) { HOST = window.location.protocol + '//' + window.location.hostname; @@ -40,6 +41,7 @@ export default { type: 'GET', // beforeSend: Utils.addAuthorizationStub, success: function(data) { + Utils.detectInactivity(); resolve(data); } }) @@ -54,7 +56,7 @@ export default { remote: function(state, recordID) { return new Promise(function(resolve, reject) { $.ajax({ - url: '//' + window.location.hostname + ':' + NODE_PORT + '/api/operational/restconf-state/streams?api_server=' + API_SERVER, + url: '//' + window.location.hostname + ':' + window.location.port + '/api/operational/restconf-state/streams?api_server=' + API_SERVER, type: 'GET', beforeSend: Utils.addAuthorizationStub, success: function(data) { @@ -77,7 +79,7 @@ export default { remote: function(state, location, streamSource) { return new Promise((resolve, reject) => { $.ajax({ - url: '//' + window.location.hostname + ':' + NODE_PORT + '/socket-polling?api_server=' + API_SERVER, + url: '//' + window.location.hostname + ':' + window.location.port + '/socket-polling', type: 'POST', beforeSend: Utils.addAuthorizationStub, data: {