Refactoring CLIENT PLATFORM
This commit is contained in:
1 parent
7c078b286f
commit
fd7f970304
8 files changed
+21
-21
No files matched your search
@@ -29,7 +29,7 @@ exports.newDesktopApp = function newDesktopApp() {
|
|||||||
|
|
||||||
DK.running.webSocketsInterface = DK.projects.socialTrading.modules.webSocketsInterface.newDesktopModulesWebSocketsInterface()
|
DK.running.webSocketsInterface = DK.projects.socialTrading.modules.webSocketsInterface.newDesktopModulesWebSocketsInterface()
|
||||||
DK.running.webSocketsInterface.initialize()
|
DK.running.webSocketsInterface.initialize()
|
||||||
console.log('Desktop Client Web Sockets Interface ....................................... Listening at port ' + global.env.CLIENT_WEB_SOCKETS_INTERFACE_PORT)
|
console.log('Desktop Client Web Sockets Interface ....................................... Listening at port ' + global.env.PLATFORM_WEB_SOCKETS_INTERFACE_PORT)
|
||||||
|
|
||||||
|
|
||||||
DK.running.httpInterface = DK.projects.socialTrading.modules.httpInterface.newDesktopModulesHttpInterface()
|
DK.running.httpInterface = DK.projects.socialTrading.modules.httpInterface.newDesktopModulesHttpInterface()
|
||||||
|
|||||||
+3
-3
@@ -10,18 +10,18 @@ exports.newEnvironment = function () {
|
|||||||
let thisObject = {
|
let thisObject = {
|
||||||
BASE_PATH: basePath,
|
BASE_PATH: basePath,
|
||||||
WEB_SERVER_URL: 'localhost',
|
WEB_SERVER_URL: 'localhost',
|
||||||
CLIENT_WEB_SOCKETS_INTERFACE_PORT: 18041,
|
PLATFORM_WEB_SOCKETS_INTERFACE_PORT: 18041,
|
||||||
NETWORK_WEB_SOCKETS_INTERFACE_PORT: 18042,
|
NETWORK_WEB_SOCKETS_INTERFACE_PORT: 18042,
|
||||||
DESKTOP_WEB_SOCKETS_INTERFACE_PORT: 18043,
|
DESKTOP_WEB_SOCKETS_INTERFACE_PORT: 18043,
|
||||||
DESKTOP_WEB_SOCKETS_INTERFACE_HOST: 'localhost',
|
DESKTOP_WEB_SOCKETS_INTERFACE_HOST: 'localhost',
|
||||||
CLIENT_HTTP_INTERFACE_PORT: 34248,
|
PLATFORM_HTTP_INTERFACE_PORT: 34248,
|
||||||
DESKTOP_HTTP_INTERFACE_PORT: 34249,
|
DESKTOP_HTTP_INTERFACE_PORT: 34249,
|
||||||
PATH_TO_DATA_STORAGE: path.join(basePath, './Platform/My-Data-Storage'),
|
PATH_TO_DATA_STORAGE: path.join(basePath, './Platform/My-Data-Storage'),
|
||||||
PATH_TO_PROJECTS: path.join(basePath, './Projects'),
|
PATH_TO_PROJECTS: path.join(basePath, './Projects'),
|
||||||
PATH_TO_LOG_FILES: path.join(basePath, './Platform/My-Log-Files'),
|
PATH_TO_LOG_FILES: path.join(basePath, './Platform/My-Log-Files'),
|
||||||
PATH_TO_PROJECTS_REQUIRED: path.join(basePath, './Projects'),
|
PATH_TO_PROJECTS_REQUIRED: path.join(basePath, './Projects'),
|
||||||
PATH_TO_PROJECT_SCHEMA: path.join(basePath, './Projects/ProjectsSchema.json'),
|
PATH_TO_PROJECT_SCHEMA: path.join(basePath, './Projects/ProjectsSchema.json'),
|
||||||
PATH_TO_CLIENT: path.join(basePath, './Platform'),
|
PATH_TO_PLATFORM: path.join(basePath, './Platform'),
|
||||||
PATH_TO_DESKTOP: './Desktop',
|
PATH_TO_DESKTOP: './Desktop',
|
||||||
PATH_TO_DEFAULT_WORKSPACE: path.join(basePath, './Projects/Foundations/Plugins/Workspaces'),
|
PATH_TO_DEFAULT_WORKSPACE: path.join(basePath, './Projects/Foundations/Plugins/Workspaces'),
|
||||||
PATH_TO_MY_WORKSPACES: path.join(basePath, './Platform/My-Workspaces'),
|
PATH_TO_MY_WORKSPACES: path.join(basePath, './Platform/My-Workspaces'),
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ exports.newHttpInterface = function newHttpInterface() {
|
|||||||
/*
|
/*
|
||||||
We will create an HTTP Server and leave it running forever.
|
We will create an HTTP Server and leave it running forever.
|
||||||
*/
|
*/
|
||||||
SA.nodeModules.http.createServer(onHttpRequest).listen(global.env.CLIENT_HTTP_INTERFACE_PORT)
|
SA.nodeModules.http.createServer(onHttpRequest).listen(global.env.PLATFORM_HTTP_INTERFACE_PORT)
|
||||||
/* Starting the browser now is optional */
|
/* Starting the browser now is optional */
|
||||||
if (process.argv.includes("noBrowser")) {
|
if (process.argv.includes("noBrowser")) {
|
||||||
//Running Client only with no UI.
|
//Running Client only with no UI.
|
||||||
@@ -33,7 +33,7 @@ exports.newHttpInterface = function newHttpInterface() {
|
|||||||
if (initialWorkspace.name !== undefined) {
|
if (initialWorkspace.name !== undefined) {
|
||||||
queryString = '/?initialWorkspaceName=' + initialWorkspace.name + '&initialWorkspaceProject=' + initialWorkspace.project + '&initialWorkspaceType=' + initialWorkspace.type
|
queryString = '/?initialWorkspaceName=' + initialWorkspace.name + '&initialWorkspaceProject=' + initialWorkspace.project + '&initialWorkspaceType=' + initialWorkspace.type
|
||||||
}
|
}
|
||||||
SA.nodeModules.open('http://localhost:' + global.env.CLIENT_HTTP_INTERFACE_PORT + queryString)
|
SA.nodeModules.open('http://localhost:' + global.env.PLATFORM_HTTP_INTERFACE_PORT + queryString)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1311,17 +1311,17 @@ exports.newHttpInterface = function newHttpInterface() {
|
|||||||
break
|
break
|
||||||
case 'LegacyPlotter.js':
|
case 'LegacyPlotter.js':
|
||||||
{
|
{
|
||||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_CLIENT + '/WebServer/LegacyPlotter.js', httpResponse)
|
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_PLATFORM + '/WebServer/LegacyPlotter.js', httpResponse)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'PlotterPanel.js':
|
case 'PlotterPanel.js':
|
||||||
{
|
{
|
||||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_CLIENT + '/WebServer/PlotterPanel.js', httpResponse)
|
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_PLATFORM + '/WebServer/PlotterPanel.js', httpResponse)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'Images': // This means the Images folder.
|
case 'Images': // This means the Images folder.
|
||||||
{
|
{
|
||||||
let path = global.env.PATH_TO_CLIENT + '/WebServer/Images/' + requestPath[2]
|
let path = global.env.PATH_TO_PLATFORM + '/WebServer/Images/' + requestPath[2]
|
||||||
|
|
||||||
if (requestPath[3] !== undefined) {
|
if (requestPath[3] !== undefined) {
|
||||||
path = path + '/' + requestPath[3]
|
path = path + '/' + requestPath[3]
|
||||||
@@ -1403,12 +1403,12 @@ exports.newHttpInterface = function newHttpInterface() {
|
|||||||
break
|
break
|
||||||
case 'WebServer': // This means the WebServer folder.
|
case 'WebServer': // This means the WebServer folder.
|
||||||
{
|
{
|
||||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_CLIENT + '/WebServer/' + requestPath[2], httpResponse)
|
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_PLATFORM + '/WebServer/' + requestPath[2], httpResponse)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'externalScripts': // This means the WebServer folder.
|
case 'externalScripts': // This means the WebServer folder.
|
||||||
{
|
{
|
||||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_CLIENT + '/WebServer/externalScripts/' + requestPath[2], httpResponse)
|
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_PLATFORM + '/WebServer/externalScripts/' + requestPath[2], httpResponse)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'Plotters': // This means the plotter folder, not to be confused with the Plotters script!
|
case 'Plotters': // This means the plotter folder, not to be confused with the Plotters script!
|
||||||
@@ -1423,12 +1423,12 @@ exports.newHttpInterface = function newHttpInterface() {
|
|||||||
break
|
break
|
||||||
case 'ChartLayers':
|
case 'ChartLayers':
|
||||||
{
|
{
|
||||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_CLIENT + '/UI/' + endpointOrFile + '/' + requestPath[2], httpResponse)
|
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_PLATFORM + '/UI/' + endpointOrFile + '/' + requestPath[2], httpResponse)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'Files':
|
case 'Files':
|
||||||
{
|
{
|
||||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_CLIENT + '/UI/Data-Files/' + requestPath[2], httpResponse)
|
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_PLATFORM + '/UI/Data-Files/' + requestPath[2], httpResponse)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'Fonts':
|
case 'Fonts':
|
||||||
@@ -1943,7 +1943,7 @@ exports.newHttpInterface = function newHttpInterface() {
|
|||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SA.projects.foundations.utilities.httpResponses.respondWithWebFile(httpResponse, endpointOrFile, global.env.PATH_TO_CLIENT)
|
SA.projects.foundations.utilities.httpResponses.respondWithWebFile(httpResponse, endpointOrFile, global.env.PATH_TO_PLATFORM)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
const WEB_SOCKET = SA.nodeModules.ws
|
const WEB_SOCKET = SA.nodeModules.ws
|
||||||
let socketServer
|
let socketServer
|
||||||
let port = global.env.CLIENT_WEB_SOCKETS_INTERFACE_PORT
|
let port = global.env.PLATFORM_WEB_SOCKETS_INTERFACE_PORT
|
||||||
|
|
||||||
return thisObject
|
return thisObject
|
||||||
|
|
||||||
|
|||||||
@@ -135,11 +135,11 @@ exports.newPlatformApp = function newPlatformApp() {
|
|||||||
console.log('')
|
console.log('')
|
||||||
WEB_SOCKETS_INTERFACE = WEB_SOCKETS_INTERFACE.newWebSocketsInterface()
|
WEB_SOCKETS_INTERFACE = WEB_SOCKETS_INTERFACE.newWebSocketsInterface()
|
||||||
WEB_SOCKETS_INTERFACE.initialize()
|
WEB_SOCKETS_INTERFACE.initialize()
|
||||||
console.log('Web Sockets Interface ....................................... Listening at port ' + global.env.CLIENT_WEB_SOCKETS_INTERFACE_PORT)
|
console.log('Web Sockets Interface ....................................... Listening at port ' + global.env.PLATFORM_WEB_SOCKETS_INTERFACE_PORT)
|
||||||
|
|
||||||
HTTP_INTERFACE = HTTP_INTERFACE.newHttpInterface()
|
HTTP_INTERFACE = HTTP_INTERFACE.newHttpInterface()
|
||||||
HTTP_INTERFACE.initialize(initialWorkspace)
|
HTTP_INTERFACE.initialize(initialWorkspace)
|
||||||
console.log('Http Interface .............................................. Listening at port ' + global.env.CLIENT_HTTP_INTERFACE_PORT)
|
console.log('Http Interface .............................................. Listening at port ' + global.env.PLATFORM_HTTP_INTERFACE_PORT)
|
||||||
|
|
||||||
console.log('')
|
console.log('')
|
||||||
console.log("You are running Superalgos Beta 12")
|
console.log("You are running Superalgos Beta 12")
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ exports.newDataMiningBotModulesCheckWebhook = function (processIndex) {
|
|||||||
try {
|
try {
|
||||||
let http = SA.nodeModules.http
|
let http = SA.nodeModules.http
|
||||||
let url = 'http://' + global.env.WEB_SERVER_URL +
|
let url = 'http://' + global.env.WEB_SERVER_URL +
|
||||||
':' + global.env.CLIENT_HTTP_INTERFACE_PORT +
|
':' + global.env.PLATFORM_HTTP_INTERFACE_PORT +
|
||||||
'/Webhook/Fetch-Messages/' +
|
'/Webhook/Fetch-Messages/' +
|
||||||
TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.codeName + "/" +
|
TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.codeName + "/" +
|
||||||
TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName + "-" +
|
TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName + "-" +
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
host = 'localhost'
|
host = 'localhost'
|
||||||
}
|
}
|
||||||
if (port === undefined) {
|
if (port === undefined) {
|
||||||
port = global.env.CLIENT_WEB_SOCKETS_INTERFACE_PORT
|
port = global.env.PLATFORM_WEB_SOCKETS_INTERFACE_PORT
|
||||||
}
|
}
|
||||||
|
|
||||||
let messageCounter = 0
|
let messageCounter = 0
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ exports.newDesktopModulesWebSocketsInterface = function newDesktopModulesWebSock
|
|||||||
webApp = {
|
webApp = {
|
||||||
socket: socket
|
socket: socket
|
||||||
}
|
}
|
||||||
console.log('Desktop Web App Connected to Web Sockets Interface ......................... Connected to port ' + global.env.CLIENT_WEB_SOCKETS_INTERFACE_PORT)
|
console.log('Desktop Web App Connected to Web Sockets Interface ......................... Connected to port ' + global.env.PLATFORM_WEB_SOCKETS_INTERFACE_PORT)
|
||||||
|
|
||||||
webApp.socket.on('close', onConnectionClosed)
|
webApp.socket.on('close', onConnectionClosed)
|
||||||
webApp.socket.on('message', onMenssage)
|
webApp.socket.on('message', onMenssage)
|
||||||
@@ -92,7 +92,7 @@ exports.newDesktopModulesWebSocketsInterface = function newDesktopModulesWebSock
|
|||||||
|
|
||||||
function onConnectionClosed() {
|
function onConnectionClosed() {
|
||||||
webApp = undefined
|
webApp = undefined
|
||||||
console.log('Desktop Web App Discoonnected from Web Sockets Interface ................... Disonnected from port ' + global.env.CLIENT_WEB_SOCKETS_INTERFACE_PORT)
|
console.log('Desktop Web App Discoonnected from Web Sockets Interface ................... Disonnected from port ' + global.env.PLATFORM_WEB_SOCKETS_INTERFACE_PORT)
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in new issue
Block a user