Some minor updates

This commit is contained in:
Matthias 2022-04-21 19:36:12 +02:00
parent 4c08ec9030
commit 0c731255ab
3 changed files with 16 additions and 18 deletions

View File

@ -1,3 +1,4 @@
forceexit
<template>
<div>
<button
@ -35,10 +36,10 @@
<button
class="btn btn-secondary btn-sm ml-1"
:disabled="!botStore.activeBot.isTrading"
title="Forcesell all"
@click="handleForceSell()"
title="Force exit all"
@click="handleForceExit()"
>
<ForceSellIcon />
<ForceExitIcon />
</button>
<button
v-if="
@ -48,10 +49,10 @@
"
class="btn btn-secondary btn-sm ml-1"
:disabled="!botStore.activeBot.isTrading || !isRunning"
title="Force enter - Immediately buy an asset at an optional price. Sells are then handled according to strategy rules."
title="Force enter - Immediately enter a trade at an optional price. Exits are then handled according to strategy rules."
@click="initiateForceenter"
>
<ForceBuyIcon />
<ForceEntryIcon />
</button>
<button
v-if="botStore.activeBot.isWebserverMode && false"
@ -72,8 +73,8 @@ import PlayIcon from 'vue-material-design-icons/Play.vue';
import StopIcon from 'vue-material-design-icons/Stop.vue';
import PauseIcon from 'vue-material-design-icons/Pause.vue';
import ReloadIcon from 'vue-material-design-icons/Reload.vue';
import ForceSellIcon from 'vue-material-design-icons/CloseBoxMultiple.vue';
import ForceBuyIcon from 'vue-material-design-icons/PlusBoxMultipleOutline.vue';
import ForceExitIcon from 'vue-material-design-icons/CloseBoxMultiple.vue';
import ForceEntryIcon from 'vue-material-design-icons/PlusBoxMultipleOutline.vue';
import ForceBuyForm from './ForceBuyForm.vue';
import { defineComponent, computed, ref } from '@vue/composition-api';
import { useBotStore } from '@/stores/ftbotwrapper';
@ -86,8 +87,8 @@ export default defineComponent({
StopIcon,
PauseIcon,
ReloadIcon,
ForceSellIcon,
ForceBuyIcon,
ForceExitIcon,
ForceEntryIcon,
},
setup(_, { root }) {
const botStore = useBotStore();
@ -127,14 +128,14 @@ export default defineComponent({
});
};
const handleForceSell = () => {
const handleForceExit = () => {
root.$bvModal.msgBoxConfirm(`Really forcesell ALL trades?`).then((value: boolean) => {
if (value) {
const payload: ForceSellPayload = {
tradeid: 'all',
// TODO: support ordertype (?)
};
botStore.activeBot.forcesell(payload);
botStore.activeBot.forceexit(payload);
}
});
};
@ -143,7 +144,7 @@ export default defineComponent({
handleStopBot,
handleStopBuy,
handleReloadConfig,
handleForceSell,
handleForceExit,
forcebuyShow,
botStore,
isRunning,

View File

@ -590,7 +590,7 @@ export function createBotSubStore(botId: string, botName: string) {
return Promise.reject(error);
}
},
async forcesell(payload: ForceSellPayload) {
async forceexit(payload: ForceSellPayload) {
try {
const res = await api.post<ForceSellPayload, AxiosResponse<StatusResponse>>(
'/forcesell',

View File

@ -288,13 +288,10 @@ export const useBotStore = defineStore('wrapper', {
});
},
async forceSellMulti(forcesellPayload: MultiForcesellPayload) {
// return dispatch(`${forcesellPayload.botId}/${[BotStoreActions.forcesell]}`, forcesellPayload);
return this.botStores[forcesellPayload.botId].forceexit(forcesellPayload);
},
async deleteTradeMulti(deletePayload: MultiDeletePayload) {
// return dispatch(
// `${deletePayload.botId}/${[BotStoreActions.deleteTrade]}`,
// deletePayload.tradeid,
// );
return this.botStores[deletePayload.botId].deleteTrade(deletePayload.tradeid);
},
},
});