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

View File

@ -43,11 +43,47 @@ export enum RunModes {
OTHER = 'other', 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 { export interface BotState {
version: string;
state: BotStates; state: BotStates;
runmode: RunModes; runmode: RunModes;
bid_strategy: object; bid_strategy: BidStrategy;
ask_strategy: object; ask_strategy: AskStrategy;
unfilledtimeout: UnfilledTimeout;
order_types: OrderTypes;
dry_run: boolean; dry_run: boolean;
exchange: string; exchange: string;
forcebuy_enabled: boolean; forcebuy_enabled: boolean;