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