Merge pull request #39 from AAVikings/master

Time to competition mode and run from user folder as default
This commit is contained in:
benme authored and GitHub committed 2019-02-19 16:17:13 -03:00
commit 54898a80c9
3 files changed
+39 -21

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@superalgos/operations-client",
"version": "0.0.15",
"version": "0.0.16",
"description": "Superalgos Operations client-side web app",
"main": "src/index.js",
"dependencies": {
+23 -18
View File
@@ -32,7 +32,7 @@ class AddClone extends Component {
state: '',
stateDatetime: 0,
createDatetime: 0,
runAsTeam: true,
runAsTeam: false,
teams: [],
teamId: '',
keyId: '',
@@ -290,23 +290,28 @@ class AddClone extends Component {
</React.Fragment>
}
<Typography className={classes.typography} variant='subtitle1' align='justify'>
If Run as Team is selected, the clone will be taken from the
team respository instead of your own team member folder.
Competitions runs from the team respository.
</Typography>
<FormControlLabel
control={
<Checkbox
checked={this.state.runAsTeam}
onChange={(e)=>this.setState({runAsTeam:e.target.checked })}
value="runAsTeam"
color="primary"
{ false &&
<React.Fragment>
<Typography className={classes.typography} variant='subtitle1' align='justify'>
If Run as Team is selected, the clone will be taken from the
team respository instead of your own team member folder.
Competitions runs from the team respository.
</Typography>
<FormControlLabel
control={
<Checkbox
checked={this.state.runAsTeam}
onChange={(e)=>this.setState({runAsTeam:e.target.checked })}
value="runAsTeam"
color="primary"
/>
}
label="Run as Team"
className={classNames(classes.form, classes.textField)}
/>
}
label="Run as Team"
className={classNames(classes.form, classes.textField)}
/>
</React.Fragment>
}
</React.Fragment>
}
@@ -550,7 +555,7 @@ class AddClone extends Component {
state : '',
stateDatetime: 0,
createDatetime: 0,
runAsTeam: true,
runAsTeam: false,
processName: '',
teams: [],
teamId: '',
+15 -2
View File
@@ -3,7 +3,7 @@ import { toPlatformDatetime, isDefined } from '../config/utils'
import { KubernateError } from '../errors'
import { Client, config } from 'kubernetes-client'
import deploymentManifest from '../config/clone-deployment.json'
import { BACKTEST, NO_TIME } from '../enums/CloneMode'
import { BACKTEST, COMPETITION, LIVE, NO_TIME } from '../enums/CloneMode'
import { TRADER, INDICATOR, EXTRACTION } from '../enums/BotTypes'
const createClone = async (clone) => {
@@ -101,7 +101,20 @@ const createClone = async (clone) => {
'name': 'WAIT_TIME',
'value': clone.waitTime.toString()
})
} else {
} else if (clone.mode === COMPETITION) {
env.push({
'name': 'BEGIN_DATE_TIME',
'value': toPlatformDatetime(clone.beginDatetime)
})
env.push({
'name': 'END_DATE_TIME',
'value': toPlatformDatetime(clone.endDatetime)
})
env.push({
'name': 'KEY_ID',
'value': clone.keyId
})
} else if (clone.mode === LIVE) {
env.push({
'name': 'KEY_ID',
'value': clone.keyId