Submit
Path:
~
/
/
usr
/
share
/
grafana
/
public
/
app
/
features
/
dashboard-scene
/
scene
/
File Content:
PanelNotices.tsx
import React from 'react'; import { SceneComponentProps, SceneObjectBase, VizPanel, sceneGraph } from '@grafana/scenes'; import { PanelHeaderNotices } from 'app/features/dashboard/dashgrid/PanelHeader/PanelHeaderNotices'; import { getPanelIdForVizPanel } from '../utils/utils'; export class PanelNotices extends SceneObjectBase { static Component = PanelNoticesRenderer; constructor() { super({}); this.addActivationHandler(this.onActivate); } private onActivate = () => { const panel = this.parent; if (!panel || !(panel instanceof VizPanel)) { throw new Error('PanelNotices can be used only as title items for VizPanel'); } }; public getPanel() { const panel = this.parent; if (panel && panel instanceof VizPanel) { return panel; } return null; } } function PanelNoticesRenderer({ model }: SceneComponentProps<PanelNotices>) { const panel = model.getPanel(); const dataObject = sceneGraph.getData(model); const data = dataObject.useState(); if (!panel) { return null; } const panelId = getPanelIdForVizPanel(panel); if (data.data?.series) { return <PanelHeaderNotices frames={data.data?.series} panelId={panelId} />; } return null; }
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
AlertStatesDataLayer.ts
6986 bytes
0644
DashboardAnnotationsDataLayer.test.ts
2000 bytes
0644
DashboardAnnotationsDataLayer.ts
1413 bytes
0644
DashboardControls.tsx
1283 bytes
0644
DashboardLinksControls.tsx
2088 bytes
0644
DashboardMacro.ts
966 bytes
0644
DashboardScene.test.tsx
9118 bytes
0644
DashboardScene.tsx
17603 bytes
0644
DashboardSceneRenderer.tsx
3280 bytes
0644
DashboardSceneUrlSync.test.ts
2767 bytes
0644
DashboardSceneUrlSync.ts
5530 bytes
0644
GoToSnapshotOriginButton.test.tsx
2303 bytes
0644
GoToSnapshotOriginButton.tsx
2007 bytes
0644
LibraryVizPanel.tsx
2245 bytes
0644
NavToolbarActions.test.tsx
2532 bytes
0644
NavToolbarActions.tsx
9842 bytes
0644
PanelLinks.tsx
1943 bytes
0644
PanelMenuBehavior.test.tsx
16261 bytes
0644
PanelMenuBehavior.tsx
14341 bytes
0644
PanelNotices.tsx
1237 bytes
0644
PanelRepeaterGridItem.test.tsx
3838 bytes
0644
PanelRepeaterGridItem.tsx
6699 bytes
0644
PanelTimeRange.test.tsx
2053 bytes
0644
PanelTimeRange.tsx
4071 bytes
0644
RowRepeaterBehavior.test.tsx
4316 bytes
0644
RowRepeaterBehavior.ts
5990 bytes
0644
ViewPanelScene.test.tsx
1875 bytes
0644
ViewPanelScene.tsx
2411 bytes
0644
keyboardShortcuts.ts
4630 bytes
0644
setDashboardPanelContext.test.ts
7884 bytes
0644
setDashboardPanelContext.ts
5957 bytes
0644
types.ts
353 bytes
0644
N4ST4R_ID | Naxtarrr