From d654f955d9d0c1278b57c507a09dcf1c02a8bc72 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 2 Nov 2024 20:20:35 +0100 Subject: [PATCH] feat: initial working version of download-data component --- src/components/ftbot/DownloadDataMain.vue | 82 +++++++++++++++++++++++ src/stores/ftbot.ts | 13 ++++ 2 files changed, 95 insertions(+) create mode 100644 src/components/ftbot/DownloadDataMain.vue diff --git a/src/components/ftbot/DownloadDataMain.vue b/src/components/ftbot/DownloadDataMain.vue new file mode 100644 index 00000000..af9654f3 --- /dev/null +++ b/src/components/ftbot/DownloadDataMain.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/src/stores/ftbot.ts b/src/stores/ftbot.ts index 74bc728d..be3c55e9 100644 --- a/src/stores/ftbot.ts +++ b/src/stores/ftbot.ts @@ -54,6 +54,7 @@ import { PairHistory, HyperoptLossListResponse, HyperoptLossObj, + DownloadDataPayload, } from '@/types'; import axios, { AxiosResponse } from 'axios'; import { useWebSocket } from '@vueuse/core'; @@ -704,6 +705,18 @@ export function createBotSubStore(botId: string, botName: string) { return Promise.reject(error); } }, + async startDataDownload(payload: DownloadDataPayload) { + try { + const { data } = await api.post>( + '/download_data', + payload, + ); + return Promise.resolve(data); + } catch (error) { + console.error(error); + return Promise.reject(error); + } + }, // // Post methods // // TODO: Migrate calls to API to a seperate module unrelated to pinia? async startBot() {