mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-14 04:03:51 +00:00
wip config storage
This commit is contained in:
parent
cebf07bdee
commit
0c4c4b7fc6
|
@ -34,13 +34,21 @@
|
||||||
<b-col>
|
<b-col>
|
||||||
<b-row>
|
<b-row>
|
||||||
<b-col>
|
<b-col>
|
||||||
<b-form-input
|
<b-row>
|
||||||
|
<b-col>
|
||||||
|
<b-form-select v-model="pairlistStore.config" :options="configsSelectOptions" />
|
||||||
|
</b-col>
|
||||||
|
<b-col
|
||||||
|
><b-form-input
|
||||||
v-model="pairlistStore.config.name"
|
v-model="pairlistStore.config.name"
|
||||||
class="mb-2"
|
class="mb-2"
|
||||||
placeholder="Configuration name..."
|
placeholder="Configuration name..."
|
||||||
></b-form-input>
|
></b-form-input
|
||||||
|
></b-col>
|
||||||
|
</b-row>
|
||||||
</b-col>
|
</b-col>
|
||||||
<b-col cols="auto">
|
<b-col cols="auto">
|
||||||
|
<b-button>New</b-button>
|
||||||
<b-button @click="pairlistStore.saveConfig()">Save</b-button>
|
<b-button @click="pairlistStore.saveConfig()">Save</b-button>
|
||||||
</b-col>
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
|
|
|
@ -5,7 +5,9 @@ import { Pairlist, PairlistConfig, PairlistsPayload } from '@/types';
|
||||||
import { computed, ref, toRaw } from 'vue';
|
import { computed, ref, toRaw } from 'vue';
|
||||||
import { showAlert } from './alerts';
|
import { showAlert } from './alerts';
|
||||||
|
|
||||||
export const usePairlistConfigStore = defineStore('pairlistConfig', () => {
|
export const usePairlistConfigStore = defineStore(
|
||||||
|
'pairlistConfig',
|
||||||
|
() => {
|
||||||
const botStore = useBotStore();
|
const botStore = useBotStore();
|
||||||
|
|
||||||
const evaluating = ref<boolean>(false);
|
const evaluating = ref<boolean>(false);
|
||||||
|
@ -62,9 +64,9 @@ export const usePairlistConfigStore = defineStore('pairlistConfig', () => {
|
||||||
const i = savedConfigs.value.findIndex((c) => c.name === config.value.name);
|
const i = savedConfigs.value.findIndex((c) => c.name === config.value.name);
|
||||||
|
|
||||||
if (i > -1) {
|
if (i > -1) {
|
||||||
savedConfigs.value[i] = config.value;
|
savedConfigs.value[i] = structuredClone(toRaw(config.value));
|
||||||
} else {
|
} else {
|
||||||
savedConfigs.value.push(config.value);
|
savedConfigs.value.push(structuredClone(toRaw(config.value)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -80,4 +82,11 @@ export const usePairlistConfigStore = defineStore('pairlistConfig', () => {
|
||||||
firstPairlistIsGenerator,
|
firstPairlistIsGenerator,
|
||||||
pairlistValid,
|
pairlistValid,
|
||||||
};
|
};
|
||||||
});
|
},
|
||||||
|
{
|
||||||
|
persist: {
|
||||||
|
key: 'pairlist-configs',
|
||||||
|
paths: ['savedConfigs'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user