window.sessionStorage.setItem("auth", AuthBase64);
self.detectInactivity();
$.ajax({
- url: '//' + window.location.hostname + ':' + NODE_PORT + '/check-auth?api_server=' + API_SERVER,
+ url: '//' + window.location.hostname + ':' + window.location.port + '/check-auth?api_server=' + API_SERVER,
type: 'GET',
beforeSend: Utils.addAuthorizationStub,
success: function(data) {
.JSONViewer {
+ max-width: 640px;
/*
copied from node_modules/prismjs/themes/prismjs.css
*/
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) {
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: {
return resolve(false);
}
$.ajax({
- url: '/socket-polling?api_server=' + API_SERVER ,
+ url: '/socket-polling',
type: 'POST',
beforeSend: Utils.addAuthorizationStub,
data: {
var download_host = req.query['dev_download_server'];
if (!download_host) {
- download_host = api_server + ':' + utils.getPortForProtocol(req.protocol);
+ download_host = req.protocol + '://' + req.get('host');//api_server + ':' + utils.getPortForProtocol(req.protocol);
}
var input = {
'external-url': download_host + '/composer/update/' + req.file.filename,
var download_host = req.query['dev_download_server'];
if (!download_host) {
- download_host = api_server + ':' + utils.getPortForProtocol(req.protocol);
+ download_host = req.protocol + '://' + req.get('host');//req.api_server + ':' + utils.getPortForProtocol(req.protocol);
}
return new Promise(function(resolve, reject) {
var package_type = req.query['package_type'].toUpperCase();
var package_path = req.query['package_path'];
if (!download_host) {
- download_host = api_server + ':' + utils.getPortForProtocol(req.protocol);
+ download_host = req.protocol + '://' + req.get('host');//api_server + ':' + utils.getPortForProtocol(req.protocol);
}
var input = {
'external-url': download_host + '/composer/upload/' + req.query['package_id'] + '/' + req.file.filename,
return new Promise(function(resolve, reject) {
//api/operational/download-jobs/job/
$.ajax({
- url: '/socket-polling?api_server=' + API_SERVER ,
+ url: '/socket-polling',
type: 'POST',
beforeSend: Utils.addAuthorizationStub,
data: {
return new Promise(function(resolve, reject) {
//api/operational/download-jobs/job/
$.ajax({
- url: '/socket-polling?api_server=' + API_SERVER ,
+ url: '/socket-polling',
type: 'POST',
beforeSend: Utils.addAuthorizationStub,
data: {
}
new Promise(function(resolve, reject) {
$.ajax({
- url: '/socket-polling?api_server=' + API_SERVER ,
+ url: '/socket-polling',
type: 'POST',
beforeSend: Utils.addAuthorizationStub,
data: {
}
function ajaxRequest(path, catalogPackage, resolve, reject, method = 'GET') {
$.ajax({
- url: '//' + window.location.hostname + ':' + getApiServerOrigin() + path,
+ url: '//' + window.location.hostname + ':' + window.location.port + path,
type: method,
beforeSend: utils.addAuthorizationStub,
dataType: 'json',
remote: function() {
return new Promise(function(resolve, reject) {
$.ajax({
- url: '//' + window.location.hostname + ':' + NODE_PORT + '/api/launchpad/network-service?api_server=' + API_SERVER,
+ url: '//' + window.location.hostname + ':' + window.location.port + '/api/launchpad/network-service?api_server=' + API_SERVER,
type: 'GET',
beforeSend: Utils.addAuthorizationStub,
success: function(data) {
return {
remote: function(state, environment) {
return $.ajax({
- url: '//' + window.location.hostname + ':' + NODE_PORT + '/api/launchpad/environment?api_server=' + API_SERVER,
+ url: '//' + window.location.hostname + ':' + window.location.port + '/api/launchpad/environment?api_server=' + API_SERVER,
type: 'POST',
beforeSend: Utils.addAuthorizationStub,
dataType: 'json',
remote: function() {
return new Promise(function(resolve, reject) {
$.ajax({
- url: '//' + window.location.hostname + ':' + NODE_PORT + '/api/launchpad/pools?api_server=' + API_SERVER,
+ url: '//' + window.location.hostname + ':' + window.location.port + '/api/launchpad/pools?api_server=' + API_SERVER,
type: 'GET',
beforeSend: Utils.addAuthorizationStub,
success: function(data) {
remote: function() {
return new Promise(function(resolve, reject) {
$.ajax({
- url: '//' + window.location.hostname + ':' + NODE_PORT + '/api/launchpad/sla-params?api_server=' + API_SERVER,
+ url: '//' + window.location.hostname + ':' + window.location.port + '/api/launchpad/sla-params?api_server=' + API_SERVER,
type: 'GET',
beforeSend: Utils.addAuthorizationStub,
success: function(data) {
return resolve(false);
}
$.ajax({
- url: '/socket-polling?api_server=' + API_SERVER ,
+ url: '/socket-polling',
type: 'POST',
beforeSend: Utils.addAuthorizationStub,
data: {
return new Promise(function(resolve, reject) {
console.log('Getting NSR Socket');
$.ajax({
- url: '/socket-polling?api_server=' + API_SERVER,
+ url: '/socket-polling',
type: 'POST',
beforeSend: Utils.addAuthorizationStub,
data: {
return new Promise(function(resolve, reject) {
console.log('Getting Job Socket');
$.ajax({
- url: '/socket-polling?api_server=' + API_SERVER,
+ url: '/socket-polling',
type: 'POST',
beforeSend: Utils.addAuthorizationStub,
data: {
return new Promise(function(resolve, reject) {
console.log('Getting VNFR Socket for: ' + state.recordID);
$.ajax({
- url: '/socket-polling?api_server=' + API_SERVER,
+ url: '/socket-polling',
type: 'POST',
beforeSend: Utils.addAuthorizationStub,
data: {
return resolve(false);
}
$.ajax({
- url: '/socket-polling?api_server=' + API_SERVER ,
+ url: '/socket-polling',
type: 'POST',
beforeSend: Utils.addAuthorizationStub,
data: {
return resolve(false);
}
$.ajax({
- url: '/socket-polling?api_server=' + API_SERVER ,
+ url: '/socket-polling',
type: 'POST',
beforeSend: Utils.addAuthorizationStub,
data: {
}
console.log(nsr_id)
$.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: {
var sslOptions = null;
+ var apiServer = argv['api-server'] ? argv['api-server'] : 'localhost';
+ var uploadServer = argv['upload-server'] ? argv['upload-server'] : null;
+
try {
if (argv['enable-https']) {
var keyFilePath = argv['keyfile-path'];
app.use(inactivity_routes);
// Configure global config with ssl enabled/disabled
- configurationAPI.globalConfiguration.update({
- ssl_enabled: httpsConfigured
- });
+ var globalConfig = {
+ ssl_enabled: httpsConfigured,
+ api_server: apiServer
+ };
+
+ if (uploadServer) {
+ globalConfig.upload_server = uploadServer;
+ }
+
+ configurationAPI.globalConfiguration.update(globalConfig);
// Configure configuration route(s)
app.use(configuration_routes);