only download usedColumns by default

This commit is contained in:
Matthias 2024-04-28 13:51:19 +02:00
parent 6dc6bc0661
commit 74883723ce
3 changed files with 18 additions and 2 deletions

View File

@ -144,7 +144,9 @@ const dataset = computed((): PairHistory => {
return botStore.activeBot.candleData[`${pair.value}__${props.timeframe}`]?.data;
});
const strategyName = computed(() => props.strategy || dataset.value?.strategy || '');
const datasetColumns = computed(() => (dataset.value ? dataset.value.columns : []));
const datasetColumns = computed(() =>
dataset.value ? dataset.value.all_columns ?? dataset.value.columns : [],
);
const hasDataset = computed(() => dataset.value && dataset.value.data.length > 0);
const isLoadingDataset = computed((): boolean => {
if (props.historicView) {
@ -196,6 +198,7 @@ function refresh() {
botStore.activeBot.getPairCandles({
pair: pair.value,
timeframe: props.timeframe,
columns: plotStore.usedColumns,
});
}
}

View File

@ -1068,7 +1068,8 @@ export function createBotSubStore(botId: string, botName: string) {
// TODO: check for active bot ...
if (pair === this.selectedPair) {
// Reload pair candles
this.getPairCandles({ pair, timeframe });
const plotStore = usePlotConfigStore();
this.getPairCandles({ pair, timeframe, columns: plotStore.usedColumns });
}
break;
}

View File

@ -39,6 +39,18 @@ export const usePlotConfigStore = defineStore('plotConfig', {
? state.editablePlotConfig
: state.customPlotConfigs[state.plotConfigName]) || deepClone(EMPTY_PLOTCONFIG),
// plotConfig: (state) => state.customPlotConfig[state.plotConfigName] || { ...EMPTY_PLOTCONFIG },
usedColumns() {
const cols: string[] = [];
for (const key in this.plotConfig.main_plot) {
cols.push(key);
}
for (const key in this.plotConfig.subplots) {
for (const subkey in this.plotConfig.subplots[key]) {
cols.push(subkey);
}
}
return cols;
},
},
actions: {
saveCustomPlotConfig(name: string, plotConfig: PlotConfig) {