Merge pull request #1658 from Luis-Fernando-Molina/develop
Contribution: Client to Platform code reaorg
This commit is contained in:
103 files changed
+3873
-3729
No files matched your search
Vendored
+1
@@ -10,6 +10,7 @@
|
||||
"**/Data-Storage": true,
|
||||
"**/Documentation": true,
|
||||
"**/Log-Files": true,
|
||||
"**/node_modules": true,
|
||||
"**/Deprecated-Code": true
|
||||
},
|
||||
"search.maintainFileSearchCache": true
|
||||
|
||||
Generated
-3552
File diff suppressed because it is too large.
Load diff
+21
-3
@@ -11,11 +11,29 @@ exports.newDesktopApp = function newDesktopApp() {
|
||||
let socialGraphService = NT.projects.network.modules.socialGraph.newSocialGraph()
|
||||
await socialGraphService.initialize()
|
||||
*/
|
||||
|
||||
/*
|
||||
Let's start the Network Interfaces
|
||||
This is the Web Sockets client that interacts with the Superalgos Network.
|
||||
*/
|
||||
DK.webSocketsClient = SA.projects.network.modules.webSocketsClient.newNetworkModulesWebSocketsClient()
|
||||
await DK.webSocketsClient.initialize()
|
||||
//DK.webSocketsClient = SA.projects.network.modules.webSocketsClient.newNetworkModulesWebSocketsClient()
|
||||
//await DK.webSocketsClient.initialize()
|
||||
|
||||
/* These are the Network Interfaces by which the UI interacts with the Desktop App.*/
|
||||
//let WEB_SOCKETS_INTERFACE = require('./webSocketsInterface.js')
|
||||
let HTTP_INTERFACE = require('./httpInterface.js')
|
||||
|
||||
/*
|
||||
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)
|
||||
*/
|
||||
|
||||
HTTP_INTERFACE = HTTP_INTERFACE.newHttpInterface()
|
||||
HTTP_INTERFACE.initialize()
|
||||
console.log('Http Interface .............................................. Listening at port ' + global.env.DESKTOP_HTTP_INTERFACE_PORT)
|
||||
|
||||
return
|
||||
|
||||
|
||||
let queryMessage
|
||||
let query
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,34 @@
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Saira';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Saira Light'), local('Saira-Light'), url(Fonts/Saira.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Saira Condensed';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Saira Condensed Light'), local('SairaCondensed-Light'), url(Fonts/Saira-Condensed.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: segoeui;
|
||||
src: url(Fonts/segoeui.woff) format('woff');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
kbd {
|
||||
padding: 2px 8px;
|
||||
font-size: 125%;
|
||||
font-weight: 500;
|
||||
color: #000;
|
||||
background-color: #bcd643;
|
||||
border-radius: 5px;
|
||||
border-style: outset;
|
||||
border-width: 1px;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Superalgos Desktop</title>
|
||||
<meta name="description" content="Free and Open Source Crypto Social Trading">
|
||||
<link rel="stylesheet" href="main.css" type="text/css" charset="utf-8" />
|
||||
<link rel="shortcut icon" type="image/png/ico" href="Images/favicon.ico" />
|
||||
<script type="text/javascript" src="WebServer/require.js"></script>
|
||||
<script type="text/javascript" src="AppPreLoader.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function loadApp() {
|
||||
// Prevent click-jacking
|
||||
try {
|
||||
if (window == window.top || window.chrome && chrome.app && chrome.app.window) {
|
||||
document.documentElement.style.display = 'block'
|
||||
} else {
|
||||
top.location = self.location
|
||||
}
|
||||
} catch (e) { console.error('CJ protection', e) }
|
||||
|
||||
try {
|
||||
loadSuperalgos()
|
||||
} catch (err) {
|
||||
console.log("[ERROR] UI can not be started. Please check that WebServer is running.", err);
|
||||
}
|
||||
}
|
||||
|
||||
function onResize() {
|
||||
try {
|
||||
if (page === undefined) { return }
|
||||
if (page.eventHandler === undefined) { return }
|
||||
if (DISABLE_BROWSER_RESIZE_EVENT === true) { return }
|
||||
page.eventHandler.raiseEvent('Browser Resized')
|
||||
} catch (err) {
|
||||
console.log('Error Resizing. ' + err.stack)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body id="body" onload="loadApp()"
|
||||
onresize="onResize()">
|
||||
Hello World!
|
||||
<div id="masterApp"></div>
|
||||
<div id="canvasApp"></div>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
File renamed without changes.
@@ -19,12 +19,12 @@ 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.DESKTOP_HTTP_INTERFACE_PORT)
|
||||
/* Starting the browser now is optional */
|
||||
if (process.argv.includes("noBrowser")) {
|
||||
//Running Client only with no UI.
|
||||
} else {
|
||||
SA.nodeModules.open('http://localhost:' + global.env.CLIENT_HTTP_INTERFACE_PORT)
|
||||
SA.nodeModules.open('http://localhost:' + global.env.DESKTOP_HTTP_INTERFACE_PORT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,14 +35,30 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
let endpointOrFile = requestPath[1]
|
||||
|
||||
switch (endpointOrFile) {
|
||||
case 'XXX':
|
||||
case 'Images': // This means the Images folder.
|
||||
{
|
||||
let path = global.env.PATH_TO_CLIENT + '/WebServer/Images/' + requestPath[2]
|
||||
|
||||
if (requestPath[3] !== undefined) {
|
||||
path = path + '/' + requestPath[3]
|
||||
}
|
||||
|
||||
if (requestPath[4] !== undefined) {
|
||||
path = path + '/' + requestPath[4]
|
||||
}
|
||||
|
||||
if (requestPath[5] !== undefined) {
|
||||
path = path + '/' + requestPath[5]
|
||||
}
|
||||
|
||||
path = unescape(path)
|
||||
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithImage(path, httpResponse)
|
||||
}
|
||||
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_DESKTOP)
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
+2
-4
@@ -10,12 +10,10 @@ exports.newEnvironment = function () {
|
||||
PATH_TO_LOG_FILES: './Log-Files',
|
||||
PATH_TO_PROJECTS_REQUIRED: './Projects',
|
||||
PATH_TO_PROJECT_SCHEMA: '../Projects/ProjectsSchema.json',
|
||||
PATH_TO_UI: './UI',
|
||||
PATH_TO_DATA_FILES: './UI/Data-Files/src',
|
||||
PATH_TO_CLIENT: './Client/',
|
||||
PATH_TO_CLIENT: './Platform',
|
||||
PATH_TO_DEFAULT_WORKSPACE: './Projects/Foundations/Plugins/Workspaces',
|
||||
PATH_TO_MY_WORKSPACES: './My-Workspaces',
|
||||
PATH_TO_FONTS: './Client/WebServer/Fonts'
|
||||
PATH_TO_FONTS: './Platform/WebServer/Fonts'
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
@@ -12,12 +12,11 @@ exports.newEnvironment = function () {
|
||||
PATH_TO_LOG_FILES: './Log-Files',
|
||||
PATH_TO_PROJECTS_REQUIRED: './Projects',
|
||||
PATH_TO_PROJECT_SCHEMA: './Projects/ProjectsSchema.json',
|
||||
PATH_TO_UI: './UI',
|
||||
PATH_TO_DATA_FILES: './UI/Data-Files/src',
|
||||
PATH_TO_CLIENT: './Client/',
|
||||
PATH_TO_CLIENT: './Platform',
|
||||
PATH_TO_DESKTOP: './Desktop',
|
||||
PATH_TO_DEFAULT_WORKSPACE: './Projects/Foundations/Plugins/Workspaces',
|
||||
PATH_TO_MY_WORKSPACES: './My-Workspaces',
|
||||
PATH_TO_FONTS: './Client/WebServer/Fonts'
|
||||
PATH_TO_FONTS: './Platform/WebServer/Fonts'
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
Vendored
+1
@@ -10,6 +10,7 @@
|
||||
"**/Data-Storage": true,
|
||||
"**/Documentation": true,
|
||||
"**/Log-Files": true,
|
||||
"**/node_modules": true,
|
||||
"**/Deprecated-Code": true
|
||||
},
|
||||
"search.maintainFileSearchCache": true
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1075,17 +1075,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_CLIENT + '/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_CLIENT + '/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_CLIENT + '/WebServer/Images/' + requestPath[2]
|
||||
|
||||
if (requestPath[3] !== undefined) {
|
||||
path = path + '/' + requestPath[3]
|
||||
@@ -1165,19 +1165,14 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithImage(path, httpResponse)
|
||||
}
|
||||
break
|
||||
case 'favicon.ico': // This means the Scripts folder.
|
||||
{
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithImage(global.env.PATH_TO_CLIENT + 'WebServer/Images/' + 'favicon.ico', httpResponse)
|
||||
}
|
||||
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_CLIENT + '/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_CLIENT + '/WebServer/externalScripts/' + requestPath[2], httpResponse)
|
||||
}
|
||||
break
|
||||
case 'Plotters': // This means the plotter folder, not to be confused with the Plotters script!
|
||||
@@ -1192,12 +1187,12 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
break
|
||||
case 'ChartLayers':
|
||||
{
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_UI + '/' + endpointOrFile + '/' + requestPath[2], httpResponse)
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_CLIENT + '/UI/' + endpointOrFile + '/' + requestPath[2], httpResponse)
|
||||
}
|
||||
break
|
||||
case 'Files':
|
||||
{
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_DATA_FILES + '/' + requestPath[2], httpResponse)
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_CLIENT + '/UI/Data-Files/' + requestPath[2], httpResponse)
|
||||
}
|
||||
break
|
||||
case 'Fonts':
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -42,8 +42,8 @@
|
||||
if (LOG_INFO === true) {
|
||||
console.log('Message Received: ' + message.substring(0, 1000))
|
||||
}
|
||||
|
||||
let messageArray = message.split('|*|')
|
||||
|
||||
let messageArray = message.toString().split('|*|')
|
||||
|
||||
let origin = messageArray[0]
|
||||
let nonce = messageArray[1]
|
||||
@@ -6,24 +6,24 @@ global.env = ENVIRONMENT_MODULE
|
||||
|
||||
process.on('uncaughtException', function (err) {
|
||||
if (err.message && err.message.indexOf("EADDRINUSE") > 0) {
|
||||
console.log("A Superalgos Client cannot be started. Reason: the port configured migth be being used by another application, or Superalgos might be already running.")
|
||||
console.log("The Superalgos Platform Client cannot be started. Reason: the port configured migth be being used by another application, or Superalgos Platform Client might be already running.")
|
||||
return
|
||||
}
|
||||
console.log('[ERROR] Client -> client-> uncaughtException -> err.message = ' + err.message)
|
||||
console.log('[ERROR] Client -> client-> uncaughtException -> err.stack = ' + err.stack)
|
||||
console.log('[ERROR] Client -> client-> uncaughtException -> err = ' + err)
|
||||
console.log('[ERROR] Platform App -> uncaughtException -> err.message = ' + err.message)
|
||||
console.log('[ERROR] Platform App -> uncaughtException -> err.stack = ' + err.stack)
|
||||
console.log('[ERROR] Platform App -> uncaughtException -> err = ' + err)
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
process.on('unhandledRejection', (reason, p) => {
|
||||
// Signal user that a necissary node module is missing
|
||||
if (reason.code == 'MODULE_NOT_FOUND') {
|
||||
console.log("[ERROR] Dependency library not found. Please try running the 'node setup' command and then restart the Client.")
|
||||
console.log('[ERROR] Client -> client-> reason = ' + JSON.stringify(reason))
|
||||
console.log("[ERROR] Dependency library not found. Please try running the 'node setup' command and then restart the Superalgos Platform Client.")
|
||||
console.log('[ERROR] Platform App -> reason = ' + JSON.stringify(reason))
|
||||
process.exit(1)
|
||||
}
|
||||
console.log('[ERROR] Client -> client-> unhandledRejection -> reason = ' + JSON.stringify(reason))
|
||||
console.log('[ERROR] Client -> client-> unhandledRejection -> p = ' + JSON.stringify(p))
|
||||
console.log('[ERROR] Platform App -> unhandledRejection -> reason = ' + JSON.stringify(reason))
|
||||
console.log('[ERROR] Platform App -> unhandledRejection -> p = ' + JSON.stringify(p))
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
@@ -55,20 +55,20 @@ global.CUSTOM_FAIL_RESPONSE = {
|
||||
}
|
||||
|
||||
/* Servers */
|
||||
let WEB_SERVER = require('./webServer.js')
|
||||
let DATA_FILE_SERVER = require('./dataFileServer.js')
|
||||
let PROJECT_FILE_SERVER = require('./projectFileServer.js')
|
||||
let UI_FILE_SERVER = require('./uiFileServer.js')
|
||||
let PLUGIN_SERVER = require('./pluginServer.js')
|
||||
let EVENT_SERVER = require('./eventServer.js')
|
||||
let TASK_MANAGER_SERVER = require('./taskManagerServer.js')
|
||||
let CCXT_SERVER = require('./ccxtServer.js')
|
||||
let WEB3_SERVER = require('./web3Server.js')
|
||||
let GITHUB_SERVER = require('./githubServer.js')
|
||||
let WEB_SERVER = require('./Client/webServer.js')
|
||||
let DATA_FILE_SERVER = require('./Client/dataFileServer.js')
|
||||
let PROJECT_FILE_SERVER = require('./Client/projectFileServer.js')
|
||||
let UI_FILE_SERVER = require('./Client/uiFileServer.js')
|
||||
let PLUGIN_SERVER = require('./Client/pluginServer.js')
|
||||
let EVENT_SERVER = require('./Client/eventServer.js')
|
||||
let TASK_MANAGER_SERVER = require('./Client/taskManagerServer.js')
|
||||
let CCXT_SERVER = require('./Client/ccxtServer.js')
|
||||
let WEB3_SERVER = require('./Client/web3Server.js')
|
||||
let GITHUB_SERVER = require('./Client/githubServer.js')
|
||||
|
||||
/* Network Interfaces */
|
||||
let WEB_SOCKETS_INTERFACE = require('./webSocketsInterface.js')
|
||||
let HTTP_INTERFACE = require('./httpInterface.js')
|
||||
let WEB_SOCKETS_INTERFACE = require('./Client/webSocketsInterface.js')
|
||||
let HTTP_INTERFACE = require('./Client/httpInterface.js')
|
||||
|
||||
try {
|
||||
/*
|
||||
@@ -97,7 +97,7 @@ try {
|
||||
*/
|
||||
SA.nodeModules = {
|
||||
fs: require('fs'),
|
||||
nodeFetch: require('node-fetch'),
|
||||
nodeFetch: import('node-fetch'),
|
||||
open: require('open'),
|
||||
http: require('http'),
|
||||
ccxt: require('ccxt')
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,190 @@
|
||||
let postLoader
|
||||
|
||||
function newAppLoader() {
|
||||
const MODULE_NAME = 'App Loader'
|
||||
const INFO_LOG = false
|
||||
const ERROR_LOG = true
|
||||
const logger = newWebDebugLog()
|
||||
|
||||
|
||||
let thisObject = {
|
||||
loadModules: loadModules
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
async function loadModules() {
|
||||
try {
|
||||
if (INFO_LOG === true) { logger.write('[INFO] loadModules -> Entering function.') }
|
||||
|
||||
let plotters
|
||||
let modulesArray = []
|
||||
|
||||
plotters = defaultPlotters()
|
||||
|
||||
modulesArray = modulesArray.concat([
|
||||
|
||||
'Globals.js',
|
||||
'Workspace.js',
|
||||
|
||||
'Files/SingleFile.js',
|
||||
'Files/FileCloud.js',
|
||||
'Files/MarketFiles.js',
|
||||
'Files/DailyFiles.js',
|
||||
'Files/FileCursor.js',
|
||||
'Files/FileSequence.js',
|
||||
'Files/FileStorage.js',
|
||||
|
||||
'EventsServerClient.js',
|
||||
|
||||
'LegacyPlotter.js',
|
||||
'PlotterPanel.js',
|
||||
|
||||
'VideoRecorder.js',
|
||||
'ProductStorage.js',
|
||||
'Canvas.js',
|
||||
'EventHandler.js',
|
||||
'Frame.js',
|
||||
'Animation.js',
|
||||
'Container.js',
|
||||
'Utilities.js',
|
||||
'AppPostLoader.js'
|
||||
])
|
||||
|
||||
modulesArray = modulesArray.concat(plotters)
|
||||
|
||||
functionLibraries()
|
||||
|
||||
function functionLibraries() {
|
||||
let url = 'ListFunctionLibraries'
|
||||
httpRequest(undefined, url, onResponse)
|
||||
|
||||
function onResponse(err, fileList) {
|
||||
let urlArray = []
|
||||
let fileArray = JSON.parse(fileList)
|
||||
for (let i = 0; i < fileArray.length; i++) {
|
||||
let item = fileArray[i]
|
||||
|
||||
project = item[0]
|
||||
fileName = item[1]
|
||||
urlArray.push('Projects' + '/' + project + '/' + 'UI' + '/' + 'Function-Libraries' + '/' + fileName)
|
||||
}
|
||||
|
||||
modulesArray = modulesArray.concat(urlArray)
|
||||
utilities()
|
||||
}
|
||||
}
|
||||
|
||||
function utilities() {
|
||||
let url = 'ListUtilitiesFiles'
|
||||
httpRequest(undefined, url, onResponse)
|
||||
|
||||
function onResponse(err, fileList) {
|
||||
let urlArray = []
|
||||
let fileArray = JSON.parse(fileList)
|
||||
for (let i = 0; i < fileArray.length; i++) {
|
||||
let item = fileArray[i]
|
||||
|
||||
project = item[0]
|
||||
fileName = item[1]
|
||||
urlArray.push('Projects' + '/' + project + '/' + 'UI' + '/' + 'Utilities' + '/' + fileName)
|
||||
}
|
||||
|
||||
modulesArray = modulesArray.concat(urlArray)
|
||||
globals()
|
||||
}
|
||||
}
|
||||
|
||||
function globals() {
|
||||
let url = 'ListGlobalFiles'
|
||||
httpRequest(undefined, url, onResponse)
|
||||
|
||||
function onResponse(err, fileList) {
|
||||
let urlArray = []
|
||||
let fileArray = JSON.parse(fileList)
|
||||
for (let i = 0; i < fileArray.length; i++) {
|
||||
let item = fileArray[i]
|
||||
|
||||
project = item[0]
|
||||
fileName = item[1]
|
||||
urlArray.push('Projects' + '/' + project + '/' + 'UI' + '/' + 'Globals' + '/' + fileName)
|
||||
}
|
||||
|
||||
modulesArray = modulesArray.concat(urlArray)
|
||||
spaces()
|
||||
}
|
||||
}
|
||||
|
||||
function spaces() {
|
||||
let url = 'ListSpaceFiles'
|
||||
httpRequest(undefined, url, onResponse)
|
||||
|
||||
function onResponse(err, fileList) {
|
||||
let urlArray = []
|
||||
let fileArray = JSON.parse(fileList)
|
||||
for (let i = 0; i < fileArray.length; i++) {
|
||||
let path = fileArray[i]
|
||||
urlArray.push('Projects' + '/' + path)
|
||||
}
|
||||
|
||||
modulesArray = modulesArray.concat(urlArray)
|
||||
downloadIncludedFiles()
|
||||
}
|
||||
}
|
||||
|
||||
function downloadIncludedFiles() {
|
||||
|
||||
let downloadedCounter = 0
|
||||
|
||||
for (let i = 0; i < modulesArray.length; i++) {
|
||||
let path = modulesArray[i]
|
||||
|
||||
REQUIREJS([path], onRequired)
|
||||
|
||||
if (INFO_LOG === true) { logger.write('[INFO] loadModules -> Module Requested.') }
|
||||
if (INFO_LOG === true) { logger.write('[INFO] loadModules -> path = ' + path) }
|
||||
if (INFO_LOG === true) { logger.write('[INFO] loadModules -> total requested = ' + (i + 1)) }
|
||||
|
||||
function onRequired(pModule) {
|
||||
try {
|
||||
if (INFO_LOG === true) { logger.write('[INFO] loadModules -> onRequired -> Entering function.') }
|
||||
if (INFO_LOG === true) { logger.write('[INFO] loadModules -> onRequired -> Module Downloaded.') }
|
||||
if (INFO_LOG === true) { logger.write('[INFO] loadModules -> onRequired -> path = ' + path) }
|
||||
|
||||
downloadedCounter++
|
||||
|
||||
if (INFO_LOG === true) { logger.write('[INFO] loadModules -> onRequired -> downloadedCounter = ' + downloadedCounter) }
|
||||
|
||||
if (downloadedCounter === modulesArray.length) {
|
||||
if (INFO_LOG === true) { logger.write('[INFO] loadModules -> onRequired -> Starting Advanced Algos Platform.') }
|
||||
setTimeout(() => {
|
||||
postLoader = newAppPostLoader()
|
||||
postLoader.start()
|
||||
}, 500)
|
||||
|
||||
}
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] loadModules -> onRequired -> err = ' + err.stack) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] loadModules -> err = ' + err.stack) }
|
||||
}
|
||||
}
|
||||
|
||||
function defaultPlotters() {
|
||||
return [
|
||||
'Plotters/Foundations/Candles/Plotters-Candles-Volumes/Candles.js',
|
||||
'Plotters/Foundations/Candles/Plotters-Candles-Volumes/CandlePanel.js',
|
||||
'Plotters/Foundations/Candles/Plotters-Candles-Volumes/Volumes.js',
|
||||
'Plotters/Foundations/Candles/Plotters-Candles-Volumes/VolumePanel.js',
|
||||
'Plotters/Foundations/Bollinger/Plotters-Bollinger-Bands/BollingerBands.js',
|
||||
'Plotters/Foundations/Bollinger/Plotters-Bollinger-Bands/BollingerBandsPanel.js',
|
||||
'Plotters/Foundations/Bollinger/Plotters-Bollinger-Bands/PercentageBandwidth.js'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -2,7 +2,7 @@
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Superalgos</title>
|
||||
<title>Superalgos Platform</title>
|
||||
<meta name="description" content="Free and Open Source Crypto Trading Tools">
|
||||
<link rel="stylesheet" href="main.css" type="text/css" charset="utf-8" />
|
||||
<link rel="stylesheet" href="credits.css" type="text/css" charset="utf-8" />
|
||||
@@ -18,11 +18,8 @@
|
||||
<script src="externalScripts/CCapture.all.min.js"></script>
|
||||
<script src="externalScripts/prism.js"></script>
|
||||
|
||||
<!-- Documentation Style Sheets -->
|
||||
<!-- -->
|
||||
|
||||
<script type="text/javascript">
|
||||
function loadCanvas() {
|
||||
function loadApp() {
|
||||
// Prevent click-jacking
|
||||
try {
|
||||
if (window == window.top || window.chrome && chrome.app && chrome.app.window) {
|
||||
@@ -109,7 +106,7 @@
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body id="body" onload="loadCanvas()"
|
||||
<body id="body" onload="loadApp()"
|
||||
style="overflow:hidden; background: url(Images/superalgos-platform.jpg); background-size: cover;"
|
||||
onresize="onResize()">
|
||||
<div id="splash-text" class="credits">
|
||||
File diff suppressed because it is too large.
Load diff
Generated
+1206
File diff suppressed because it is too large.
Load diff
@@ -13,12 +13,12 @@
|
||||
"ethereumjs-common": "^1.5.2",
|
||||
"ethereumjs-tx": "^2.1.2",
|
||||
"ethers": "^5.4.4",
|
||||
"http": "0.0.1-security",
|
||||
"lookpath": "^1.2.2",
|
||||
"node-fetch": "2.6.1",
|
||||
"open": "^6.4.0",
|
||||
"node-fetch": "^3.0.0",
|
||||
"open": "^8.2.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"simple-git": "^2.42.0",
|
||||
"web3": "^1.5.0",
|
||||
"ws": "^7.4.6"
|
||||
"ws": "^8.2.1"
|
||||
}
|
||||
}
|
||||
@@ -113,9 +113,9 @@ exports.newFoundationsUtilitiesHttpResponses = function () {
|
||||
httpResponse.end('\n')
|
||||
}
|
||||
|
||||
function respondWithStyleSheet(httpResponse, path, fileName) {
|
||||
function respondWithStyleSheet(httpResponse, pathToApp, fileName) {
|
||||
let fs = SA.nodeModules.fs
|
||||
let filePath = path + 'WebServer/css/' + fileName
|
||||
let filePath = pathToApp + '/WebServer/css/' + fileName
|
||||
fs.readFile(filePath, onFileRead)
|
||||
|
||||
function onFileRead(err, file) {
|
||||
@@ -173,7 +173,7 @@ exports.newFoundationsUtilitiesHttpResponses = function () {
|
||||
}
|
||||
}
|
||||
|
||||
function respondWithWebFile(httpResponse, fileNameReceived, path) {
|
||||
function respondWithWebFile(httpResponse, fileNameReceived, pathToApp) {
|
||||
|
||||
if (fileNameReceived === '') {
|
||||
/*
|
||||
@@ -181,7 +181,8 @@ exports.newFoundationsUtilitiesHttpResponses = function () {
|
||||
*/
|
||||
let fs = SA.nodeModules.fs
|
||||
|
||||
let fileName = path + 'WebServer/index.html'
|
||||
let fileName = pathToApp + '/WebServer/index.html'
|
||||
|
||||
fs.readFile(fileName, onFileRead)
|
||||
|
||||
function onFileRead(err, file) {
|
||||
@@ -200,12 +201,12 @@ exports.newFoundationsUtilitiesHttpResponses = function () {
|
||||
|
||||
switch (fileExtension) {
|
||||
case 'js': {
|
||||
let path = global.env.PATH_TO_UI + '/' + completeFileName
|
||||
let path = pathToApp + '/UI/' + completeFileName
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(path, httpResponse)
|
||||
break
|
||||
}
|
||||
case 'css': {
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithStyleSheet(httpResponse, path, completeFileName)
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithStyleSheet(httpResponse, pathToApp, completeFileName)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -10,6 +10,7 @@
|
||||
"**/Data-Storage": true,
|
||||
"**/Documentation": true,
|
||||
"**/Log-Files": true,
|
||||
"**/node_modules": true,
|
||||
"**/Deprecated-Code": true
|
||||
},
|
||||
"search.maintainFileSearchCache": true
|
||||
|
||||
@@ -42,7 +42,9 @@ Setting up external dependencies.
|
||||
SA.nodeModules = {
|
||||
fs: require('fs'),
|
||||
web3: require('web3'),
|
||||
ws: require('ws')
|
||||
ws: require('ws'),
|
||||
open: require('open'),
|
||||
http: require('http')
|
||||
}
|
||||
|
||||
/*
|
||||
File renamed without changes.
Generated
+33
@@ -784,6 +784,11 @@
|
||||
"resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz",
|
||||
"integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ=="
|
||||
},
|
||||
"define-lazy-prop": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz",
|
||||
"integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og=="
|
||||
},
|
||||
"define-properties": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
|
||||
@@ -1379,6 +1384,11 @@
|
||||
"minimalistic-crypto-utils": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"http": {
|
||||
"version": "0.0.1-security",
|
||||
"resolved": "https://registry.npmjs.org/http/-/http-0.0.1-security.tgz",
|
||||
"integrity": "sha512-RnDvP10Ty9FxqOtPZuxtebw1j4L/WiqNMDtuc1YMH1XQm5TgDRaR1G9u8upL6KD1bXHSp9eSXo/ED+8Q7FAr+g=="
|
||||
},
|
||||
"http-cache-semantics": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz",
|
||||
@@ -1505,6 +1515,11 @@
|
||||
"has-tostringtag": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"is-docker": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
|
||||
"integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ=="
|
||||
},
|
||||
"is-function": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz",
|
||||
@@ -1598,6 +1613,14 @@
|
||||
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
|
||||
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
|
||||
},
|
||||
"is-wsl": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
|
||||
"integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
|
||||
"requires": {
|
||||
"is-docker": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"isstream": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
|
||||
@@ -1948,6 +1971,16 @@
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"open": {
|
||||
"version": "8.2.1",
|
||||
"resolved": "https://registry.npmjs.org/open/-/open-8.2.1.tgz",
|
||||
"integrity": "sha512-rXILpcQlkF/QuFez2BJDf3GsqpjGKbkUUToAIGo9A0Q6ZkoSGogZJulrUdwRkrAsoQvoZsrjCYt8+zblOk7JQQ==",
|
||||
"requires": {
|
||||
"define-lazy-prop": "^2.0.0",
|
||||
"is-docker": "^2.1.1",
|
||||
"is-wsl": "^2.2.0"
|
||||
}
|
||||
},
|
||||
"p-cancelable": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz",
|
||||
|
||||
Loaded 100 of 103 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user