mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
schema: Use latest cuetsy to fix union generation (#50013)
Also, include the RowPanel type in code generation.
This commit is contained in:
2
go.mod
2
go.mod
@@ -50,7 +50,7 @@ require (
|
||||
github.com/google/wire v0.5.0
|
||||
github.com/gorilla/websocket v1.4.2
|
||||
github.com/gosimple/slug v1.9.0
|
||||
github.com/grafana/cuetsy v0.0.2
|
||||
github.com/grafana/cuetsy v0.0.3
|
||||
github.com/grafana/grafana-aws-sdk v0.10.3
|
||||
github.com/grafana/grafana-azure-sdk-go v1.2.0
|
||||
github.com/grafana/grafana-plugin-sdk-go v0.135.0
|
||||
|
||||
2
go.sum
2
go.sum
@@ -1450,6 +1450,8 @@ github.com/gosimple/slug v1.9.0 h1:r5vDcYrFz9BmfIAMC829un9hq7hKM4cHUrsv36LbEqs=
|
||||
github.com/gosimple/slug v1.9.0/go.mod h1:AMZ+sOVe65uByN3kgEyf9WEBKBCSS+dJjMX9x4vDJbg=
|
||||
github.com/grafana/cuetsy v0.0.2 h1:0vbU+MNznzxFyaUtbqZ6UGiOrm4HotPQGLyc121xGC8=
|
||||
github.com/grafana/cuetsy v0.0.2/go.mod h1:7OoEYb42s7PbSYtNUTy1DoCeJ3LAOTafsZbndvikTj8=
|
||||
github.com/grafana/cuetsy v0.0.3 h1:jQLkHOpfDjZiTXknv35iCOTFFK504lgsUapKuOnnNy4=
|
||||
github.com/grafana/cuetsy v0.0.3/go.mod h1:7OoEYb42s7PbSYtNUTy1DoCeJ3LAOTafsZbndvikTj8=
|
||||
github.com/grafana/dskit v0.0.0-20211011144203-3a88ec0b675f h1:FvvSVEbnGeM2bUivGmsiXTi8URJyBU7TcFEEoRe5wWI=
|
||||
github.com/grafana/dskit v0.0.0-20211011144203-3a88ec0b675f/go.mod h1:uPG2nyK4CtgNDmWv7qyzYcdI+S90kHHRWvHnBtEMBXM=
|
||||
github.com/grafana/go-mssqldb v0.0.0-20210326084033-d0ce3c521036 h1:GplhUk6Xes5JIhUUrggPcPBhOn+eT8+WsHiebvq7GgA=
|
||||
|
||||
@@ -56,9 +56,9 @@ const defaultDashboardLink: Partial<DashboardLink> = {
|
||||
targetBlank: false,
|
||||
};
|
||||
|
||||
type DashboardLinkType = 'link' | 'dashboards';
|
||||
type DashboardLinkType = ('link' | 'dashboards');
|
||||
|
||||
type VariableType = 'query' | 'adhoc' | 'constant' | 'datasource' | 'interval' | 'textbox' | 'custom' | 'system';
|
||||
type VariableType = ('query' | 'adhoc' | 'constant' | 'datasource' | 'interval' | 'textbox' | 'custom' | 'system');
|
||||
|
||||
enum FieldColorModeId {
|
||||
ContinuousGrYlRd = 'continuous-GrYlRd',
|
||||
@@ -68,11 +68,11 @@ enum FieldColorModeId {
|
||||
Thresholds = 'thresholds',
|
||||
}
|
||||
|
||||
type FieldColorSeriesByMode = 'min' | 'max' | 'last';
|
||||
type FieldColorSeriesByMode = ('min' | 'max' | 'last');
|
||||
|
||||
interface FieldColor {
|
||||
fixedColor?: string;
|
||||
mode: FieldColorModeId | string;
|
||||
mode: (FieldColorModeId | string);
|
||||
seriesBy?: FieldColorSeriesByMode;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ interface Panel {
|
||||
options: {};
|
||||
pluginVersion?: string;
|
||||
repeat?: string;
|
||||
repeatDirection: 'h' | 'v';
|
||||
repeatDirection: ('h' | 'v');
|
||||
tags?: string[];
|
||||
targets?: {}[];
|
||||
thresholds?: any[];
|
||||
@@ -170,6 +170,26 @@ const defaultPanel: Partial<Panel> = {
|
||||
transparent: false,
|
||||
};
|
||||
|
||||
interface RowPanel {
|
||||
collapsed: boolean;
|
||||
datasource?: {};
|
||||
gridPos?: GridPos;
|
||||
id: number;
|
||||
panels: (Panel | {
|
||||
type: 'graph';
|
||||
} | {
|
||||
type: 'heatmap';
|
||||
})[];
|
||||
repeat?: string;
|
||||
title?: string;
|
||||
type: 'row';
|
||||
}
|
||||
|
||||
const defaultRowPanel: Partial<RowPanel> = {
|
||||
collapsed: false,
|
||||
panels: [],
|
||||
};
|
||||
|
||||
interface Dashboard {
|
||||
annotations?: {
|
||||
list: AnnotationQuery[];
|
||||
@@ -182,23 +202,14 @@ interface Dashboard {
|
||||
id?: number;
|
||||
links?: DashboardLink[];
|
||||
liveNow?: boolean;
|
||||
panels?: Panel | {
|
||||
panels?: (Panel | RowPanel | {
|
||||
type: 'graph';
|
||||
} | {
|
||||
type: 'heatmap';
|
||||
} | {
|
||||
type: 'row';
|
||||
collapsed: boolean;
|
||||
id: number;
|
||||
panels: Panel | {
|
||||
type: 'graph';
|
||||
} | {
|
||||
type: 'heatmap';
|
||||
}[];
|
||||
}[];
|
||||
refresh?: string | false;
|
||||
})[];
|
||||
refresh?: (string | false);
|
||||
schemaVersion: number;
|
||||
style: 'light' | 'dark';
|
||||
style: ('light' | 'dark');
|
||||
tags?: string[];
|
||||
templating?: {
|
||||
list: VariableModel[];
|
||||
@@ -213,7 +224,7 @@ interface Dashboard {
|
||||
hidden: boolean;
|
||||
refresh_intervals: string[];
|
||||
};
|
||||
timezone?: 'browser' | 'utc' | '';
|
||||
timezone?: ('browser' | 'utc' | '');
|
||||
title?: string;
|
||||
uid?: string;
|
||||
version?: number;
|
||||
|
||||
@@ -78,7 +78,7 @@ export enum ScaleDirection {
|
||||
|
||||
export interface LineStyle {
|
||||
dash?: number[];
|
||||
fill?: 'solid' | 'dash' | 'dot' | 'square';
|
||||
fill?: ('solid' | 'dash' | 'dot' | 'square');
|
||||
}
|
||||
|
||||
export const defaultLineStyle: Partial<LineStyle> = {
|
||||
@@ -90,7 +90,7 @@ export interface LineConfig {
|
||||
lineInterpolation?: LineInterpolation;
|
||||
lineStyle?: LineStyle;
|
||||
lineWidth?: number;
|
||||
spanNulls?: boolean | number;
|
||||
spanNulls?: (boolean | number);
|
||||
}
|
||||
|
||||
export interface BarConfig {
|
||||
@@ -158,7 +158,7 @@ export interface GraphThresholdsStyleConfig {
|
||||
mode: GraphTresholdsStyleMode;
|
||||
}
|
||||
|
||||
export type LegendPlacement = 'bottom' | 'right';
|
||||
export type LegendPlacement = ('bottom' | 'right');
|
||||
|
||||
export enum LegendDisplayMode {
|
||||
Hidden = 'hidden',
|
||||
@@ -230,7 +230,7 @@ export enum BigValueTextMode {
|
||||
ValueAndName = 'value_and_name',
|
||||
}
|
||||
|
||||
export type FieldTextAlignment = 'auto' | 'left' | 'right' | 'center';
|
||||
export type FieldTextAlignment = ('auto' | 'left' | 'right' | 'center');
|
||||
|
||||
export enum TableCellDisplayMode {
|
||||
Auto = 'auto',
|
||||
|
||||
@@ -65,7 +65,7 @@ seqs: [
|
||||
schemaVersion: uint16 | *36 @reviewme()
|
||||
// Version of the dashboard, incremented each time the dashboard is updated.
|
||||
version?: uint32 @reviewme()
|
||||
panels?: [...(#Panel | #GraphPanel | #HeatmapPanel | #RowPanel)] @reviewme()
|
||||
panels?: [...(#Panel | #RowPanel | #GraphPanel | #HeatmapPanel)] @reviewme()
|
||||
// TODO docs
|
||||
templating?: list: [...#VariableModel] @reviewme()
|
||||
// TODO docs
|
||||
@@ -370,7 +370,7 @@ seqs: [
|
||||
panels: [...(#Panel | #GraphPanel | #HeatmapPanel)] @reviewme()
|
||||
// Name of template variable to repeat for.
|
||||
repeat?: string @reviewme()
|
||||
} @reviewme()
|
||||
} @cuetsy(kind="interface") @reviewme()
|
||||
|
||||
// Support for legacy graph and heatmap panels.
|
||||
#GraphPanel: {
|
||||
|
||||
Reference in New Issue
Block a user