Changes to make it work locally
This commit is contained in:
1 parent
643fa858a8
commit
ed97e9ad46
5 files changed
+37
-79
No files matched your search
@@ -43,6 +43,7 @@
|
||||
<Compile Include="server.js" />
|
||||
<Compile Include="Server\FileCloud.js" />
|
||||
<Content Include=".env" />
|
||||
<Content Include="ecosystem.json" />
|
||||
<Content Include="index.html" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
+25
-15
@@ -19,21 +19,31 @@ function newAppLoader() {
|
||||
|
||||
window.localStorage.removeItem('ecosystem')
|
||||
|
||||
let plotters, modulesArray
|
||||
let ecosystem = await loadEcosystem()
|
||||
if (ecosystem) {
|
||||
window.localStorage.setItem('ecosystem', JSON.stringify(ecosystem))
|
||||
plotters = getPlotters(ecosystem)
|
||||
let plotters
|
||||
let modulesArray = []
|
||||
|
||||
if (window.canvasApp.executingAt !== 'Local') {
|
||||
let ecosystem = await loadEcosystem()
|
||||
if (ecosystem) {
|
||||
window.localStorage.setItem('ecosystem', JSON.stringify(ecosystem))
|
||||
plotters = getPlotters(ecosystem)
|
||||
} else {
|
||||
plotters = defaultPlotters()
|
||||
modulesArray = ['UserEcosystem.js']
|
||||
}
|
||||
} else {
|
||||
plotters = defaultPlotters()
|
||||
modulesArray = ['UserEcosystem.js']
|
||||
}
|
||||
|
||||
|
||||
|
||||
modulesArray = modulesArray.concat([
|
||||
'ChartsSpace/ViewPort.js',
|
||||
|
||||
'Globals.js',
|
||||
'Ecosystem.js',
|
||||
'UserEcosystem.js',
|
||||
'MQService',
|
||||
|
||||
'ChartsSpace/ChartUtilities.js',
|
||||
@@ -316,30 +326,30 @@ function newAppLoader() {
|
||||
function defaultPlotters() {
|
||||
return [
|
||||
'Plotters/AAMasters/Plotters-Candles-Volumes/Candles.js',
|
||||
'PlotterPanels/AAMasters/Plotters-Candles-Volumes/CandlePanel.js',
|
||||
'Plotters/AAMasters/Plotters-Candles-Volumes/CandlePanel.js',
|
||||
'Plotters/AAMasters/Plotters-Candles-Volumes/Volumes.js',
|
||||
'PlotterPanels/AAMasters/Plotters-Candles-Volumes/VolumePanel.js',
|
||||
'Plotters/AAMasters/Plotters-Candles-Volumes/VolumePanel.js',
|
||||
'Plotters/AAMasters/Plotters-Stairs-Patterns/CandleStairs.js',
|
||||
'Plotters/AAMasters/Plotters-Stairs-Patterns/VolumeStairs.js',
|
||||
'Plotters/AAMasters/Plotters-Trading/Details.js',
|
||||
'Plotters/AAMasters/Plotters-Trading/History.js',
|
||||
'Plotters/AAMasters/Plotters-Bollinger-Bands/BollingerBands.js',
|
||||
'PlotterPanels/AAMasters/Plotters-Bollinger-Bands/BollingerBandsPanel.js',
|
||||
'Plotters/AAMasters/Plotters-Bollinger-Bands/BollingerBandsPanel.js',
|
||||
'Plotters/AAMasters/Plotters-Bollinger-Bands/PercentageBandwidth.js',
|
||||
'Plotters/AAMasters/Plotters-Trading-Simulation/TradingSimulation.js',
|
||||
'PlotterPanels/AAMasters/Plotters-Trading-Simulation/TradingSimulationPanel.js',
|
||||
'Plotters/AAMasters/Plotters-Trading-Simulation/TradingSimulationPanel.js',
|
||||
'Plotters/AAMasters/Plotters-Trading-Simulation/Conditions.js',
|
||||
'Plotters/AAMasters/Plotters-Trading-Simulation/Strategies.js',
|
||||
'Plotters/AAMasters/Plotters-Trading-Simulation/Trades.js',
|
||||
'Plotters/AAMasters/Plotters-Trading-Simulation/SimulationExecution.js',
|
||||
'PlotterPanels/AAMasters/Plotters-Trading-Simulation/SimulationExecutionPanel.js',
|
||||
'Plotters/AAMasters/Plotters-Trading-Simulation/SimulationExecutionPanel.js',
|
||||
'Plotters/AAMasters/Plotters-Bollinger-Channels/BollingerChannels.js',
|
||||
'PlotterPanels/AAMasters/Plotters-Bollinger-Channels/ChannelPanel.js',
|
||||
'Plotters/AAMasters/Plotters-Bollinger-Channels/ChannelPanel.js',
|
||||
'Plotters/AAMasters/Plotters-Bollinger-Channels/BollingerSubChannels.js',
|
||||
'PlotterPanels/AAMasters/Plotters-Bollinger-Channels/SubChannelPanel.js',
|
||||
'Plotters/AAVikings/Plotters-Linear-Regression-Curve/LRC.js',
|
||||
'PlotterPanels/AAVikings/Plotters-Linear-Regression-Curve/ChannelPanel.js',
|
||||
'Plotters/AAMasters/Plotters-ROI/CombinedProfits.js'
|
||||
'Plotters/AAMasters/Plotters-Bollinger-Channels/SubChannelPanel.js',
|
||||
// 'Plotters/AAVikings/plotters/Plotters-Linear-Regression-Curve/LRC.js',
|
||||
// 'Plotters/AAVikings/plotters/Plotters-Linear-Regression-Curve/ChannelPanel.js',
|
||||
'Plotters/AAArena/Plotters-ROI/CombinedProfits.js'
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
+1
-54
@@ -1200,59 +1200,6 @@
|
||||
}
|
||||
],
|
||||
"hosts": [
|
||||
{
|
||||
"codeName": "AAMasters",
|
||||
"displayName": "AA Arena",
|
||||
"host": {
|
||||
"url": "https://demo-api-dev.superalgos.org/",
|
||||
"storage": "localStorage",
|
||||
"container": "aamasters",
|
||||
"accessKey": "09e890b76767ede3e10f0526b5036600a6b8d3faac540336e12b493fdb2aa9ed46f86094c34652f99fb6322e5f09806412f17725807f85e4dc4169bd22dd59f0b23aba5251f5544478a1aabf5a2dea5260e6eb0c29af3a788208af85025a02f94950437d501b91fd55b9d97b3d6ac3af4e1161321f78b73ca0fda524dc3a5d03"
|
||||
},
|
||||
"competitions": [
|
||||
{
|
||||
"codeName": "Weekend-Deathmatch",
|
||||
"description": "First AA Internal Competition. Bots will be trading during 3 days at the USDT/BTC market of Poloniex to see who can make the gratest return over investment (ROI).",
|
||||
"displayName": "AA Internal Challenge",
|
||||
"startDatetime": "2018-01-01T16:00:00.000Z",
|
||||
"finishDatetime": "2018-01-02T16:00:00.000Z",
|
||||
"formula": "ROI",
|
||||
"plotter": {
|
||||
"devTeam": "AAMasters",
|
||||
"codeName": "PlottersROI",
|
||||
"host": {
|
||||
"url": "https://demo-api-dev.superalgos.org/",
|
||||
"storage": "localStorage",
|
||||
"container": "aamasters",
|
||||
"accessKey": ""
|
||||
},
|
||||
"moduleName": "CombinedProfits",
|
||||
"repo": "Plotters-ROI"
|
||||
},
|
||||
"rules": [],
|
||||
"prizes": [],
|
||||
"participants": [],
|
||||
"repo": "Weekend-Deathmatch",
|
||||
"configFile": "this.competition.config.json"
|
||||
}
|
||||
],
|
||||
"plotters": [
|
||||
{
|
||||
"displayName": "Plotters ROI",
|
||||
"codeName": "PlottersROI",
|
||||
"devTeam": "AAMasters",
|
||||
"modules": [
|
||||
{
|
||||
"codeName": "CombinedProfits",
|
||||
"moduleName": "CombinedProfits",
|
||||
"description": "Plots participants of a competition by the ROI each one had over time.",
|
||||
"panels": []
|
||||
}
|
||||
],
|
||||
"repo": "Plotters-ROI",
|
||||
"configFile": "this.plotter.config.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
+4
-4
@@ -27,11 +27,11 @@
|
||||
function loadCanvas() {
|
||||
if (window.canvasApp.visible === undefined) {
|
||||
window.canvasApp = {
|
||||
version: '1.0.0', // This is used to avoid catching problems at the browser level.
|
||||
version: '', // This is used to avoid catching problems at the browser level.
|
||||
sessionToken: '',
|
||||
executingAt: 'Master App',
|
||||
executingAt: 'Local',
|
||||
visible: true,
|
||||
topMargin: 1,
|
||||
topMargin: 0,
|
||||
urlPrefix: 'http://localhost:1337/',
|
||||
graphQL: {
|
||||
masterAppApiUrl: 'https://demo-api-dev.superalgos.org/graphql',
|
||||
@@ -56,7 +56,7 @@
|
||||
</head>
|
||||
|
||||
<body id="body" onload="loadCanvas()"
|
||||
style="overflow:hidden; background: url(Images/superalgos-platform.jpg)"
|
||||
style="overflow:hidden; background: url(Images/superalgos-platform.jpg); background-size: cover;"
|
||||
onresize="onResize()">
|
||||
<div id="masterApp"></div>
|
||||
<div id="canvasApp"></div>
|
||||
|
||||
@@ -182,7 +182,7 @@ function onBrowserRequest(request, response) {
|
||||
let devTeam = requestParameters[2]
|
||||
let codeName = requestParameters[3]
|
||||
let moduleName = requestParameters[4]
|
||||
let filePath = './Plotters/' + devTeam + '/plotters/' + codeName + '/' + moduleName
|
||||
let filePath = process.env.PLOTTERS_PATH + 'Plotters/' + devTeam + '/' + codeName + '/' + moduleName
|
||||
respondWithFile(filePath, response)
|
||||
}
|
||||
break
|
||||
@@ -192,7 +192,7 @@ function onBrowserRequest(request, response) {
|
||||
let devTeam = requestParameters[2]
|
||||
let codeName = requestParameters[3]
|
||||
let moduleName = requestParameters[4]
|
||||
let filePath = './Plotters/' + devTeam + '/plotters/' + codeName + '/' + moduleName
|
||||
let filePath = process.env.PLOTTERS_PATH + 'Plotters/' + devTeam + '/' + codeName + '/' + moduleName
|
||||
respondWithFile(filePath, response)
|
||||
}
|
||||
break
|
||||
@@ -266,13 +266,13 @@ function onBrowserRequest(request, response) {
|
||||
}
|
||||
break
|
||||
|
||||
case 'ReadUserConfig':
|
||||
case 'GetDefinition':
|
||||
{
|
||||
respondWithFile(process.env.CONFIG_PATH + '/userConfig.json', response)
|
||||
respondWithFile(process.env.CONFIG_PATH + '/definition.json', response)
|
||||
}
|
||||
break
|
||||
|
||||
case 'WriteUserConfig':
|
||||
case 'SaveDefinition':
|
||||
{
|
||||
let fs = require('fs')
|
||||
let body = '';
|
||||
@@ -286,7 +286,7 @@ function onBrowserRequest(request, response) {
|
||||
|
||||
request.on('end', function () {
|
||||
try {
|
||||
let filePath = process.env.CONFIG_PATH + '/userConfig.json'
|
||||
let filePath = process.env.CONFIG_PATH + '/definition.json'
|
||||
fs.writeFile(filePath, body, onFileWrite)
|
||||
} catch (e) {
|
||||
console.log('[ERROR] Error writing user config.', e)
|
||||
|
||||
Reference in new issue
Block a user