mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-24 03:55:15 +00:00
feat: Add initial sample for pair templates
This commit is contained in:
parent
143f61eb54
commit
8e5e56dd67
2
src/auto-imports.d.ts
vendored
2
src/auto-imports.d.ts
vendored
|
@ -272,6 +272,7 @@ declare global {
|
|||
const useOffsetPagination: typeof import('@vueuse/core')['useOffsetPagination']
|
||||
const useOnline: typeof import('@vueuse/core')['useOnline']
|
||||
const usePageLeave: typeof import('@vueuse/core')['usePageLeave']
|
||||
const usePairTemplates: typeof import('./composables/pairTemplates')['usePairTemplates']
|
||||
const usePairlistConfigStore: typeof import('./stores/pairlistConfig')['usePairlistConfigStore']
|
||||
const useParallax: typeof import('@vueuse/core')['useParallax']
|
||||
const useParentElement: typeof import('@vueuse/core')['useParentElement']
|
||||
|
@ -649,6 +650,7 @@ declare module 'vue' {
|
|||
readonly useOffsetPagination: UnwrapRef<typeof import('@vueuse/core')['useOffsetPagination']>
|
||||
readonly useOnline: UnwrapRef<typeof import('@vueuse/core')['useOnline']>
|
||||
readonly usePageLeave: UnwrapRef<typeof import('@vueuse/core')['usePageLeave']>
|
||||
readonly usePairTemplates: UnwrapRef<typeof import('./composables/pairTemplates')['usePairTemplates']>
|
||||
readonly usePairlistConfigStore: UnwrapRef<typeof import('./stores/pairlistConfig')['usePairlistConfigStore']>
|
||||
readonly useParallax: UnwrapRef<typeof import('@vueuse/core')['useParallax']>
|
||||
readonly useParentElement: UnwrapRef<typeof import('@vueuse/core')['useParentElement']>
|
||||
|
|
|
@ -5,6 +5,8 @@ const botStore = useBotStore();
|
|||
const pairs = ref<string[]>(['XRP/USDT', 'BTC/USDT']);
|
||||
const timeframes = ref<string[]>(['5m', '1h']);
|
||||
|
||||
const { pairTemplates } = usePairTemplates();
|
||||
|
||||
const exchange = ref({
|
||||
customExchange: false,
|
||||
selectedExchange: {
|
||||
|
@ -19,6 +21,10 @@ const exchange = ref({
|
|||
function addPair() {
|
||||
pairs.value.push('');
|
||||
}
|
||||
|
||||
function addPairs(_pairs: string[]) {
|
||||
pairs.value.push(..._pairs);
|
||||
}
|
||||
function addTimeframe() {
|
||||
timeframes.value.push('');
|
||||
}
|
||||
|
@ -54,6 +60,17 @@ async function startDownload() {
|
|||
</div>
|
||||
</div>
|
||||
<BButton variant="primary" title="Add Pair" @click="addPair"><i-mdi-plus /></BButton>
|
||||
<div class="d-flex flex-column gap-1">
|
||||
<BButton
|
||||
v-for="pt in pairTemplates"
|
||||
:key="pt.idx"
|
||||
variant="secondary"
|
||||
:title="pt.pairs"
|
||||
@click="addPairs(pt.pairs)"
|
||||
>
|
||||
{{ pt.description }}
|
||||
</BButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-fill align-items-end gap-2">
|
||||
<div class="d-flex flex-column flex-shrink">
|
||||
|
|
16
src/composables/pairTemplates.ts
Normal file
16
src/composables/pairTemplates.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
const pairTemplates = ref([
|
||||
{
|
||||
description: 'All USDT Pairs',
|
||||
pairs: ['.*/USDT'],
|
||||
},
|
||||
{
|
||||
description: 'All USDT Futures Pairs',
|
||||
pairs: ['.*/USDT:USDT'],
|
||||
},
|
||||
]);
|
||||
|
||||
export function usePairTemplates() {
|
||||
return {
|
||||
pairTemplates: computed(() => pairTemplates.value.map((x, idx) => ({ ...x, idx }))),
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user