frequi_origin/src/components/ftbot/PairlistConfigActions.vue

70 lines
2.1 KiB
Vue
Raw Normal View History

2023-05-30 15:45:03 +00:00
<template>
2023-06-01 15:51:16 +00:00
<div class="d-flex flex-row mb-2 gap-2">
<b-button
title="Delete config"
:disabled="!pairlistStore.isSavedConfig"
variant="dark"
@click="pairlistStore.deleteConfig()"
><i-mdi-delete width="24" height="24"
/></b-button>
2023-06-01 23:44:04 +00:00
<b-form-input v-model="configName" placeholder="Configuration name..." />
2023-06-01 15:51:16 +00:00
<b-button-group>
<b-dropdown variant="dark" title="Saved configs">
<b-dropdown-item-button
2023-05-30 15:45:03 +00:00
v-for="config in pairlistStore.savedConfigs"
:key="config.name"
@click="pairlistStore.selectConfig(config)"
2023-06-01 15:51:16 +00:00
>{{ config.name }}</b-dropdown-item-button
2023-05-30 15:45:03 +00:00
>
</b-dropdown>
<b-button
2023-06-01 15:51:16 +00:00
title="Save config"
variant="dark"
2023-06-01 23:44:04 +00:00
:disabled="!configName || pairlistStore.config.pairlists.length == 0"
@click="pairlistStore.saveConfig(configName)"
2023-06-01 15:51:16 +00:00
><i-mdi-content-save width="24" height="24"
2023-05-30 15:45:03 +00:00
/></b-button>
2023-06-01 15:51:16 +00:00
</b-button-group>
2023-06-01 23:54:03 +00:00
<b-button
title="Clone config"
variant="dark"
:disabled="!pairlistStore.config.name || !pairlistStore.isSavedConfig"
@click="pairlistStore.cloneConfig()"
><i-mdi-content-copy width="24" height="24"
/></b-button>
2023-06-01 15:51:16 +00:00
<b-button
title="New config"
variant="dark"
:disabled="pairlistStore.config.pairlists.length == 0"
@click="pairlistStore.newConfig()"
><i-mdi-plus width="24" height="24"
/></b-button>
<b-button
title="Evaluate pairlist"
:disabled="pairlistStore.evaluating || !pairlistStore.pairlistValid"
variant="primary"
class="col-lg-2"
@click="pairlistStore.startPairlistEvaluation()"
>
<b-spinner v-if="pairlistStore.evaluating" small></b-spinner>
<span>{{ pairlistStore.evaluating ? '' : 'Evaluate' }}</span>
</b-button>
</div>
2023-05-30 15:45:03 +00:00
</template>
2023-06-04 07:24:11 +00:00
<script setup lang="ts">
2023-05-30 15:45:03 +00:00
import { usePairlistConfigStore } from '@/stores/pairlistConfig';
2023-06-01 23:44:04 +00:00
import { ref, watch } from 'vue';
2023-05-30 15:45:03 +00:00
const pairlistStore = usePairlistConfigStore();
2023-06-01 23:44:04 +00:00
const configName = ref(pairlistStore.config.name);
watch(
() => pairlistStore.config.name,
() => {
configName.value = pairlistStore.config.name;
},
);
2023-05-30 15:45:03 +00:00
</script>