ftbot store types

This commit is contained in:
Matthias 2023-04-13 06:44:21 +02:00
parent 0677843bd5
commit e57df49144
3 changed files with 19 additions and 7 deletions

View File

@ -18,7 +18,7 @@ import { useBotStore } from '@/stores/ftbotwrapper';
import { TableField } from 'bootstrap-vue-next'; import { TableField } from 'bootstrap-vue-next';
export default defineComponent({ export default defineComponent({
name: 'Performance', name: 'BotPerformance',
setup() { setup() {
const botStore = useBotStore(); const botStore = useBotStore();
const tableFields = computed<TableField[]>(() => { const tableFields = computed<TableField[]>(() => {

View File

@ -539,7 +539,10 @@ export function createBotSubStore(botId: string, botName: string) {
// // TODO: Migrate calls to API to a seperate module unrelated to pinia? // // TODO: Migrate calls to API to a seperate module unrelated to pinia?
async startBot() { async startBot() {
try { try {
const { data } = await api.post<{}, AxiosResponse<StatusResponse>>('/start', {}); const { data } = await api.post<Record<string, never>, AxiosResponse<StatusResponse>>(
'/start',
{},
);
console.log(data); console.log(data);
showAlert(data.status); showAlert(data.status);
return Promise.resolve(data); return Promise.resolve(data);
@ -553,7 +556,10 @@ export function createBotSubStore(botId: string, botName: string) {
}, },
async stopBot() { async stopBot() {
try { try {
const res = await api.post<{}, AxiosResponse<StatusResponse>>('/stop', {}); const res = await api.post<Record<string, never>, AxiosResponse<StatusResponse>>(
'/stop',
{},
);
showAlert(res.data.status); showAlert(res.data.status);
return Promise.resolve(res); return Promise.resolve(res);
} catch (error) { } catch (error) {
@ -566,7 +572,10 @@ export function createBotSubStore(botId: string, botName: string) {
}, },
async stopBuy() { async stopBuy() {
try { try {
const res = await api.post<{}, AxiosResponse<StatusResponse>>('/stopbuy', {}); const res = await api.post<Record<string, never>, AxiosResponse<StatusResponse>>(
'/stopbuy',
{},
);
showAlert(res.data.status); showAlert(res.data.status);
return Promise.resolve(res); return Promise.resolve(res);
} catch (error) { } catch (error) {
@ -579,7 +588,10 @@ export function createBotSubStore(botId: string, botName: string) {
}, },
async reloadConfig() { async reloadConfig() {
try { try {
const res = await api.post<{}, AxiosResponse<StatusResponse>>('/reload_config', {}); const res = await api.post<Record<string, never>, AxiosResponse<StatusResponse>>(
'/reload_config',
{},
);
console.log(res.data); console.log(res.data);
showAlert(res.data.status); showAlert(res.data.status);
return Promise.resolve(res); return Promise.resolve(res);

View File

@ -40,7 +40,7 @@
<BotStatus /> <BotStatus />
</b-tab> </b-tab>
<b-tab title="Performance"> <b-tab title="Performance">
<Performance class="performance-view" /> <BotPerformance class="performance-view" />
</b-tab> </b-tab>
<b-tab title="Balance" lazy> <b-tab title="Balance" lazy>
<Balance /> <Balance />
@ -157,7 +157,7 @@ import DraggableContainer from '@/components/layout/DraggableContainer.vue';
import FTBotAPIPairList from '@/components/ftbot/FTBotAPIPairList.vue'; import FTBotAPIPairList from '@/components/ftbot/FTBotAPIPairList.vue';
import PairLockList from '@/components/ftbot/PairLockList.vue'; import PairLockList from '@/components/ftbot/PairLockList.vue';
import PairSummary from '@/components/ftbot/PairSummary.vue'; import PairSummary from '@/components/ftbot/PairSummary.vue';
import Performance from '@/components/ftbot/Performance.vue'; import BotPerformance from '@/components/ftbot/BotPerformance.vue.js';
import TradeDetail from '@/components/ftbot/TradeDetail.vue'; import TradeDetail from '@/components/ftbot/TradeDetail.vue';
import TradeList from '@/components/ftbot/TradeList.vue'; import TradeList from '@/components/ftbot/TradeList.vue';