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/plugins/panel/table2/module.tsx

41 lines
1.2 KiB

import { PanelPlugin } from '@grafana/data';
import { TablePanel } from './TablePanel';
import { CustomFieldConfig, defaults, Options } from './types';
export const plugin = new PanelPlugin<Options, CustomFieldConfig>(TablePanel)
.setDefaults(defaults)
.useFieldConfig({
useCustomConfig: builder => {
builder
.addNumberInput({
path: 'width',
name: 'Column width',
description: 'column width (for table)',
settings: {
placeholder: 'auto',
min: 20,
max: 300,
},
})
.addSelect({
path: 'displayMode',
name: 'Cell display mode',
description: 'Color value, background, show as gauge, etc',
settings: {
options: [
{ value: 'auto', label: 'Auto' },
{ value: 'color-background', label: 'Color background' },
{ value: 'gradient-gauge', label: 'Gradient gauge' },
{ value: 'lcd-gauge', label: 'LCD gauge' },
],
},
});
},
})
.setPanelOptions(builder => {
builder.addBooleanSwitch({
path: 'showHeader',
name: 'Show header',
description: "To display table's header or not to display",
});
});