mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-26 04:55:15 +00:00
Add forcesell all button to botcontrols
This commit is contained in:
parent
b272db088a
commit
136f7a8267
|
@ -32,6 +32,14 @@
|
|||
>
|
||||
<ReloadIcon />
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-secondary btn-sm ml-1"
|
||||
:disabled="!isTrading"
|
||||
title="Forcesell all"
|
||||
@click="handleForceSell()"
|
||||
>
|
||||
<ForceSellIcon />
|
||||
</button>
|
||||
<button
|
||||
v-if="botState && botState.forcebuy_enabled"
|
||||
class="btn btn-secondary btn-sm ml-1"
|
||||
|
@ -57,12 +65,13 @@
|
|||
<script lang="ts">
|
||||
import { Component, Vue } from 'vue-property-decorator';
|
||||
import { namespace } from 'vuex-class';
|
||||
import { BotState } from '@/types';
|
||||
import { BotStoreGetters } from '@/store/modules/ftbot';
|
||||
import { BotState, ForceSellPayload } from '@/types';
|
||||
import { BotStoreActions, BotStoreGetters } from '@/store/modules/ftbot';
|
||||
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 StoreModules from '@/store/storeSubModules';
|
||||
import ForceBuyForm from './ForceBuyForm.vue';
|
||||
|
@ -70,7 +79,15 @@ import ForceBuyForm from './ForceBuyForm.vue';
|
|||
const ftbot = namespace(StoreModules.ftbot);
|
||||
|
||||
@Component({
|
||||
components: { ForceBuyForm, PlayIcon, StopIcon, PauseIcon, ReloadIcon, ForceBuyIcon },
|
||||
components: {
|
||||
ForceBuyForm,
|
||||
PlayIcon,
|
||||
StopIcon,
|
||||
PauseIcon,
|
||||
ReloadIcon,
|
||||
ForceSellIcon,
|
||||
ForceBuyIcon,
|
||||
},
|
||||
})
|
||||
export default class BotControls extends Vue {
|
||||
forcebuyShow = false;
|
||||
|
@ -87,6 +104,9 @@ export default class BotControls extends Vue {
|
|||
|
||||
@ftbot.Action startTrade;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
@ftbot.Action [BotStoreActions.forcesell]!: (payload: ForceSellPayload) => void;
|
||||
|
||||
@ftbot.Getter [BotStoreGetters.isTrading]!: boolean;
|
||||
|
||||
@ftbot.Getter [BotStoreGetters.isWebserverMode]!: boolean;
|
||||
|
@ -124,5 +144,16 @@ export default class BotControls extends Vue {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
handleForceSell() {
|
||||
this.$bvModal.msgBoxConfirm(`Really forcesell ALL trades?`).then((value) => {
|
||||
console.log(value);
|
||||
const payload: ForceSellPayload = {
|
||||
tradeid: 'all',
|
||||
// TODO: support ordertype (?)
|
||||
};
|
||||
this.forcesell(payload);
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -78,8 +78,6 @@ import { namespace } from 'vuex-class';
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
import { formatPercent, formatPrice } from '@/shared/formatters';
|
||||
import { MultiDeletePayload, MultiForcesellPayload, Trade } from '@/types';
|
||||
import DeleteIcon from 'vue-material-design-icons/Delete.vue';
|
||||
import ForceSellIcon from 'vue-material-design-icons/CloseBoxMultiple.vue';
|
||||
import ActionIcon from 'vue-material-design-icons/GestureTap.vue';
|
||||
import DateTimeTZ from '@/components/general/DateTimeTZ.vue';
|
||||
import { BotStoreGetters } from '@/store/modules/ftbot';
|
||||
|
@ -90,7 +88,7 @@ import TradeActions from './TradeActions.vue';
|
|||
const ftbot = namespace(StoreModules.ftbot);
|
||||
|
||||
@Component({
|
||||
components: { DeleteIcon, ForceSellIcon, ActionIcon, DateTimeTZ, TradeProfit, TradeActions },
|
||||
components: { ActionIcon, DateTimeTZ, TradeProfit, TradeActions },
|
||||
})
|
||||
export default class TradeList extends Vue {
|
||||
$refs!: {
|
||||
|
|
Loading…
Reference in New Issue
Block a user