2020-10-24 18:04:01 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<div class="mb-2">
|
|
|
|
<label class="mr-auto h3">Pair Locks</label>
|
|
|
|
<b-button class="float-right" size="sm" @click="getLocks">↻</b-button>
|
|
|
|
</div>
|
|
|
|
<div>
|
2021-03-01 18:50:26 +00:00
|
|
|
<b-table class="table-sm" :items="currentLocks" :fields="tableFields">
|
|
|
|
<template #cell(actions)="row">
|
|
|
|
<b-button
|
|
|
|
class="btn-xs ml-1"
|
|
|
|
size="sm"
|
|
|
|
title="Delete trade"
|
|
|
|
@click="removePairLock(row.item)"
|
|
|
|
>
|
|
|
|
<DeleteIcon :size="16" />
|
|
|
|
</b-button>
|
|
|
|
</template>
|
|
|
|
</b-table>
|
2020-10-24 18:04:01 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { timestampms } from '@/shared/formatters';
|
2020-10-25 10:36:22 +00:00
|
|
|
import { BotStoreGetters } from '@/store/modules/ftbot';
|
|
|
|
import { Lock } from '@/types';
|
2020-10-24 18:04:01 +00:00
|
|
|
import { Component, Vue } from 'vue-property-decorator';
|
|
|
|
import { namespace } from 'vuex-class';
|
2021-03-01 18:50:26 +00:00
|
|
|
import DeleteIcon from 'vue-material-design-icons/Delete.vue';
|
|
|
|
import { AlertActions } from '@/store/modules/alerts';
|
2020-10-24 18:04:01 +00:00
|
|
|
|
|
|
|
const ftbot = namespace('ftbot');
|
2021-03-01 18:50:26 +00:00
|
|
|
const alerts = namespace('alerts');
|
2020-10-24 18:04:01 +00:00
|
|
|
|
2021-03-01 18:50:26 +00:00
|
|
|
@Component({
|
|
|
|
components: { DeleteIcon },
|
|
|
|
})
|
2020-10-24 18:04:01 +00:00
|
|
|
export default class PairLockList extends Vue {
|
|
|
|
@ftbot.Action getLocks;
|
|
|
|
|
2021-03-01 18:50:26 +00:00
|
|
|
@ftbot.Getter [BotStoreGetters.currentLocks]!: Lock[];
|
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
|
@ftbot.Action deleteLock!: (lockid: string) => Promise<string>;
|
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
|
@alerts.Action [AlertActions.addAlert];
|
2020-10-24 18:04:01 +00:00
|
|
|
|
|
|
|
timestampms = timestampms;
|
|
|
|
|
|
|
|
get tableFields() {
|
|
|
|
return [
|
|
|
|
{ key: 'pair', label: 'Pair' },
|
|
|
|
{ key: 'lock_end_timestamp', label: 'Until', formatter: 'timestampms' },
|
|
|
|
{ key: 'reason', label: 'Reason' },
|
2021-03-01 18:50:26 +00:00
|
|
|
{ key: 'actions' },
|
2020-10-24 18:04:01 +00:00
|
|
|
];
|
|
|
|
}
|
2021-03-01 18:50:26 +00:00
|
|
|
|
|
|
|
removePairLock(item: Lock) {
|
|
|
|
console.log(item);
|
|
|
|
if (item.id !== undefined) {
|
|
|
|
this.deleteLock(item.id);
|
|
|
|
} else {
|
|
|
|
this.addAlert({ message: 'This Freqtrade version does not support deleting locks.' });
|
|
|
|
}
|
|
|
|
}
|
2020-10-24 18:04:01 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped></style>
|