feat: add "download data" navbar button

This commit is contained in:
Matthias 2024-11-02 18:09:53 +01:00
parent bd232b67e5
commit 9ecdf4aa74
3 changed files with 11 additions and 0 deletions

View File

@ -115,6 +115,11 @@ watch(
<BNavItem to="/graph">Chart</BNavItem> <BNavItem to="/graph">Chart</BNavItem>
<BNavItem to="/logs">Logs</BNavItem> <BNavItem to="/logs">Logs</BNavItem>
<BNavItem v-if="botStore.canRunBacktest" to="/backtest">Backtest</BNavItem> <BNavItem v-if="botStore.canRunBacktest" to="/backtest">Backtest</BNavItem>
<BNavItem
v-if="botStore.isWebserverMode && botStore.activeBot.botApiVersion >= 2.41"
to="/download_data"
>Download Data</BNavItem
>
<BNavItem <BNavItem
v-if=" v-if="
(botStore.activeBot?.isWebserverMode ?? false) && (botStore.activeBot?.isWebserverMode ?? false) &&

View File

@ -72,6 +72,11 @@ const routes: Array<RouteRecordRaw> = [
name: 'Pairlist Configuration', name: 'Pairlist Configuration',
component: () => import('@/views/PairlistConfigView.vue'), component: () => import('@/views/PairlistConfigView.vue'),
}, },
{
path: '/download_data',
name: 'Download Data',
component: () => import('@/views/DownloadDataView.vue'),
},
{ {
path: '/(.*)*', path: '/(.*)*',
name: '404', name: '404',

View File

@ -44,6 +44,7 @@ export const useBotStore = defineStore('ftbot-wrapper', {
activeBot: (state) => state.botStores[state.selectedBot] as BotSubStore, activeBot: (state) => state.botStores[state.selectedBot] as BotSubStore,
activeBotorUndefined: (state) => state.botStores[state.selectedBot] as BotSubStore | undefined, activeBotorUndefined: (state) => state.botStores[state.selectedBot] as BotSubStore | undefined,
canRunBacktest: (state) => state.botStores[state.selectedBot]?.canRunBacktest ?? false, canRunBacktest: (state) => state.botStores[state.selectedBot]?.canRunBacktest ?? false,
isWebserverMode: (state) => state.botStores[state.selectedBot]?.isWebserverMode ?? false,
selectedBotObj: (state) => state.availableBots[state.selectedBot], selectedBotObj: (state) => state.availableBots[state.selectedBot],
nextBotId: (state) => { nextBotId: (state) => {
let botCount = Object.keys(state.availableBots).length; let botCount = Object.keys(state.availableBots).length;