Merge branch 'develop' into plugins-docs
This commit is contained in:
292 files changed
+323238
-6327
No files matched your search
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -5,6 +5,8 @@
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Github API",
|
||||
"relatedUiObject": "Github API",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "githubAPI",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,148 +1,148 @@
|
||||
{
|
||||
"type": "Crypto Exchange",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Configure Thise",
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"label": "Configure",
|
||||
"iconPathOn": "configuration",
|
||||
"iconPathOff": "configuration"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "exchangeAssets",
|
||||
"label": "Add Exchange Assets",
|
||||
"relatedUiObject": "Exchange Assets",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "exchangeMarkets",
|
||||
"label": "Add Exchange Markets",
|
||||
"relatedUiObject": "Exchange Markets",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "exchangeAccounts",
|
||||
"label": "Add Exchange Accounts",
|
||||
"relatedUiObject": "Exchange Accounts",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
}
|
||||
],
|
||||
"isTitleAllwaysVisible": true,
|
||||
"addLeftIcons": true,
|
||||
"level": 2,
|
||||
"editors": {
|
||||
"config": true
|
||||
"type": "Crypto Exchange",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Configure Thise",
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"label": "Configure",
|
||||
"iconPathOn": "configuration",
|
||||
"iconPathOff": "configuration"
|
||||
},
|
||||
"initialValues": {
|
||||
"config": "{ \n\"codeName\": \"Type the name of the exchange\"\n}"
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "exchangeAssets",
|
||||
"label": "Add Exchange Assets",
|
||||
"relatedUiObject": "Exchange Assets",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
"attachingRules": {
|
||||
"compatibleTypes": "->Crypto Exchanges->"
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "exchangeMarkets",
|
||||
"label": "Add Exchange Markets",
|
||||
"relatedUiObject": "Exchange Markets",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
"propertyNameAtParent": "exchanges",
|
||||
"childrenNodesProperties": [
|
||||
{
|
||||
"name": "exchangeAssets",
|
||||
"type": "node",
|
||||
"childType": "Exchange Assets",
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
"name": "exchangeMarkets",
|
||||
"type": "node",
|
||||
"childType": "Exchange Markets",
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
"name": "exchangeAccounts",
|
||||
"type": "node",
|
||||
"childType": "Exchange Accounts",
|
||||
"autoAdd": true
|
||||
}
|
||||
],
|
||||
"alternativeIcons": [
|
||||
{
|
||||
"codeName": "binance",
|
||||
"iconName": "binance"
|
||||
},
|
||||
{
|
||||
"codeName": "binanceus",
|
||||
"iconName": "binanceus"
|
||||
},
|
||||
{
|
||||
"codeName": "bitfinex",
|
||||
"iconName": "bitfinex"
|
||||
},
|
||||
{
|
||||
"codeName": "bitmex",
|
||||
"iconName": "bitmex"
|
||||
},
|
||||
{
|
||||
"codeName": "bittrex",
|
||||
"iconName": "bittrex"
|
||||
},
|
||||
{
|
||||
"codeName": "coinbasepro",
|
||||
"iconName": "coinbasepro"
|
||||
},
|
||||
{
|
||||
"codeName": "ftx",
|
||||
"iconName": "ftx"
|
||||
},
|
||||
{
|
||||
"codeName": "hitbtc",
|
||||
"iconName": "hitbtc"
|
||||
},
|
||||
{
|
||||
"codeName": "kraken",
|
||||
"iconName": "kraken"
|
||||
},
|
||||
{
|
||||
"codeName": "kucoin",
|
||||
"iconName": "kucoin"
|
||||
},
|
||||
{
|
||||
"codeName": "liquid",
|
||||
"iconName": "liquid"
|
||||
},
|
||||
{
|
||||
"codeName": "luno",
|
||||
"iconName": "luno"
|
||||
},
|
||||
{
|
||||
"codeName": "lykke",
|
||||
"iconName": "lykke"
|
||||
},
|
||||
{
|
||||
"codeName": "okex",
|
||||
"iconName": "okex"
|
||||
},
|
||||
{
|
||||
"codeName": "okex5",
|
||||
"iconName": "okex"
|
||||
},
|
||||
{
|
||||
"codeName": "poloniex",
|
||||
"iconName": "poloniex"
|
||||
},
|
||||
{
|
||||
"codeName": "upbit",
|
||||
"iconName": "upbit"
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "exchangeAccounts",
|
||||
"label": "Add Exchange Accounts",
|
||||
"relatedUiObject": "Exchange Accounts",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
}
|
||||
],
|
||||
"isTitleAllwaysVisible": true,
|
||||
"addLeftIcons": true,
|
||||
"level": 2,
|
||||
"editors": {
|
||||
"config": true
|
||||
},
|
||||
"initialValues": {
|
||||
"config": "{ \n\"codeName\": \"Type the name of the exchange\",\n \n\"sandBox\": \"false\"\n}"
|
||||
},
|
||||
"attachingRules": {
|
||||
"compatibleTypes": "->Crypto Exchanges->"
|
||||
},
|
||||
"propertyNameAtParent": "exchanges",
|
||||
"childrenNodesProperties": [
|
||||
{
|
||||
"name": "exchangeAssets",
|
||||
"type": "node",
|
||||
"childType": "Exchange Assets",
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
"name": "exchangeMarkets",
|
||||
"type": "node",
|
||||
"childType": "Exchange Markets",
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
"name": "exchangeAccounts",
|
||||
"type": "node",
|
||||
"childType": "Exchange Accounts",
|
||||
"autoAdd": true
|
||||
}
|
||||
],
|
||||
"alternativeIcons": [
|
||||
{
|
||||
"codeName": "binance",
|
||||
"iconName": "binance"
|
||||
},
|
||||
{
|
||||
"codeName": "binanceus",
|
||||
"iconName": "binanceus"
|
||||
},
|
||||
{
|
||||
"codeName": "bitfinex",
|
||||
"iconName": "bitfinex"
|
||||
},
|
||||
{
|
||||
"codeName": "bitmex",
|
||||
"iconName": "bitmex"
|
||||
},
|
||||
{
|
||||
"codeName": "bittrex",
|
||||
"iconName": "bittrex"
|
||||
},
|
||||
{
|
||||
"codeName": "coinbasepro",
|
||||
"iconName": "coinbasepro"
|
||||
},
|
||||
{
|
||||
"codeName": "ftx",
|
||||
"iconName": "ftx"
|
||||
},
|
||||
{
|
||||
"codeName": "hitbtc",
|
||||
"iconName": "hitbtc"
|
||||
},
|
||||
{
|
||||
"codeName": "kraken",
|
||||
"iconName": "kraken"
|
||||
},
|
||||
{
|
||||
"codeName": "kucoin",
|
||||
"iconName": "kucoin"
|
||||
},
|
||||
{
|
||||
"codeName": "liquid",
|
||||
"iconName": "liquid"
|
||||
},
|
||||
{
|
||||
"codeName": "luno",
|
||||
"iconName": "luno"
|
||||
},
|
||||
{
|
||||
"codeName": "lykke",
|
||||
"iconName": "lykke"
|
||||
},
|
||||
{
|
||||
"codeName": "okex",
|
||||
"iconName": "okex"
|
||||
},
|
||||
{
|
||||
"codeName": "okex5",
|
||||
"iconName": "okex"
|
||||
},
|
||||
{
|
||||
"codeName": "poloniex",
|
||||
"iconName": "poloniex"
|
||||
},
|
||||
{
|
||||
"codeName": "upbit",
|
||||
"iconName": "upbit"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -16,6 +16,24 @@
|
||||
"label": "Add Plugin File Position",
|
||||
"relatedUiObject": "Plugin File Position"
|
||||
},
|
||||
{
|
||||
"action": "Enable Saving With Workspace",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Enable Saving With Workspace",
|
||||
"relatedUiObject": "Plugin File"
|
||||
},
|
||||
{
|
||||
"action": "Disable Saving With Workspace",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Disable Saving With Workspace",
|
||||
"relatedUiObject": "Plugin File"
|
||||
},
|
||||
{
|
||||
"action": "Save Plugin",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Save Plugin",
|
||||
"relatedUiObject": "Plugin File"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"config": true
|
||||
},
|
||||
"initialValues": {
|
||||
"config": "{\"node\":{\"distancePercentage\":60,\"radiusPercentage\":85,\"massPercentage\":100,\"animationSteps\":2,\"menuItem\":{\"widthPercentage\":100,\"heightPercentage\":60,\"radiusPercentage\":90}},\"physics\":false,\"detachUsingMouse\":false }"
|
||||
"config": "{\"node\":{\"distancePercentage\":60,\"radiusPercentage\":85,\"massPercentage\":100,\"animationSteps\":2,\"menuItem\":{\"widthPercentage\":100,\"heightPercentage\":60,\"radiusPercentage\":90}},\"physics\":false,\"shortcuts\":{\"toggleMapMode\":\"M\",\"toggleDrawRelationshipLines\":\"R\",\"toggleDrawParentLines\":\"C\",\"saveWorkspace\":\"S\",\"adjustAspectRatio\":\"A\"}}"
|
||||
},
|
||||
"menuItems": [
|
||||
{
|
||||
|
||||
@@ -21,6 +21,14 @@
|
||||
"actionFunction": "UI.projects.foundations.spaces.designSpace.workspace.backup",
|
||||
"ring": 1
|
||||
},
|
||||
{
|
||||
"action": "Configure",
|
||||
"label": "Configure",
|
||||
"iconPathOn": "configuration",
|
||||
"iconPathOff": "configuration",
|
||||
"dontShowAtFullscreen": true,
|
||||
"actionFunction": "uiObject.configEditor.activate"
|
||||
},
|
||||
{
|
||||
"action": "Add Missing Workspace Projects",
|
||||
"label": "Add Missing Projects",
|
||||
@@ -31,6 +39,12 @@
|
||||
"actionFunction": "payload.executeAction"
|
||||
}
|
||||
],
|
||||
"initialValues": {
|
||||
"config": "{\"docsLanguage\": \"EN\"}"
|
||||
},
|
||||
"editors": {
|
||||
"config": true
|
||||
},
|
||||
"isTitleAllwaysVisible": true,
|
||||
"addLeftIcons": false,
|
||||
"isPinned": true,
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@
|
||||
},
|
||||
{
|
||||
"style": "Success",
|
||||
"text": "Learn more about the Superalgos (SA) Token on the website."
|
||||
"text": "Learn more about the Superalgos SA Token on the website."
|
||||
}
|
||||
]
|
||||
}
|
||||
+85
-81
@@ -1,83 +1,87 @@
|
||||
{
|
||||
"type": "Crypto Exchange",
|
||||
"definition": {
|
||||
"text": "A crypto exchange node holds the definitions of assets and markets in a specific exchange."
|
||||
"type": "Crypto Exchange",
|
||||
"definition": {
|
||||
"text": "A crypto exchange node holds the definitions of assets and markets in a specific exchange."
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Block",
|
||||
"text": "Configuring"
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Block",
|
||||
"text": "Configuring"
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Tested Exchanges",
|
||||
"updated": 1615200855230
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "In theory, Superalgos supports dozens of exchanges. However, each exchange must go through a testing process, as not all of them conform to the standard proposed by the CCXT library.",
|
||||
"updated": 1615201479524
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "Binance Test Status",
|
||||
"updated": 1615203667257
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "Binance-US Test Status"
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "Bitfinex Test Status"
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "Bittrex Test Status"
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "CoinbasePro Test Status"
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "FTX Test Status",
|
||||
"updated": 1615203669878
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "Kraken Test Status",
|
||||
"updated": 1615453046113
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "Kucoin Test Status"
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "Luno Test Status"
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Crypto Exchange Configuration"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Each exchange may require a very specific configuration. This is determined during the exchange testing process. Consult the page of each exchange as listed above. If you are interested in testing a new exchange, go to the How to Test New Exchanges page.",
|
||||
"updated": 1615201685376
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Properties",
|
||||
"updated": 1609771684679
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "codeName is the name of the exchange as handled in the code of the system."
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "API holds a series of definitions used only in the case in which the sensor bot fetches trades (using the Historic-Trades process) instead of the OHLCV process that fetches one-minute candles and is the current default. In such a case, finding the right set of parameters to work with a specific exchange may be challenging, nd involves understanding how the exchanges API and the CCXT Library API work. In other words, there is no hard rule as of what each of the values should be. Determining each of this values requires exploring the exchange's API documentation, as well as the documentation of the CCXT Library."
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Tested Exchanges",
|
||||
"updated": 1615200855230
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "In theory, Superalgos supports dozens of exchanges. However, each exchange must go through a testing process, as not all of them conform to the standard proposed by the CCXT library.",
|
||||
"updated": 1615201479524
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "Binance Test Status",
|
||||
"updated": 1615203667257
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "Binance-US Test Status"
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "Bitfinex Test Status"
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "Bittrex Test Status"
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "CoinbasePro Test Status"
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "FTX Test Status",
|
||||
"updated": 1615203669878
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "Kraken Test Status",
|
||||
"updated": 1615453046113
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "Kucoin Test Status"
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "Luno Test Status"
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Crypto Exchange Configuration"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Each exchange may require a very specific configuration. This is determined during the exchange testing process. Consult the page of each exchange as listed above. If you are interested in testing a new exchange, go to the How to Test New Exchanges page.",
|
||||
"updated": 1615201685376
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Properties",
|
||||
"updated": 1609771684679
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "codeName is the name of the exchange as handled in the code of the system."
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "sandBox setting this parameter to true allows SuperAlgos to perform live trading on the exchanges sandbox or testnet if one is available."
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "API holds a series of definitions used only in the case in which the sensor bot fetches trades (using the Historic-Trades process) instead of the OHLCV process that fetches one-minute candles and is the current default. In such a case, finding the right set of parameters to work with a specific exchange may be challenging, nd involves understanding how the exchanges API and the CCXT Library API work. In other words, there is no hard rule as of what each of the values should be. Determining each of this values requires exploring the exchange's API documentation, as well as the documentation of the CCXT Library."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -59,6 +59,45 @@
|
||||
{
|
||||
"style": "List",
|
||||
"text": "detachUsingMouse defines if you can detach nodes from it's parent or reference parents only using the mouse (when true) or if you can not use the mouse for that and can only do it using the detach buttons on the icon's menu (when false)."
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Shorcut Properties"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Shorcuts are key stroke combinations that helps users execute certain actions very quickly. To execute a shorcut users need to simultaniously press CTRL + SHIFT + a pre-defined key.",
|
||||
"updated": 1625419324367
|
||||
},
|
||||
{
|
||||
"style": "Success",
|
||||
"text": "Shorcuts default values can be seen below. You can modify those values by changing the Config Properties listed below.",
|
||||
"updated": 1625419754545
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "toggleMapMode defines which key will be used as a Shorcut for entering and leaving the Map Mode.",
|
||||
"updated": 1625419803171
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "toggleDrawRelationshipLines defines which key will be used as a Shorcut for turning on and off the drawing of Reference Lines.",
|
||||
"updated": 1625419810253
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "toggleDrawParentLines defines which key will be used as a Shorcut for turning on and off the drawing of Parent Lines.",
|
||||
"updated": 1625419816654
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "saveWorkspace defines which key will be used as a Shorcut for saving the Workspace.",
|
||||
"updated": 1625419822252
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "adjustAspectRation defines which key will be used as a Shorcut for forcing a Time Machine to adjust it's aspect ratio according to the size of the screen a user currently have.",
|
||||
"updated": 1625419830418
|
||||
}
|
||||
]
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"topic": "App Commands Errors",
|
||||
"pageNumber": "3",
|
||||
"type": "App Error - Could Not Get Current Branch",
|
||||
"definition": {
|
||||
"text": "There was a problem trying to get the Current Branch. Check the console for errors.",
|
||||
"updated": 1611129344277
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Success",
|
||||
"text": "Check for the following section for details on what may have happened. After you fix the issue, you may try again.",
|
||||
"updated": 1611152967185
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Error Info",
|
||||
"updated": 1611154641024
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "In the following section, you will find the information recorded when the error occurred."
|
||||
},
|
||||
{
|
||||
"style": "Note",
|
||||
"text": "You will only see the information if you opened this page as a result of the error actually occurring.",
|
||||
"updated": 1611151375974
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Message"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Message of the Exception that occured at the Client:",
|
||||
"updated": 1611151299633
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorMessage"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Stack"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Stack of the Exception that occured at the Client:",
|
||||
"updated": 1611151427220
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorStack"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Code"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Code of the Exception that occured at the Client:",
|
||||
"updated": 1611151443562
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorCode"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Details"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following are all the Error details of the Exception that occured at the Client:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorDetails"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
+44
@@ -114,6 +114,50 @@
|
||||
"style": "Text",
|
||||
"text": "The final step is turning the object-formatted records back into a minimized array format, and saving the corresponding files in the dataset."
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Appendix: Building 2 Interdependent Indicators"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Let's say you built indicator1 with product A that depends on Indicator Candles Volumens, product Candles, and you are building indicator2, product B that depends on indicator1 product A."
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "When you wrote the code for Indicator 1 Product A, you were using the syntax:"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "variable property1 = record.current.open"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Why? Because Indicator 1 depends on Candles Volumens, produc Candles, and each candle has a property called open, and since product Candles is the only data dependency, it is then also the main dependency and then it will be served to you inside the record object for your convenience."
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "You could also have done"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "variable property1 = products.candles[index] but that is more difficult because you don't really know which index you are at at any given moment in time. It is best and easier to use the record object. The array is for very advanced users."
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Then you want to write the code for indicator 2, product B, you already declared Indicator 1, Product A as the only data dependency. "
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Since Indicator1 product A is the only data dependency of indicator 2, then it is also the main dependency, which means that for building indicator 2, the Data Building Process will iterate over every element of Indicator 1 in this case (not candles because that is not a dependency at all)."
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "In the same way that you did before, you will write code like this:"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "variable propertyX = record.current.property1 (that means the property 1 of Product A of Indicator 1) "
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": ""
|
||||
|
||||
+4
-4
@@ -160,8 +160,8 @@
|
||||
},
|
||||
{
|
||||
"style": "Javascript",
|
||||
"text": "productName[tradingEngine.tradingCurrent.tradingEpisode.candle.index.value-n].propertyName",
|
||||
"updated": 1625193412334
|
||||
"text": "productPluralVariable[tradingEngine.tradingCurrent.tradingEpisode.candle.index.value-n].propertyName",
|
||||
"updated": 1624868076284
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
@@ -175,8 +175,8 @@
|
||||
},
|
||||
{
|
||||
"style": "Javascript",
|
||||
"text": "chart.at01hs.candle[tradingEngine.tradingCurrent.tradingEpisode.candle.index.value-5].max",
|
||||
"updated": 1625193408514
|
||||
"text": "chart.at01hs.candles[tradingEngine.tradingCurrent.tradingEpisode.candle.index.value-5].max",
|
||||
"updated": 1624868093927
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@
|
||||
"translations": [
|
||||
{
|
||||
"language": "IT",
|
||||
"text": "Il progetto ha implementato un buon incentivo per promuovere il contributo, verso una collaborazione globale. Stiamo distribuendo il Superalgos (SA) Token, in esclusiva, a chi contribuisce al progetto!",
|
||||
"text": "Il progetto ha implementato un buon incentivo per promuovere il contributo, verso una collaborazione globale. Stiamo distribuendo il Superalgos SA Token, in esclusiva, a chi contribuisce al progetto!",
|
||||
"updated": 1619633002722,
|
||||
"style": "Text"
|
||||
}
|
||||
@@ -34,7 +34,7 @@
|
||||
},
|
||||
{
|
||||
"style": "Link",
|
||||
"text": "Learn more about the Superalgos (SA) Token!->superalgos.org/token-overview.shtml"
|
||||
"text": "Learn more about the Superalgos SA Token!->superalgos.org/token-overview.shtml"
|
||||
},
|
||||
{
|
||||
"style": "Success",
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
},
|
||||
{
|
||||
"style": "Note",
|
||||
"text": "Contributions earn you <a href=\"https://superalgos.org/token-overview.shtml\" target=\"_blank\" style=\"color:blue;\">Superalgos (SA) Tokens</a> and are subject to the terms of the <a href=\"https://github.com/Superalgos/Superalgos/blob/master/LICENSE\" target=\"_blank\" style=\"color:blue;\">Apache Licence 2.0</a>. In short, Contributors provide an express grant of copyright/patent rights.",
|
||||
"text": "Contributions earn you <a href=\"https://superalgos.org/token-overview.shtml\" target=\"_blank\" style=\"color:blue;\">Superalgos SA Tokens</a> and are subject to the terms of the <a href=\"https://github.com/Superalgos/Superalgos/blob/master/LICENSE\" target=\"_blank\" style=\"color:blue;\">Apache Licence 2.0</a>. In short, Contributors provide an express grant of copyright/patent rights.",
|
||||
"updated": 1610963383947,
|
||||
"translations": [
|
||||
{
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@
|
||||
},
|
||||
{
|
||||
"style": "Callout",
|
||||
"text": "If you have a basic understanding of JavaScript, you may create indicators too! If you contribute a Data Mine, you earn Superalgos (SA) Tokens!",
|
||||
"text": "If you have a basic understanding of JavaScript, you may create indicators too! If you contribute a Data Mine, you earn Superalgos SA Tokens!",
|
||||
"translations": [
|
||||
{
|
||||
"language": "IT",
|
||||
|
||||
+3
-3
@@ -5,9 +5,9 @@
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"ccxt": {
|
||||
"version": "1.51.91",
|
||||
"resolved": "https://registry.npmjs.org/ccxt/-/ccxt-1.51.91.tgz",
|
||||
"integrity": "sha512-pomtW3aDy7oSOm+Y9XP4WAkPPx9oZNGjhzwPEXyMrNKsVrc7+deVq07rIS+m5UHUkRel6a4U2hUwnWHOxAQMuQ=="
|
||||
"version": "1.51.98",
|
||||
"resolved": "https://registry.npmjs.org/ccxt/-/ccxt-1.51.98.tgz",
|
||||
"integrity": "sha512-3sgRDrOnD6IE06yGr+F0YcQh22eNyKiZ3nQP+QdZt8W/zUUsl4CaHT5I7Zqqz7ObKdv4YcdMCv8j9khTpBNz4w=="
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,6 @@
|
||||
"name": "Luis-Fernando-Molina"
|
||||
},
|
||||
"dependencies": {
|
||||
"ccxt": "^1.51.91"
|
||||
"ccxt": "^1.51.98"
|
||||
}
|
||||
}
|
||||
+56
-47
@@ -1,7 +1,7 @@
|
||||
exports.newFoundationsBotModulesExchangeAPI = function (processIndex) {
|
||||
|
||||
let MODULE_NAME = "Exchange API";
|
||||
|
||||
|
||||
let thisObject = {
|
||||
getOrder: getOrder,
|
||||
createOrder: createOrder,
|
||||
@@ -9,27 +9,28 @@
|
||||
initialize: initialize,
|
||||
finalize: finalize
|
||||
};
|
||||
|
||||
|
||||
let tradingSystem
|
||||
|
||||
|
||||
let exchangeId
|
||||
let options = {}
|
||||
let exchange
|
||||
|
||||
|
||||
const ccxt = require('ccxt')
|
||||
|
||||
|
||||
return thisObject;
|
||||
|
||||
|
||||
function initialize() {
|
||||
tradingSystem = TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).SIMULATION_STATE.tradingSystem
|
||||
|
||||
|
||||
exchangeId = TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.codeName
|
||||
|
||||
|
||||
let key
|
||||
let secret
|
||||
let uid
|
||||
let password
|
||||
|
||||
let sandBox = TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.sandbox || false;
|
||||
|
||||
if (TS.projects.foundations.globals.taskConstants.TASK_NODE.keyReference !== undefined) {
|
||||
if (TS.projects.foundations.globals.taskConstants.TASK_NODE.keyReference.referenceParent !== undefined) {
|
||||
key = TS.projects.foundations.globals.taskConstants.TASK_NODE.keyReference.referenceParent.config.codeName
|
||||
@@ -51,33 +52,40 @@
|
||||
options: options
|
||||
}
|
||||
exchange = new exchangeClass(exchangeConstructorParams)
|
||||
// enable sandbox mode based on exchange sandbox param value
|
||||
if (sandBox) {
|
||||
exchange.setSandboxMode(sandBox);
|
||||
}
|
||||
console.log('Sandbox mode = ' + sandBox);
|
||||
// uncomment the following line if you want to log the exchange api being used
|
||||
// console.log(exchange.urls.api);
|
||||
}
|
||||
|
||||
|
||||
function finalize() {
|
||||
tradingSystem = undefined
|
||||
exchangeId = undefined
|
||||
options = undefined
|
||||
exchange = undefined
|
||||
}
|
||||
|
||||
|
||||
async function getOrder(tradingSystemOrder, tradingEngineOrder) {
|
||||
|
||||
|
||||
let orderId = tradingEngineOrder.exchangeId.value
|
||||
const symbol = 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.quotedAsset.referenceParent.config.codeName
|
||||
|
||||
|
||||
/* Basic Logging */
|
||||
logInfo("getOrder -> orderId = " + orderId)
|
||||
logInfo("getOrder -> symbol = " + symbol)
|
||||
|
||||
|
||||
/* Basic Validations */
|
||||
if (exchange.has['fetchOrder'] === false) {
|
||||
logError("getOrder -> Exchange does not support fetchOrder command.");
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
let order = await exchange.fetchOrder(orderId, symbol)
|
||||
|
||||
|
||||
logInfo("getOrder -> Response from the Exchange: " + JSON.stringify(order));
|
||||
return order
|
||||
} catch (err) {
|
||||
@@ -92,13 +100,13 @@
|
||||
symbol: symbol,
|
||||
orderId: orderId
|
||||
}
|
||||
|
||||
|
||||
TS.projects.education.utilities.docsFunctions.buildPlaceholder(docs, err, tradingSystemOrder.name, undefined, undefined, undefined, contextInfo)
|
||||
|
||||
|
||||
tradingSystem.addError([tradingSystemOrder.id, message, docs])
|
||||
|
||||
|
||||
logError("getOrder -> Error = " + err.message);
|
||||
if ( /[0-9a-z]+ NotFound/.test(err.message) ) {
|
||||
if (/[0-9a-z]+ NotFound/.test(err.message)) {
|
||||
logInfo("getOrder -> NotFound, so order is actually closed.")
|
||||
order = {
|
||||
status: 'NotFound'
|
||||
@@ -107,15 +115,15 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function createOrder(tradingSystemOrder, tradingEngineOrder) {
|
||||
|
||||
|
||||
let price = tradingEngineOrder.rate.value // CCXT: how much quote currency you are willing to pay for a trade lot of base currency (for limit orders only)
|
||||
let type // CCXT: a string literal type of order, ccxt currently unifies market and limit orders only
|
||||
let side // CCXT: a string literal for the direction of your order, buy or sell
|
||||
let symbol = 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.quotedAsset.referenceParent.config.codeName // CCXT: a string literal symbol of the market you wish to trade on, like BTC/USD, ZEC/ETH, DOGE/DASH, etc
|
||||
let amount = tradingEngineOrder.orderBaseAsset.size.value // CCXT: how much of currency you want to trade, in Base Asset.
|
||||
|
||||
|
||||
switch (tradingSystemOrder.type) {
|
||||
case 'Market Buy Order': {
|
||||
type = 'market'
|
||||
@@ -138,14 +146,14 @@
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Basic Logging */
|
||||
logInfo("createOrder -> symbol = " + symbol);
|
||||
logInfo("createOrder -> side = " + side);
|
||||
logInfo("createOrder -> type = " + type);
|
||||
logInfo("createOrder -> amount = " + amount);
|
||||
logInfo("createOrder -> price = " + price);
|
||||
|
||||
|
||||
/* Basic Validations */
|
||||
if (side !== "buy" && side !== "sell") {
|
||||
logError("createOrder -> side must be either 'buy' or 'sell'.");
|
||||
@@ -155,17 +163,17 @@
|
||||
logError("createOrder -> Exchange does not support createOrder command.");
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
let order = await (exchange.createOrder(symbol, type, side, amount, price))
|
||||
|
||||
|
||||
logInfo("createOrder -> Response from the Exchange: " + JSON.stringify(order));
|
||||
return order.id
|
||||
} catch (err) {
|
||||
|
||||
|
||||
let exchangeApiKey = TS.projects.foundations.globals.taskConstants.TASK_NODE.keyReference.referenceParent
|
||||
let message = 'Create Order Unexpected Error'
|
||||
|
||||
|
||||
logError("createOrder -> Error = " + err.message)
|
||||
logError("createOrder -> symbol = " + symbol);
|
||||
logError("createOrder -> side = " + side);
|
||||
@@ -179,7 +187,7 @@
|
||||
) {
|
||||
logError('The exchange says the API key provided is not good or it is not in the correct format. This is what you are using:')
|
||||
errorFooter()
|
||||
|
||||
|
||||
message = 'Invalid Exchange API Key'
|
||||
}
|
||||
if (
|
||||
@@ -188,17 +196,17 @@
|
||||
) {
|
||||
logError('The exchange says the secret provided is not good, incorrect or not in the correct format. This is what you are using:')
|
||||
errorFooter()
|
||||
|
||||
|
||||
message = 'Invalid Exchange API Secret'
|
||||
}
|
||||
|
||||
|
||||
let docs = {
|
||||
project: 'Foundations',
|
||||
category: 'Topic',
|
||||
type: 'TS LF Trading Bot Error - ' + message,
|
||||
placeholder: {}
|
||||
}
|
||||
|
||||
|
||||
let contextInfo = {
|
||||
symbol: symbol,
|
||||
side: side,
|
||||
@@ -211,9 +219,9 @@
|
||||
secretLength: exchangeApiKey.config.secret.length
|
||||
}
|
||||
TS.projects.education.utilities.docsFunctions.buildPlaceholder(docs, err, exchangeApiKey.name, undefined, exchangeApiKey.config, undefined, contextInfo)
|
||||
|
||||
|
||||
tradingSystem.addError([exchangeApiKey.id, message, docs])
|
||||
|
||||
|
||||
function errorFooter() {
|
||||
logError('key: ->' + exchangeApiKey.config.codeName + '<-')
|
||||
logError('secret: ->' + exchangeApiKey.config.secret + '<-')
|
||||
@@ -224,25 +232,25 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function cancelOrder(tradingSystemOrder, tradingEngineOrder) {
|
||||
|
||||
|
||||
let orderId = tradingEngineOrder.exchangeId.value
|
||||
|
||||
|
||||
/* Basic Logging */
|
||||
logInfo("cancelOrder -> Entering function. orderId = " + orderId);
|
||||
|
||||
|
||||
const symbol = 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.quotedAsset.referenceParent.config.codeName
|
||||
|
||||
|
||||
/* Basic Validations */
|
||||
if (exchange.has['fetchOrder'] === false) {
|
||||
logError("cancelOrder -> Exchange does not support fetchOrder command.");
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
let order = await exchange.cancelOrder(orderId, symbol)
|
||||
|
||||
|
||||
logInfo("cancelOrder -> Response from the Exchange: " + JSON.stringify(order));
|
||||
return true
|
||||
} catch (err) {
|
||||
@@ -257,19 +265,20 @@
|
||||
symbol: symbol,
|
||||
orderId: orderId
|
||||
}
|
||||
|
||||
|
||||
TS.projects.education.utilities.docsFunctions.buildPlaceholder(docs, err, tradingSystemOrder.name, undefined, undefined, undefined, contextInfo)
|
||||
|
||||
|
||||
tradingSystem.addError([tradingSystemOrder.id, message, docs])
|
||||
logError("cancelOrder -> Error = " + err.message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function logInfo(message) {
|
||||
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[INFO] ' + message)
|
||||
}
|
||||
|
||||
|
||||
function logError(message) {
|
||||
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[ERROR] ' + message)
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Generated
+6
-4
@@ -1,11 +1,13 @@
|
||||
{
|
||||
"requires": true,
|
||||
"name": "apis",
|
||||
"version": "0.0.6",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"ccxt": {
|
||||
"version": "1.47.49",
|
||||
"resolved": "https://registry.npmjs.org/ccxt/-/ccxt-1.47.49.tgz",
|
||||
"integrity": "sha512-aGjOGKX/wfStwD24dH7FweP2ktdbZBjhgLxkipFVaewnjsftyiuzCCikMS7IvSRON/aAMG0oqKUdVHL382BFMA=="
|
||||
"version": "1.51.98",
|
||||
"resolved": "https://registry.npmjs.org/ccxt/-/ccxt-1.51.98.tgz",
|
||||
"integrity": "sha512-3sgRDrOnD6IE06yGr+F0YcQh22eNyKiZ3nQP+QdZt8W/zUUsl4CaHT5I7Zqqz7ObKdv4YcdMCv8j9khTpBNz4w=="
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
-11
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "apis",
|
||||
"version": "0.0.6",
|
||||
"description": "Exchange APIs",
|
||||
"main": "ExchangeAPI.js",
|
||||
"author": {
|
||||
"name": "Luis-Fernando-Molina"
|
||||
},
|
||||
"dependencies": {
|
||||
"ccxt": "^1.47.49"
|
||||
}
|
||||
}
|
||||
"name": "apis",
|
||||
"version": "0.0.6",
|
||||
"description": "Exchange APIs",
|
||||
"main": "ExchangeAPI.js",
|
||||
"author": {
|
||||
"name": "Luis-Fernando-Molina"
|
||||
},
|
||||
"dependencies": {
|
||||
"ccxt": "^1.51.98"
|
||||
}
|
||||
}
|
||||
@@ -193,22 +193,34 @@
|
||||
if (dataDependency.referenceParent.parentNode.config.singularVariableName === undefined) {
|
||||
continue
|
||||
}
|
||||
let foundAtDependencyFilters = false
|
||||
/*
|
||||
This is the product related to this Data Dependency, as the user would type it
|
||||
at a Condition or Formula and appear at the UI provided filter.
|
||||
*/
|
||||
let product = dataDependency.referenceParent.parentNode.config.singularVariableName
|
||||
|
||||
if (thisObject.filters.exchange.products.get(exchange + '-' + market + '-' + product) !== true) {
|
||||
/*
|
||||
We will filter out all the data dependencies which are not at the filters, except for candles,
|
||||
because we will need the candles dataset to run the simulation.
|
||||
*/
|
||||
if (dataDependency.referenceParent.parentNode.config.codeName !== 'Candles') {
|
||||
continue
|
||||
}
|
||||
let product
|
||||
/*
|
||||
We will filter out all the data dependencies which are not at the filters, except for candles,
|
||||
because we will need the candles dataset to run the simulation.
|
||||
*/
|
||||
if (dataDependency.referenceParent.parentNode.config.codeName === 'Candles') {
|
||||
foundAtDependencyFilters = true
|
||||
}
|
||||
/*
|
||||
We will consider that the user might use the singularVariableName or the pluralVariableName
|
||||
as well.
|
||||
*/
|
||||
product = dataDependency.referenceParent.parentNode.config.singularVariableName
|
||||
if (thisObject.filters.exchange.products.get(exchange + '-' + market + '-' + product) === true) {
|
||||
foundAtDependencyFilters = true
|
||||
}
|
||||
product = dataDependency.referenceParent.parentNode.config.pluralVariableName
|
||||
if (thisObject.filters.exchange.products.get(exchange + '-' + market + '-' + product) === true) {
|
||||
foundAtDependencyFilters = true
|
||||
}
|
||||
if (foundAtDependencyFilters === true) {
|
||||
addDataSet(exchange, market)
|
||||
}
|
||||
addDataSet(exchange, market)
|
||||
} else {
|
||||
addDataSet(exchange, market)
|
||||
}
|
||||
|
||||
@@ -704,6 +704,21 @@ function newFoundationsActionSwitch() {
|
||||
UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginApiMaps(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Enable Saving With Workspace':
|
||||
{
|
||||
UI.projects.foundations.functionLibraries.pluginsFunctions.enableSavingWithWorkspace(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Disable Saving With Workspace':
|
||||
{
|
||||
UI.projects.foundations.functionLibraries.pluginsFunctions.disableSavingWithWorkspace(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Save Plugin':
|
||||
{
|
||||
UI.projects.foundations.functionLibraries.pluginsFunctions.savePlugin(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Workspace Projects':
|
||||
{
|
||||
UI.projects.foundations.functionLibraries.workspaceFunctions.addMissingWorkspaceProjects(action.node, action.rootNodes)
|
||||
|
||||
@@ -10,7 +10,10 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
addMissingPluginLearningSystems: addMissingPluginLearningSystems,
|
||||
addMissingPluginLearningEngines: addMissingPluginLearningEngines,
|
||||
addMissingPluginTutorials: addMissingPluginTutorials,
|
||||
addMissingPluginApiMaps: addMissingPluginApiMaps
|
||||
addMissingPluginApiMaps: addMissingPluginApiMaps,
|
||||
enableSavingWithWorkspace: enableSavingWithWorkspace,
|
||||
disableSavingWithWorkspace: disableSavingWithWorkspace,
|
||||
savePlugin: savePlugin
|
||||
}
|
||||
return thisObject
|
||||
|
||||
@@ -57,7 +60,7 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Data-Mines', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames, 'Data-Mines', 'Data Mine')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +76,7 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Trading-Mines', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames, 'Trading-Mines', 'Trading Mine')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +92,7 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Trading-Systems', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames, 'Trading-Systems', 'Trading System')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +108,7 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Trading-Engines', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames, 'Trading-Engines', 'Trading Engine')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +124,7 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Learning-Mines', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames, 'Learning-Mines', 'Learning Mine')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +140,7 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Learning-Systems', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames, 'Learning-Systems', 'Learning System')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +156,7 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Learning-Engines', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames, 'Learning-Engines', 'Learning Engine')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +172,7 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Tutorials', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames, 'Tutorials', 'Tutorial')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +188,21 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'API-Maps', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames, 'API-Maps', 'API Map')
|
||||
}
|
||||
}
|
||||
|
||||
function enableSavingWithWorkspace(node, rootNodes) {
|
||||
UI.projects.foundations.utilities.nodeConfig.saveConfigProperty(node.payload, 'saveWithWorkspace', true)
|
||||
node.payload.uiObject.setInfoMessage('Saving with Workspace Enabled')
|
||||
}
|
||||
|
||||
function disableSavingWithWorkspace(node, rootNodes) {
|
||||
UI.projects.foundations.utilities.nodeConfig.saveConfigProperty(node.payload, 'saveWithWorkspace', false)
|
||||
node.payload.uiObject.setInfoMessage('Saving with Workspace Disabled')
|
||||
}
|
||||
|
||||
function savePlugin(node, rootNodes) {
|
||||
UI.projects.foundations.utilities.plugins.savePluginFile(node)
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,9 @@ function newFoundationsFunctionLibraryUiObjectsFromNodes() {
|
||||
learningSessionsFoundAtWorkspace = []
|
||||
tutorialsToPlay = []
|
||||
|
||||
/* Initializing the workspace config */
|
||||
if (node.config === undefined || node.config === 'undefined') { node.config = '{}' }
|
||||
|
||||
removeNullRootNodes()
|
||||
|
||||
function removeNullRootNodes() {
|
||||
@@ -135,10 +138,11 @@ function newFoundationsFunctionLibraryUiObjectsFromNodes() {
|
||||
addUserDefinedNodes()
|
||||
}
|
||||
|
||||
function pluginAllTheseFiles(pluginFiles, pluginType) {
|
||||
function pluginAllTheseFiles(pluginFiles, pluginFolder) {
|
||||
for (let i = 0; i < pluginFiles.length; i++) {
|
||||
let pluginFile = pluginFiles[i]
|
||||
let name = pluginFile.name
|
||||
let folder = pluginFolder
|
||||
let project = "Foundations"
|
||||
try {
|
||||
let config = JSON.parse(pluginFile.config)
|
||||
@@ -148,16 +152,28 @@ function newFoundationsFunctionLibraryUiObjectsFromNodes() {
|
||||
if (config.fileName !== undefined) {
|
||||
name = config.fileName
|
||||
}
|
||||
if (config.folderName !== undefined) {
|
||||
folder = config.folderName
|
||||
}
|
||||
} catch (err) { }
|
||||
|
||||
httpRequest(undefined, 'LoadPlugin' + '/' + project + '/' + pluginType + '/' + name + '.json', onFileReceived)
|
||||
httpRequest(undefined, 'LoadPlugin' + '/' + project + '/' + folder + '/' + name + '.json', onFileReceived)
|
||||
|
||||
function onFileReceived(err, text, response) {
|
||||
|
||||
if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
console.log('[WARN] Cannot load plugin ' + pluginType + ' ' + name + '. The Workspace will be loaded with this plugin file missing.')
|
||||
console.log('[WARN] Cannot load plugin ' + pluginFolder + ' ' + name + '. The Workspace will be loaded with this plugin file missing.')
|
||||
} else {
|
||||
let receivedNode = JSON.parse(text)
|
||||
let receivedNode
|
||||
|
||||
try {
|
||||
receivedNode = JSON.parse(text)
|
||||
} catch (err) {
|
||||
console.log('[ERROR] pluginAllTheseFiles -> Cannot load plugin ' + pluginFolder + ' ' + name + '. Received an invalid JSON object from the client.')
|
||||
console.log('[ERROR] pluginAllTheseFiles -> text = ' + text)
|
||||
console.log('[ERROR] pluginAllTheseFiles -> err.stack = ' + err.stack)
|
||||
return
|
||||
}
|
||||
/*
|
||||
If the workspace already contains a root node with the id of the head of the hirierchy
|
||||
we are loading, we remove it because the plugin file has precedende.
|
||||
@@ -170,6 +186,18 @@ function newFoundationsFunctionLibraryUiObjectsFromNodes() {
|
||||
}
|
||||
}
|
||||
receivedNode.isPlugin = true
|
||||
/*
|
||||
We will force the Plugin codeName to the same to the fileName.
|
||||
*/
|
||||
let config
|
||||
try {
|
||||
config = JSON.parse(receivedNode.config)
|
||||
} catch (err) {
|
||||
config = {}
|
||||
}
|
||||
|
||||
config.codeName = name
|
||||
receivedNode.config = JSON.stringify(config)
|
||||
|
||||
if (pluginFile.pluginFilePosition !== undefined) {
|
||||
let positionOffset = {
|
||||
|
||||
@@ -186,9 +186,9 @@ function newEdgeEditor() {
|
||||
|
||||
function onKeyPressed(event, forceExecution) {
|
||||
if (forceExecution !== true) {
|
||||
if (whereIsMouseOver !== 'center' ) {return}
|
||||
if (whereIsMouseOver !== 'center') { return }
|
||||
}
|
||||
|
||||
|
||||
const STEP = 10
|
||||
|
||||
if (event.shiftKey === false && event.ctrlKey === false && event.code === 'ArrowLeft') {
|
||||
@@ -228,7 +228,11 @@ function newEdgeEditor() {
|
||||
return
|
||||
}
|
||||
|
||||
if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'A' || event.key === 'a')) {
|
||||
if (
|
||||
event.shiftKey === true &&
|
||||
(event.ctrlKey === true || event.metaKey === true) &&
|
||||
(event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.adjustAspectRatio || event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.adjustAspectRatio.toLowerCase())
|
||||
) {
|
||||
resetAspectRatio()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@ function newFoundationsChatSpace() {
|
||||
}
|
||||
|
||||
function getContainer(point, purpose) {
|
||||
if (thisObject.sidePanelTab === undefined) { return }
|
||||
let container
|
||||
|
||||
container = thisObject.sidePanelTab.getContainer(point, purpose)
|
||||
|
||||
@@ -25,42 +25,49 @@ function newFoundationsDesignSpace() {
|
||||
|
||||
return thisObject
|
||||
|
||||
function initialize() {
|
||||
loadIconCollection(onIconsReady)
|
||||
async function initialize() {
|
||||
let promise = new Promise((resolve, reject) => {
|
||||
|
||||
function onIconsReady() {
|
||||
buildIconByProjectAndTypeMap()
|
||||
thisObject.workspace = newWorkspace()
|
||||
thisObject.workspace.initialize()
|
||||
}
|
||||
loadIconCollection(onIconsReady)
|
||||
|
||||
function buildIconByProjectAndTypeMap() {
|
||||
/* Take types-icons relationships defined at the schema */
|
||||
for (let i = 0; i < PROJECTS_SCHEMA.length; i++) {
|
||||
let project = PROJECTS_SCHEMA[i].name
|
||||
|
||||
addSchemaTypes(SCHEMAS_BY_PROJECT.get(project).array.appSchema)
|
||||
addSchemaTypes(SCHEMAS_BY_PROJECT.get(project).array.docsNodeSchema)
|
||||
addSchemaTypes(SCHEMAS_BY_PROJECT.get(project).array.docsConceptSchema)
|
||||
addSchemaTypes(SCHEMAS_BY_PROJECT.get(project).array.docsTopicSchema)
|
||||
|
||||
function addSchemaTypes(schema) {
|
||||
for (let j = 0; j < schema.length; j++) {
|
||||
let schemaDocument = schema[j]
|
||||
let iconName = schemaDocument.icon
|
||||
if (iconName === undefined) {
|
||||
iconName = schemaDocument.type.toLowerCase()
|
||||
iconName = iconName.split(" ").join("-")
|
||||
}
|
||||
let icon = thisObject.getIconByProjectAndName(project, iconName)
|
||||
if (icon !== undefined) {
|
||||
let key = project + '-' + schemaDocument.type
|
||||
thisObject.iconsByProjectAndType.set(key, icon)
|
||||
async function onIconsReady() {
|
||||
buildIconByProjectAndTypeMap()
|
||||
thisObject.workspace = newWorkspace()
|
||||
await thisObject.workspace.initialize()
|
||||
resolve()
|
||||
}
|
||||
|
||||
function buildIconByProjectAndTypeMap() {
|
||||
/* Take types-icons relationships defined at the schema */
|
||||
for (let i = 0; i < PROJECTS_SCHEMA.length; i++) {
|
||||
let project = PROJECTS_SCHEMA[i].name
|
||||
|
||||
addSchemaTypes(SCHEMAS_BY_PROJECT.get(project).array.appSchema)
|
||||
addSchemaTypes(SCHEMAS_BY_PROJECT.get(project).array.docsNodeSchema)
|
||||
addSchemaTypes(SCHEMAS_BY_PROJECT.get(project).array.docsConceptSchema)
|
||||
addSchemaTypes(SCHEMAS_BY_PROJECT.get(project).array.docsTopicSchema)
|
||||
|
||||
function addSchemaTypes(schema) {
|
||||
for (let j = 0; j < schema.length; j++) {
|
||||
let schemaDocument = schema[j]
|
||||
let iconName = schemaDocument.icon
|
||||
if (iconName === undefined) {
|
||||
iconName = schemaDocument.type.toLowerCase()
|
||||
iconName = iconName.split(" ").join("-")
|
||||
}
|
||||
let icon = thisObject.getIconByProjectAndName(project, iconName)
|
||||
if (icon !== undefined) {
|
||||
let key = project + '-' + schemaDocument.type
|
||||
thisObject.iconsByProjectAndType.set(key, icon)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return promise
|
||||
|
||||
}
|
||||
|
||||
function loadIconCollection(callBack) {
|
||||
|
||||
@@ -19,8 +19,9 @@ function newWorkspace() {
|
||||
getProjectsHeads: getProjectsHeads,
|
||||
getHierarchyHeads: getHierarchyHeads,
|
||||
getHierarchyHeadsById: getHierarchyHeadsById,
|
||||
getHierarchyHeadsByCodeNameAndNodeType: getHierarchyHeadsByCodeNameAndNodeType,
|
||||
getHierarchyHeadByNodeType: getHierarchyHeadByNodeType,
|
||||
getHierarchyHeadsByNodeType: getHierarchyHeadsByNodeType,
|
||||
getHierarchyHeadsByNodeType: getHierarchyHeadsByNodeType,
|
||||
getNodeThatIsOnFocus: getNodeThatIsOnFocus,
|
||||
getNodeByShortcutKey: getNodeByShortcutKey,
|
||||
getNodeById: getNodeById,
|
||||
@@ -59,78 +60,72 @@ function newWorkspace() {
|
||||
actionSwitchesByProject = undefined
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
try {
|
||||
UI.projects.foundations.utilities.statusBar.changeStatus("Initializing...")
|
||||
async function initialize() {
|
||||
let promise = new Promise((resolve, reject) => {
|
||||
|
||||
/* Set up the action switches map */
|
||||
for (let i = 0; i < PROJECTS_SCHEMA.length; i++) {
|
||||
let project = PROJECTS_SCHEMA[i].name
|
||||
let actionSwitch = eval('new' + project + 'ActionSwitch()')
|
||||
actionSwitchesByProject.set(project, actionSwitch)
|
||||
}
|
||||
try {
|
||||
UI.projects.foundations.utilities.statusBar.changeStatus("Initializing...")
|
||||
|
||||
/* Check which was the last workspace. */
|
||||
let lastUsedWorkspace = window.localStorage.getItem('Last Used Workspace')
|
||||
/* Set up the action switches map */
|
||||
for (let i = 0; i < PROJECTS_SCHEMA.length; i++) {
|
||||
let project = PROJECTS_SCHEMA[i].name
|
||||
let actionSwitch = eval('new' + project + 'ActionSwitch()')
|
||||
actionSwitchesByProject.set(project, actionSwitch)
|
||||
}
|
||||
|
||||
if (lastUsedWorkspace !== 'undefined' && lastUsedWorkspace !== null && lastUsedWorkspace !== undefined) {
|
||||
/* Check which was the last workspace. */
|
||||
let lastUsedWorkspace = window.localStorage.getItem('Last Used Workspace')
|
||||
|
||||
UI.projects.foundations.utilities.statusBar.changeStatus("Loading Workspace " + lastUsedWorkspace + "...")
|
||||
if (lastUsedWorkspace !== 'undefined' && lastUsedWorkspace !== null && lastUsedWorkspace !== undefined) {
|
||||
|
||||
httpRequest(undefined, 'LoadMyWorkspace' + '/' + lastUsedWorkspace, onFileReceived)
|
||||
function onFileReceived(err, text, response) {
|
||||
if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
UI.projects.foundations.spaces.cockpitSpace.setStatus('Could not load the last Workspace used, called "' + lastUsedWorkspace + '". Will switch to the default Workspace instead.', 500, UI.projects.foundations.spaces.cockpitSpace.statusTypes.WARNING)
|
||||
thisObject.workspaceNode = getWorkspace() // This is the default workspace that comes with the system.
|
||||
UI.projects.foundations.utilities.statusBar.changeStatus("Loading Workspace " + lastUsedWorkspace + "...")
|
||||
|
||||
httpRequest(undefined, 'LoadMyWorkspace' + '/' + lastUsedWorkspace, onFileReceived)
|
||||
function onFileReceived(err, text, response) {
|
||||
if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
UI.projects.foundations.spaces.cockpitSpace.setStatus('Could not load the last Workspace used, called "' + lastUsedWorkspace + '". Will switch to the default Workspace instead.', 500, UI.projects.foundations.spaces.cockpitSpace.statusTypes.WARNING)
|
||||
thisObject.workspaceNode = getWorkspace() // This is the default workspace that comes with the system.
|
||||
thisObject.workspaceNode.project = 'Foundations'
|
||||
recreateWorkspace()
|
||||
return
|
||||
}
|
||||
thisObject.workspaceNode = JSON.parse(text)
|
||||
thisObject.workspaceNode.project = 'Foundations'
|
||||
recreateWorkspace()
|
||||
return
|
||||
}
|
||||
thisObject.workspaceNode = JSON.parse(text)
|
||||
} else {
|
||||
thisObject.workspaceNode = getWorkspace() // This is the default workspace that comes with the system.
|
||||
thisObject.workspaceNode.project = 'Foundations'
|
||||
recreateWorkspace()
|
||||
}
|
||||
} else {
|
||||
thisObject.workspaceNode = getWorkspace() // This is the default workspace that comes with the system.
|
||||
thisObject.workspaceNode.project = 'Foundations'
|
||||
recreateWorkspace()
|
||||
}
|
||||
|
||||
function recreateWorkspace() {
|
||||
UI.projects.foundations.utilities.statusBar.changeStatus("Connecting all the workspace nodes...")
|
||||
executeAction({ node: thisObject.workspaceNode, name: 'Recreate Workspace', project: 'Foundations', callBackFunction: finishInitialization })
|
||||
}
|
||||
|
||||
function finishInitialization() {
|
||||
/*
|
||||
We will help the Docs Space finish its initialization, since it is
|
||||
waiting for the workspace to be done.
|
||||
*/
|
||||
UI.projects.foundations.utilities.statusBar.changeStatus("Setting up Docs Search Engine...")
|
||||
setTimeout(theEnd, 100)
|
||||
function theEnd() {
|
||||
UI.projects.education.spaces.docsSpace.searchEngine.setUpSearchEngine(onIndexingFinished)
|
||||
|
||||
function onIndexingFinished() {
|
||||
setupEventsServerClients()
|
||||
runTasksAndSessions()
|
||||
|
||||
thisObject.enabled = true
|
||||
UI.projects.foundations.spaces.cockpitSpace.initializePosition()
|
||||
CAN_SPACES_DRAW = true
|
||||
|
||||
thisObject.isInitialized = true
|
||||
|
||||
playTutorials()
|
||||
|
||||
savingWorkspaceIntervalId = setInterval(saveWorkspace, 60000)
|
||||
UI.projects.foundations.utilities.statusBar.changeStatus("Displaying the UI...")
|
||||
}
|
||||
function recreateWorkspace() {
|
||||
UI.projects.foundations.utilities.statusBar.changeStatus("Connecting all the workspace nodes...")
|
||||
executeAction({ node: thisObject.workspaceNode, name: 'Recreate Workspace', project: 'Foundations', callBackFunction: finishInitialization })
|
||||
}
|
||||
|
||||
function finishInitialization() {
|
||||
|
||||
setupEventsServerClients()
|
||||
runTasksAndSessions()
|
||||
|
||||
thisObject.enabled = true
|
||||
UI.projects.foundations.spaces.cockpitSpace.initializePosition()
|
||||
CAN_SPACES_DRAW = true
|
||||
|
||||
thisObject.isInitialized = true
|
||||
|
||||
//savingWorkspaceIntervalId = setInterval(saveWorkspace, 60000)
|
||||
UI.projects.foundations.utilities.statusBar.changeStatus("Displaying the UI...")
|
||||
|
||||
resolve()
|
||||
}
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
|
||||
}
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
|
||||
}
|
||||
})
|
||||
|
||||
return promise
|
||||
}
|
||||
|
||||
function runTasksAndSessions() {
|
||||
@@ -139,10 +134,6 @@ function newWorkspace() {
|
||||
executeAction({ name: 'Syncronize Learning Sessions', project: 'Foundations' })
|
||||
}
|
||||
|
||||
function playTutorials() {
|
||||
executeAction({ name: 'Play Tutorials', project: 'Foundations' })
|
||||
}
|
||||
|
||||
function setupEventsServerClients() {
|
||||
for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
|
||||
let rootNode = thisObject.workspaceNode.rootNodes[i]
|
||||
@@ -201,6 +192,7 @@ function newWorkspace() {
|
||||
return
|
||||
}
|
||||
httpRequest(textToSave, url, onResponse)
|
||||
savePlugins()
|
||||
return true
|
||||
|
||||
function onResponse(err) {
|
||||
@@ -219,6 +211,49 @@ function newWorkspace() {
|
||||
}
|
||||
}
|
||||
|
||||
function savePlugins() {
|
||||
/*
|
||||
Here we will scan the workspace for all Plugins and we will try to save them.
|
||||
The first thing to do is to find the Plugins hierarchy.
|
||||
*/
|
||||
let plugins = getHierarchyHeadByNodeType('Plugins')
|
||||
if (plugins === undefined) { return }
|
||||
|
||||
for (let i = 0; i < plugins.pluginProjects.length; i++) {
|
||||
let pluginProject = plugins.pluginProjects[i]
|
||||
/*
|
||||
Here we are inside the Voting Program, so we will crawl all it's children.
|
||||
*/
|
||||
let schemaDocument = getSchemaDocument(pluginProject)
|
||||
if (schemaDocument === undefined) { return }
|
||||
|
||||
if (schemaDocument.childrenNodesProperties !== undefined) {
|
||||
for (let j = 0; j < schemaDocument.childrenNodesProperties.length; j++) {
|
||||
let property = schemaDocument.childrenNodesProperties[j]
|
||||
|
||||
switch (property.type) {
|
||||
case 'node': {
|
||||
let childNode = pluginProject[property.name]
|
||||
if (childNode === undefined) { continue }
|
||||
if (childNode.pluginFiles === undefined) { continue }
|
||||
for (let k = 0; k < childNode.pluginFiles.length; k++) {
|
||||
let pluginFile = childNode.pluginFiles[k]
|
||||
|
||||
let saveWithWorkspace = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(pluginFile.payload, 'saveWithWorkspace')
|
||||
//UI.projects.foundations.utilities.plugins.savePluginFile(pluginFile)
|
||||
}
|
||||
}
|
||||
break
|
||||
case 'array': {
|
||||
/*Nothing to do here*/
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function backupWorkspace(action) {
|
||||
let text = await stringifyWorkspace(false)
|
||||
let fileName = 'Backup - ' + action.node.type + ' - ' + action.node.name + '.json'
|
||||
@@ -273,11 +308,7 @@ function newWorkspace() {
|
||||
UI.projects.education.spaces.docsSpace.sidePanelTab.close()
|
||||
UI.projects.foundations.spaces.sideSpace.sidePanelTab.close()
|
||||
UI.projects.foundations.spaces.floatingSpace.inMapMode = true
|
||||
saveWorkspace(takeAction)
|
||||
|
||||
function takeAction() {
|
||||
workingAtTask = 2
|
||||
}
|
||||
workingAtTask = 2
|
||||
break
|
||||
}
|
||||
case 2:
|
||||
@@ -373,21 +404,14 @@ function newWorkspace() {
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
UI.projects.foundations.utilities.statusBar.changeStatus('Reindexing Search Engine...')
|
||||
setTimeout(takeAction, 100)
|
||||
workingAtTask = 0
|
||||
UI.projects.foundations.spaces.floatingSpace.inMapMode = false
|
||||
thisObject.isInitialized = true
|
||||
|
||||
function takeAction() {
|
||||
UI.projects.education.spaces.docsSpace.reset()
|
||||
UI.projects.education.spaces.docsSpace.searchEngine.setUpSearchEngine(onIndexingFinished) // The docs needs to index the loaded workspace.
|
||||
function onIndexingFinished() {
|
||||
UI.projects.foundations.spaces.floatingSpace.inMapMode = false
|
||||
thisObject.isInitialized = true
|
||||
saveWorkspace()
|
||||
runTasksAndSessions()
|
||||
playTutorials()
|
||||
}
|
||||
}
|
||||
await UI.projects.education.spaces.docsSpace.reset()
|
||||
await UI.projects.education.spaces.tutorialSpace.reset()
|
||||
|
||||
runTasksAndSessions()
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -411,6 +435,7 @@ function newWorkspace() {
|
||||
let workspace = {
|
||||
type: 'Workspace',
|
||||
name: thisObject.workspaceNode.name,
|
||||
config: thisObject.workspaceNode.config,
|
||||
rootNodes: stringifyReadyNodes
|
||||
}
|
||||
|
||||
@@ -514,6 +539,18 @@ function newWorkspace() {
|
||||
}
|
||||
}
|
||||
|
||||
function getHierarchyHeadsByCodeNameAndNodeType(codeName, nodeType) {
|
||||
let hierarchyHeads = getHierarchyHeads()
|
||||
if (hierarchyHeads === undefined) { return }
|
||||
for (let i = 0; i < hierarchyHeads.length; i++) {
|
||||
let hierarchyHead = hierarchyHeads[i]
|
||||
let hierarchyHeadCodeName = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(hierarchyHead.payload, 'codeName')
|
||||
if (hierarchyHeadCodeName === codeName && hierarchyHead.type === nodeType) {
|
||||
return hierarchyHead
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getHierarchyHeadByNodeType(nodeType) {
|
||||
let hierarchyHeads = getHierarchyHeads()
|
||||
if (hierarchyHeads === undefined) { return }
|
||||
@@ -538,6 +575,7 @@ function newWorkspace() {
|
||||
return resultArray
|
||||
}
|
||||
|
||||
|
||||
function replaceWorkspaceByLoadingOne(project, name) {
|
||||
|
||||
let webCommand
|
||||
|
||||
@@ -100,7 +100,14 @@ function newFoundationsFloatingSpace() {
|
||||
}
|
||||
},
|
||||
physics: true,
|
||||
detachUsingMouse: false
|
||||
detachUsingMouse: false,
|
||||
shortcuts: {
|
||||
toggleMapMode: "M",
|
||||
toggleDrawRelationshipLines: "R",
|
||||
toggleDrawParentLines: "C",
|
||||
saveWorkspace: "S",
|
||||
adjustAspectRatio: "A"
|
||||
}
|
||||
}
|
||||
|
||||
return thisObject
|
||||
@@ -540,6 +547,23 @@ function newFoundationsFloatingSpace() {
|
||||
if (configSettings.detachUsingMouse !== undefined) {
|
||||
thisObject.settings.detachUsingMouse = configSettings.detachUsingMouse
|
||||
}
|
||||
if (configSettings.shortcuts !== undefined) {
|
||||
if (configSettings.shortcuts.toggleMapMode !== undefined) {
|
||||
thisObject.settings.shortcuts.toggleMapMode = configSettings.shortcuts.toggleMapMode
|
||||
}
|
||||
if (configSettings.shortcuts.toggleDrawRelationshipLines !== undefined) {
|
||||
thisObject.settings.shortcuts.toggleDrawRelationshipLines = configSettings.shortcuts.toggleDrawRelationshipLines
|
||||
}
|
||||
if (configSettings.shortcuts.toggleDrawParentLines !== undefined) {
|
||||
thisObject.settings.shortcuts.toggleDrawParentLines = configSettings.shortcuts.toggleDrawParentLines
|
||||
}
|
||||
if (configSettings.shortcuts.saveWorkspace !== undefined) {
|
||||
thisObject.settings.shortcuts.saveWorkspace = configSettings.shortcuts.saveWorkspace
|
||||
}
|
||||
if (configSettings.shortcuts.adjustAspectRatio !== undefined) {
|
||||
thisObject.settings.shortcuts.adjustAspectRatio = configSettings.shortcuts.adjustAspectRatio
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function positionContraintsPhysics() {
|
||||
|
||||
@@ -70,6 +70,7 @@ function newFoundationsSideSpace() {
|
||||
}
|
||||
|
||||
function getContainer(point, purpose) {
|
||||
if (thisObject.sidePanelTab === undefined) { return }
|
||||
let container
|
||||
|
||||
container = thisObject.sidePanelTab.getContainer(point, purpose)
|
||||
|
||||
@@ -24,7 +24,7 @@ function newFoundationsTopSpace() {
|
||||
logoImage = new Image()
|
||||
|
||||
loadImage('superalgos-header-background', backgroundImage)
|
||||
loadImage('sa-beta10-logo-horiz-dark', logoImage)
|
||||
loadImage('sa-beta11-logo-horiz-dark', logoImage)
|
||||
|
||||
function loadImage(name, image) {
|
||||
const PATH = 'Images/'
|
||||
|
||||
@@ -16,7 +16,7 @@ function newFoundationsUtilitiesBranches() {
|
||||
the array, including the children of the nodes added to the result array.
|
||||
*/
|
||||
if (node === undefined) { return }
|
||||
let resultArray = []
|
||||
let resultArray = []
|
||||
scanNodeBranch(node)
|
||||
return resultArray
|
||||
|
||||
@@ -48,6 +48,7 @@ function newFoundationsUtilitiesBranches() {
|
||||
break
|
||||
case 'array': {
|
||||
let startingNodePropertyArray = startingNode[property.name]
|
||||
if (startingNodePropertyArray === undefined) { continue }
|
||||
for (let m = 0; m < startingNodePropertyArray.length; m++) {
|
||||
scanNodeBranch(startingNodePropertyArray[m])
|
||||
}
|
||||
|
||||
@@ -2,17 +2,18 @@ function newFoundationsUtilitiesPlugins() {
|
||||
let thisObject = {
|
||||
getPluginFileNames: getPluginFileNames,
|
||||
addPluginFileIfNeeded: addPluginFileIfNeeded,
|
||||
getProjectName: getProjectName
|
||||
getProjectName: getProjectName,
|
||||
savePluginFile: savePluginFile
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function getPluginFileNames(projectName, pluginType, callBack) {
|
||||
httpRequest(undefined, 'PluginFileNames/' + projectName + '/' + pluginType, onResponse)
|
||||
function getPluginFileNames(projectName, pluginFolder, callBack) {
|
||||
httpRequest(undefined, 'PluginFileNames/' + projectName + '/' + pluginFolder, onResponse)
|
||||
|
||||
function onResponse(err, data) {
|
||||
if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
console.log('Failed to Fetch Plugin ' + pluginType + ' from the Client')
|
||||
console.log('Failed to Fetch Plugin ' + pluginFolder + ' from the Client')
|
||||
return
|
||||
}
|
||||
|
||||
@@ -21,7 +22,7 @@ function newFoundationsUtilitiesPlugins() {
|
||||
}
|
||||
}
|
||||
|
||||
function addPluginFileIfNeeded(node, fileNames) {
|
||||
function addPluginFileIfNeeded(node, fileNames, pluginFolder, nodeType) {
|
||||
for (let i = 0; i < fileNames.length; i++) {
|
||||
let fileName = fileNames[i]
|
||||
fileName = fileName.replace('.json', '')
|
||||
@@ -30,7 +31,9 @@ function newFoundationsUtilitiesPlugins() {
|
||||
child.name = fileName
|
||||
child.config = JSON.stringify({
|
||||
project: node.project,
|
||||
fileName: fileName
|
||||
fileName: fileName,
|
||||
folderName: pluginFolder,
|
||||
nodeType: nodeType
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -54,4 +57,48 @@ function newFoundationsUtilitiesPlugins() {
|
||||
|
||||
return config.codeName
|
||||
}
|
||||
|
||||
function savePluginFile(pluginFile) {
|
||||
let project = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(pluginFile.payload, 'project')
|
||||
let fileName = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(pluginFile.payload, 'fileName')
|
||||
let folderName = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(pluginFile.payload, 'folderName')
|
||||
let nodeType = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(pluginFile.payload, 'nodeType')
|
||||
|
||||
if (
|
||||
project === undefined ||
|
||||
fileName === undefined ||
|
||||
folderName === undefined ||
|
||||
nodeType === undefined
|
||||
) {
|
||||
pluginFile.payload.uiObject.setWarningMessage('This Plugin could not be saved because some Config Properties were missing.', 500)
|
||||
return
|
||||
}
|
||||
/*
|
||||
Next thing to do is to find the Plugin Hierarchy at the Workspace, and send
|
||||
a request to the Client to save it.
|
||||
*/
|
||||
let pluginToSave = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByCodeNameAndNodeType(fileName, nodeType)
|
||||
|
||||
if (pluginToSave === undefined) {
|
||||
pluginFile.payload.uiObject.setWarningMessage('This Plugin could not be saved because it could not be found at the workspace.', 500)
|
||||
return
|
||||
}
|
||||
let fileContent = JSON.stringify(
|
||||
UI.projects.foundations.functionLibraries.protocolNode.getProtocolNode(pluginToSave, false, false, true, true, true),
|
||||
undefined,
|
||||
4)
|
||||
|
||||
httpRequest(fileContent, 'SavePlugin' + '/' + project + '/' + folderName + '/' + fileName, onResponse)
|
||||
|
||||
function onResponse(err, data) {
|
||||
/* Lets check the result of the call through the http interface */
|
||||
data = JSON.parse(data)
|
||||
if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result && data.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
pluginFile.payload.uiObject.setInfoMessage('Plugin Saved.', 250)
|
||||
return
|
||||
}
|
||||
console.log('[ERROR] Saving Plugin File: ' + JSON.stringify(data))
|
||||
pluginFile.payload.uiObject.setErrorMessage('This Plugin Could not be Saved. ' + JSON.stringify(data), 500)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user