Move getVersion to show_config call

This commit is contained in:
Matthias 2021-11-06 16:18:02 +01:00
parent e167c4c13d
commit d659436e3f
2 changed files with 39 additions and 14 deletions

View File

@ -106,7 +106,6 @@ export enum BotStoreActions {
setRefreshRequired = 'setRefreshRequired',
refreshSlow = 'refreshSlow',
refreshFrequent = 'refreshFrequent',
refreshOnce = 'refreshOnce',
setDetailTrade = 'setDetailTrade',
setSelectedPair = 'setSelectedPair',
saveCustomPlotConfig = 'saveCustomPlotConfig',
@ -129,7 +128,6 @@ export enum BotStoreActions {
getBalance = 'getBalance',
getDaily = 'getDaily',
getState = 'getState',
getVersion = 'getVersion',
getLogs = 'getLogs',
startBot = 'startBot',
stopBot = 'stopBot',
@ -252,7 +250,7 @@ export function createBotSubStore(botId: string, botName: string) {
return state.strategyPlotConfig;
},
[BotStoreGetters.version](state: FtbotStateType): string {
return state.version;
return state.botState?.version || state.version;
},
[BotStoreGetters.sysinfo](state: FtbotStateType): SysInfoResponse | {} {
return state.sysinfo;
@ -475,9 +473,6 @@ export function createBotSubStore(botId: string, botName: string) {
[BotStoreActions.setIsBotOnline]({ commit }, refreshRequired: boolean) {
commit('setIsBotOnline', refreshRequired);
},
[BotStoreActions.refreshOnce]({ dispatch }) {
dispatch(BotStoreActions.getVersion);
},
async [BotStoreActions.refreshSlow]({ dispatch, getters, state }, forceUpdate = false) {
if (state.refreshing && !forceUpdate) {
return;
@ -757,12 +752,6 @@ export function createBotSubStore(botId: string, botName: string) {
.then((result) => commit('updateState', result.data))
.catch(console.error);
},
[BotStoreActions.getVersion]({ commit }) {
return api
.get('/version')
.then((result) => commit('updateVersion', result.data))
.catch(console.error);
},
[BotStoreActions.getLogs]({ commit }) {
return api
.get('/logs')

View File

@ -43,11 +43,47 @@ export enum RunModes {
OTHER = 'other',
}
export interface UnfilledTimeout {
buy: number;
sell: number;
unit: string;
exit_timeout_count: number;
}
export interface OrderTypes {
buy: string;
sell: string;
emergencysell?: string;
forcesell?: string;
forcebuy?: string;
stoploss: string;
stoploss_on_exchange: boolean;
stoploss_on_exchange_interval: number;
}
export interface PriceBase {
price_side: string;
use_order_book: boolean;
order_book_top: number;
}
export interface AskStrategy extends PriceBase {
bid_last_balance?: number;
}
export interface BidStrategy extends PriceBase {
ask_last_balance?: number;
check_depth_of_market: object;
}
export interface BotState {
version: string;
state: BotStates;
runmode: RunModes;
bid_strategy: object;
ask_strategy: object;
bid_strategy: BidStrategy;
ask_strategy: AskStrategy;
unfilledtimeout: UnfilledTimeout;
order_types: OrderTypes;
dry_run: boolean;
exchange: string;
forcebuy_enabled: boolean;