Refactoring CLIENT PLATFORM

This commit is contained in:
Luis Fernando Molina committed 2021-10-20 11:40:01 +02:00
1 parent 7c078b286f
commit fd7f970304
8 files changed
+21 -21

No files matched your search

+1 -1
View File
@@ -29,7 +29,7 @@ exports.newDesktopApp = function newDesktopApp() {
DK.running.webSocketsInterface = DK.projects.socialTrading.modules.webSocketsInterface.newDesktopModulesWebSocketsInterface()
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()
+3 -3
View File
@@ -10,18 +10,18 @@ exports.newEnvironment = function () {
let thisObject = {
BASE_PATH: basePath,
WEB_SERVER_URL: 'localhost',
CLIENT_WEB_SOCKETS_INTERFACE_PORT: 18041,
PLATFORM_WEB_SOCKETS_INTERFACE_PORT: 18041,
NETWORK_WEB_SOCKETS_INTERFACE_PORT: 18042,
DESKTOP_WEB_SOCKETS_INTERFACE_PORT: 18043,
DESKTOP_WEB_SOCKETS_INTERFACE_HOST: 'localhost',
CLIENT_HTTP_INTERFACE_PORT: 34248,
PLATFORM_HTTP_INTERFACE_PORT: 34248,
DESKTOP_HTTP_INTERFACE_PORT: 34249,
PATH_TO_DATA_STORAGE: path.join(basePath, './Platform/My-Data-Storage'),
PATH_TO_PROJECTS: path.join(basePath, './Projects'),
PATH_TO_LOG_FILES: path.join(basePath, './Platform/My-Log-Files'),
PATH_TO_PROJECTS_REQUIRED: path.join(basePath, './Projects'),
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_DEFAULT_WORKSPACE: path.join(basePath, './Projects/Foundations/Plugins/Workspaces'),
PATH_TO_MY_WORKSPACES: path.join(basePath, './Platform/My-Workspaces'),
+10 -10
View File
@@ -24,7 +24,7 @@ exports.newHttpInterface = function newHttpInterface() {
/*
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 */
if (process.argv.includes("noBrowser")) {
//Running Client only with no UI.
@@ -33,7 +33,7 @@ exports.newHttpInterface = function newHttpInterface() {
if (initialWorkspace.name !== undefined) {
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
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
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
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) {
path = path + '/' + requestPath[3]
@@ -1403,12 +1403,12 @@ exports.newHttpInterface = function newHttpInterface() {
break
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
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
case 'Plotters': // This means the plotter folder, not to be confused with the Plotters script!
@@ -1423,12 +1423,12 @@ exports.newHttpInterface = function newHttpInterface() {
break
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
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
case 'Fonts':
@@ -1943,7 +1943,7 @@ exports.newHttpInterface = function newHttpInterface() {
break
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) {
+1 -1
View File
@@ -9,7 +9,7 @@
const WEB_SOCKET = SA.nodeModules.ws
let socketServer
let port = global.env.CLIENT_WEB_SOCKETS_INTERFACE_PORT
let port = global.env.PLATFORM_WEB_SOCKETS_INTERFACE_PORT
return thisObject
+2 -2
View File
@@ -135,11 +135,11 @@ exports.newPlatformApp = function newPlatformApp() {
console.log('')
WEB_SOCKETS_INTERFACE = WEB_SOCKETS_INTERFACE.newWebSocketsInterface()
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.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("You are running Superalgos Beta 12")
@@ -90,7 +90,7 @@ exports.newDataMiningBotModulesCheckWebhook = function (processIndex) {
try {
let http = SA.nodeModules.http
let url = 'http://' + global.env.WEB_SERVER_URL +
':' + global.env.CLIENT_HTTP_INTERFACE_PORT +
':' + global.env.PLATFORM_HTTP_INTERFACE_PORT +
'/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.baseAsset.referenceParent.config.codeName + "-" +
@@ -24,7 +24,7 @@
host = 'localhost'
}
if (port === undefined) {
port = global.env.CLIENT_WEB_SOCKETS_INTERFACE_PORT
port = global.env.PLATFORM_WEB_SOCKETS_INTERFACE_PORT
}
let messageCounter = 0
@@ -45,7 +45,7 @@ exports.newDesktopModulesWebSocketsInterface = function newDesktopModulesWebSock
webApp = {
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('message', onMenssage)
@@ -92,7 +92,7 @@ exports.newDesktopModulesWebSocketsInterface = function newDesktopModulesWebSock
function onConnectionClosed() {
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) {