The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/app/features/dashboard-scene/edit-pane/MultiSelectedVizPanelsEdita...

36 lines
1.1 KiB

import { v4 as uuidv4 } from 'uuid';
import { t } from 'app/core/internationalization';
import { OptionsPaneCategoryDescriptor } from 'app/features/dashboard/components/PanelEditor/OptionsPaneCategoryDescriptor';
import { EditableDashboardElement, EditableDashboardElementInfo } from '../scene/types/EditableDashboardElement';
import { VizPanelEditableElement } from './VizPanelEditableElement';
export class MultiSelectedVizPanelsEditableElement implements EditableDashboardElement {
public readonly isEditableDashboardElement = true;
public readonly key: string;
constructor(private _panels: VizPanelEditableElement[]) {
this.key = uuidv4();
}
public getEditableElementInfo(): EditableDashboardElementInfo {
return { typeName: t('dashboard.edit-pane.elements.panels', 'Panels'), icon: 'folder', instanceName: '' };
}
public useEditPaneOptions(): OptionsPaneCategoryDescriptor[] {
const header = new OptionsPaneCategoryDescriptor({
title: ``,
id: '',
});
return [header];
}
public onDelete() {
this._panels.forEach((panel) => {
panel.onDelete();
});
}
}