2021-04-08 03:11:11 -05:00
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// NOTE: This file will be auto generated from models.cue
|
|
|
|
// It is currenty hand written but will serve as the target for cuetsy
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2022-10-11 23:57:49 -05:00
|
|
|
import { TableCellDisplayMode, TableSortByFieldState, TableFooterCalc } from '@grafana/ui';
|
2021-11-09 10:10:21 -06:00
|
|
|
import { TableFieldOptions } from '@grafana/schema';
|
2021-04-08 03:11:11 -05:00
|
|
|
|
|
|
|
// Only the latest schema version is translated to TypeScript, on the premise
|
|
|
|
// that either the dashboard loading process, or (eventually) CUE-defined
|
|
|
|
// migrations ensure that bulk of the frontend application only ever
|
|
|
|
// need directly consider the most recent version of the schema.
|
|
|
|
export const modelVersion = Object.freeze([1, 0]);
|
|
|
|
|
|
|
|
export interface PanelOptions {
|
|
|
|
frameIndex: number;
|
|
|
|
showHeader: boolean;
|
2023-02-03 08:00:29 -06:00
|
|
|
showRowNums?: boolean;
|
2021-09-08 02:44:41 -05:00
|
|
|
showTypeIcons?: boolean;
|
2021-04-08 03:11:11 -05:00
|
|
|
sortBy?: TableSortByFieldState[];
|
2021-09-22 08:29:07 -05:00
|
|
|
footer?: TableFooterCalc; // TODO: should be array (options builder is limited)
|
|
|
|
}
|
|
|
|
|
2021-04-08 03:11:11 -05:00
|
|
|
export const defaultPanelOptions: PanelOptions = {
|
|
|
|
frameIndex: 0,
|
|
|
|
showHeader: true,
|
2023-02-03 08:00:29 -06:00
|
|
|
showRowNums: false,
|
2021-09-08 02:44:41 -05:00
|
|
|
showTypeIcons: false,
|
2021-09-22 08:29:07 -05:00
|
|
|
footer: {
|
|
|
|
show: false,
|
|
|
|
reducer: [],
|
2022-11-28 02:16:35 -06:00
|
|
|
countRows: false,
|
2021-09-22 08:29:07 -05:00
|
|
|
},
|
2021-04-08 03:11:11 -05:00
|
|
|
};
|
|
|
|
|
2021-11-09 10:10:21 -06:00
|
|
|
export const defaultPanelFieldConfig: TableFieldOptions = {
|
2021-05-14 01:34:17 -05:00
|
|
|
align: 'auto',
|
2023-01-12 05:42:57 -06:00
|
|
|
cellOptions: {
|
|
|
|
type: TableCellDisplayMode.Auto,
|
|
|
|
},
|
2022-02-28 08:35:05 -06:00
|
|
|
inspect: false,
|
2021-04-08 03:11:11 -05:00
|
|
|
};
|