Datasources: Emit event on dashboard load with queries info (#52052)
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> Co-authored-by: Andres Martinez <andres.martinez@grafana.com>
This commit is contained in:
co-authored by
Levente Balogh
Andres Martinez
parent
d7556bd189
commit
dfe33a63fb
@@ -40,3 +40,17 @@ export class DataSelectEvent extends BusEventWithPayload<DataHoverPayload> {
|
||||
export class AnnotationChangeEvent extends BusEventWithPayload<Partial<AnnotationEvent>> {
|
||||
static type = 'annotation-event';
|
||||
}
|
||||
|
||||
// Loaded the first time a dashboard is loaded (not on every render)
|
||||
export type DashboardLoadedEventPayload<T> = {
|
||||
dashboardId: string;
|
||||
orgId?: number;
|
||||
userId?: number;
|
||||
grafanaVersion?: string;
|
||||
queries: Record<string, T[]>;
|
||||
};
|
||||
|
||||
/** @alpha */
|
||||
export class DashboardLoadedEvent<T> extends BusEventWithPayload<DashboardLoadedEventPayload<T>> {
|
||||
static type = 'dashboard-loaded';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user