mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-23 11:35:14 +00:00
Show botcontrols only when the bot is trading
This commit is contained in:
parent
1aa15cb18d
commit
554f64e91e
|
@ -1,15 +1,30 @@
|
|||
<template>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<button class="btn btn-primary btn-sm col-md-5 m-1" @click="startBot()">Start</button>
|
||||
<button class="btn btn-primary btn-sm col-md-5 m-1" @click="stopBot()">Stop</button>
|
||||
<button class="btn btn-primary btn-sm col-md-5 m-1" @click="stopBuy()">StopBuy</button>
|
||||
<button class="btn btn-primary btn-sm col-md-5 m-1" @click="reloadConfig()">
|
||||
<button
|
||||
class="btn btn-primary btn-sm col-md-5 m-1"
|
||||
:disabled="!isTrading"
|
||||
@click="startBot()"
|
||||
>
|
||||
Start
|
||||
</button>
|
||||
<button class="btn btn-primary btn-sm col-md-5 m-1" :disabled="!isTrading" @click="stopBot()">
|
||||
Stop
|
||||
</button>
|
||||
<button class="btn btn-primary btn-sm col-md-5 m-1" :disabled="!isTrading" @click="stopBuy()">
|
||||
StopBuy
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-primary btn-sm col-md-5 m-1"
|
||||
:disabled="!isTrading"
|
||||
@click="reloadConfig()"
|
||||
>
|
||||
Reload Config
|
||||
</button>
|
||||
<button
|
||||
v-if="botState.forcebuy_enabled"
|
||||
class="btn btn-primary btn-sm col-md-5 m-1"
|
||||
:disabled="!isTrading"
|
||||
@click="initiateForcebuy"
|
||||
>
|
||||
Forcebuy
|
||||
|
@ -22,7 +37,7 @@
|
|||
<script lang="ts">
|
||||
import { Component, Vue } from 'vue-property-decorator';
|
||||
import { namespace } from 'vuex-class';
|
||||
import { BotState } from '@/types';
|
||||
import { BotState, RunModes } from '@/types';
|
||||
import ForceBuyForm from './ForceBuyForm.vue';
|
||||
|
||||
const ftbot = namespace('ftbot');
|
||||
|
@ -41,6 +56,10 @@ export default class BotControls extends Vue {
|
|||
|
||||
@ftbot.Action reloadConfig;
|
||||
|
||||
get isTrading(): boolean {
|
||||
return this.botState.runmode === RunModes.LIVE || this.botState.runmode === RunModes.DRY_RUN;
|
||||
}
|
||||
|
||||
initiateForcebuy() {
|
||||
this.$bvModal.show('forcebuy-modal');
|
||||
}
|
||||
|
|
|
@ -41,7 +41,29 @@ export interface BalanceInterface {
|
|||
value: number;
|
||||
}
|
||||
|
||||
/** Values for BotState.state */
|
||||
export enum BotStates {
|
||||
RUNNING = 'running',
|
||||
STOPPED = 'stopped',
|
||||
RELOAD_CONFIG = 'reload_config',
|
||||
}
|
||||
|
||||
export enum RunModes {
|
||||
LIVE = 'live',
|
||||
DRY_RUN = 'dry_run',
|
||||
BACKTEST = 'backtest',
|
||||
EDGE = 'edge',
|
||||
HYPEROPT = 'hyperopt',
|
||||
UTIL_EXCHANGE = 'util_exchange',
|
||||
UTIL_NO_EXCHANGE = 'util_no_exchange',
|
||||
PLOT = 'plot',
|
||||
WEBSERVER = 'webserver',
|
||||
OTHER = 'other',
|
||||
}
|
||||
|
||||
export interface BotState {
|
||||
state: BotStates;
|
||||
runmode: RunModes;
|
||||
bid_strategy: object;
|
||||
ask_strategy: object;
|
||||
dry_run: boolean;
|
||||
|
@ -51,7 +73,6 @@ export interface BotState {
|
|||
minimal_roi: object;
|
||||
stake_amount: number;
|
||||
stake_currency: string;
|
||||
state: string;
|
||||
stoploss: number;
|
||||
strategy: string;
|
||||
/** Timeframe in readable form (e.g. 5m) */
|
||||
|
|
Loading…
Reference in New Issue
Block a user