mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-24 12:05:16 +00:00
67 lines
1.4 KiB
Vue
67 lines
1.4 KiB
Vue
<template>
|
|
<div>
|
|
<div class="w-100 d-flex">
|
|
<b-form-select v-model="locStrategy" :options="strategyList" @change="strategyChanged">
|
|
</b-form-select>
|
|
<div class="ml-2">
|
|
<b-button @click="getStrategyList">↻</b-button>
|
|
</div>
|
|
</div>
|
|
|
|
<textarea v-if="showDetails && strategy" v-model="strategyCode" class="w-100 h-100"></textarea>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { Component, Vue, Prop, Emit } from 'vue-property-decorator';
|
|
import { namespace } from 'vuex-class';
|
|
|
|
const ftbot = namespace('ftbot');
|
|
|
|
@Component({})
|
|
export default class StrategySelect extends Vue {
|
|
@Prop() value!: string;
|
|
|
|
@Prop({ default: false, required: false }) showDetails!: boolean;
|
|
|
|
@ftbot.Action getStrategyList;
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@ftbot.Action getStrategy!: (strategy: string) => void;
|
|
|
|
@ftbot.State strategyList!: string[];
|
|
|
|
@ftbot.State strategy;
|
|
|
|
@Emit('input')
|
|
emitStrategy(strategy: string) {
|
|
this.getStrategy(strategy);
|
|
return strategy;
|
|
}
|
|
|
|
get strategyCode(): string {
|
|
return this.strategy?.code;
|
|
}
|
|
|
|
get locStrategy() {
|
|
return this.value;
|
|
}
|
|
|
|
set locStrategy(val) {
|
|
this.emitStrategy(val);
|
|
}
|
|
|
|
strategyChanged(newVal) {
|
|
this.value = newVal;
|
|
}
|
|
|
|
mounted() {
|
|
if (this.strategyList.length === 0) {
|
|
this.getStrategyList();
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style></style>
|