mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Schema: Add schema for library panels (#62169)
This commit is contained in:
@@ -397,6 +397,9 @@ lineage: seqs: [
|
||||
// TODO tighter constraint
|
||||
timeShift?: string @grafanamaturity(NeedsExpertReview)
|
||||
|
||||
// Dynamically load the panel
|
||||
libraryPanel?: #LibraryPanelRef
|
||||
|
||||
// options is specified by the PanelOptions field in panel
|
||||
// plugin schemas.
|
||||
options: {...} @grafanamaturity(NeedsExpertReview)
|
||||
@@ -412,6 +415,11 @@ lineage: seqs: [
|
||||
}] @grafanamaturity(NeedsExpertReview)
|
||||
} @cuetsy(kind="interface") @grafana(TSVeneer="type") @grafanamaturity(NeedsExpertReview)
|
||||
|
||||
#LibraryPanelRef: {
|
||||
name: string
|
||||
uid: string
|
||||
} @cuetsy(kind="interface")
|
||||
|
||||
#MatcherConfig: {
|
||||
id: string | *"" @grafanamaturity(NeedsExpertReview)
|
||||
options?: _ @grafanamaturity(NeedsExpertReview)
|
||||
|
||||
63
kinds/librarypanel/librarypanel_kind.cue
Normal file
63
kinds/librarypanel/librarypanel_kind.cue
Normal file
@@ -0,0 +1,63 @@
|
||||
package kind
|
||||
|
||||
import "strings"
|
||||
|
||||
name: "LibraryPanel"
|
||||
maturity: "experimental"
|
||||
|
||||
lineage: seqs: [
|
||||
{
|
||||
schemas: [
|
||||
// 0.0
|
||||
{
|
||||
@grafana(TSVeneer="type")
|
||||
|
||||
// Folder UID
|
||||
folderUid?: string @grafanamaturity(ToMetadata="sys")
|
||||
|
||||
// Library element UID
|
||||
uid: string
|
||||
|
||||
// Panel name (also saved in the model)
|
||||
name: string & strings.MinRunes(1)
|
||||
|
||||
// Panel description
|
||||
description?: string
|
||||
|
||||
// The panel type (from inside the model)
|
||||
type: string & strings.MinRunes(1)
|
||||
|
||||
// Dashboard version when this was saved (zero if unknown)
|
||||
schemaVersion?: uint16
|
||||
|
||||
// panel version, incremented each time the dashboard is updated.
|
||||
version: int64 @grafanamaturity(NeedsExpertReview)
|
||||
|
||||
// TODO: should be the same panel schema defined in dashboard
|
||||
// Typescript: Omit<Panel, 'gridPos' | 'id' | 'libraryPanel'>;
|
||||
model: {...}
|
||||
|
||||
// Object storage metadata
|
||||
meta?: #LibraryElementDTOMeta @grafanamaturity(ToMetadata="sys")
|
||||
|
||||
#LibraryElementDTOMetaUser: {
|
||||
id: int64
|
||||
name: string
|
||||
avatarUrl: string
|
||||
} @cuetsy(kind="interface") @grafanamaturity(NeedsExpertReview)
|
||||
|
||||
#LibraryElementDTOMeta: {
|
||||
folderName: string
|
||||
folderUid: string @grafanamaturity(ToMetadata="sys")
|
||||
connectedDashboards: int64
|
||||
|
||||
created: string @grafanamaturity(ToMetadata="sys") // time.Time in golang
|
||||
updated: string @grafanamaturity(ToMetadata="sys") // time.Time in golang
|
||||
|
||||
createdBy: #LibraryElementDTOMetaUser @grafanamaturity(ToMetadata="sys")
|
||||
updatedBy: #LibraryElementDTOMetaUser @grafanamaturity(ToMetadata="sys")
|
||||
} @cuetsy(kind="interface") @grafanamaturity(NeedsExpertReview)
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
Reference in New Issue
Block a user