mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 21:55:59 +00:00
SYNC: charts UX, error handling, bucket count limit
This commit is contained in:
committed by
Diflow
parent
ff1b688b6e
commit
adef9728f8
@@ -527,6 +527,7 @@ export function fillChartTimelineBuckets(chart: ProcessedChart) {
|
||||
const transform = chart.definition.xdef.transformFunction;
|
||||
|
||||
let currentParsed = fromParsed;
|
||||
let count = 0;
|
||||
while (compareChartDatesParsed(currentParsed, toParsed, transform) <= 0) {
|
||||
const bucketKey = stringifyChartDate(currentParsed, transform);
|
||||
if (!chart.buckets[bucketKey]) {
|
||||
@@ -534,6 +535,11 @@ export function fillChartTimelineBuckets(chart: ProcessedChart) {
|
||||
chart.bucketKeyDateParsed[bucketKey] = currentParsed;
|
||||
}
|
||||
currentParsed = incrementChartDate(currentParsed, transform);
|
||||
count++;
|
||||
if (count > ChartLimits.CHART_FILL_LIMIT) {
|
||||
chart.errorMessage = `Too many buckets to fill in chart, limit is ${ChartLimits.CHART_FILL_LIMIT}`;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user