mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-05 08:09:22 +00:00
fix: reset the data when there are no queries to execute (#2491)
- Resets the chart rendering when there are no queries, fixes the alert preview chart when switching from the SQL to promql
This commit is contained in:
@@ -31,7 +31,11 @@ export const usePanelDataLoader = (
|
||||
variablesData: any,
|
||||
chartPanelRef: any
|
||||
) => {
|
||||
const log = (...args: any[]) => {};
|
||||
const log = (...args: any[]) => {
|
||||
// if (true) {
|
||||
// console.log(panelSchema?.value?.title + ": ", ...args);
|
||||
// }
|
||||
};
|
||||
|
||||
const state = reactive({
|
||||
data: [] as any,
|
||||
@@ -157,6 +161,10 @@ export const usePanelDataLoader = (
|
||||
|
||||
// Checking if there are queries to execute
|
||||
if (!panelSchema.value.queries?.length || !hasAtLeastOneQuery()) {
|
||||
log("loadData: there are no queries to execute");
|
||||
state.loading = false;
|
||||
state.data = [];
|
||||
state.metadata = {}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user