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

63 lines
1.9 KiB

import { PanelPlugin } from '@grafana/data';
import { TablePanel } from './TablePanel';
import { CustomFieldConfig, Options } from './types';
export const plugin = new PanelPlugin<Options, CustomFieldConfig>(TablePanel)
.useFieldConfig({
useCustomConfig: builder => {
builder
.addNumberInput({
path: 'width',
name: 'Column width',
description: 'column width (for table)',
settings: {
placeholder: 'auto',
min: 20,
max: 300,
},
})
.addRadio({
path: 'align',
name: 'Column alignment',
description: 'column alignment (for table)',
settings: {
options: [
{ label: 'auto', value: null },
{ label: 'left', value: 'left' },
{ label: 'center', value: 'center' },
{ label: 'right', value: 'right' },
],
},
defaultValue: null,
})
.addSelect({
path: 'displayMode',
name: 'Cell display mode',
description: 'Color text, background, show as gauge, etc',
settings: {
options: [
{ value: 'auto', label: 'Auto' },
{ value: 'color-text', label: 'Color text' },
{ 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",
defaultValue: true,
})
.addBooleanSwitch({
path: 'resizable',
name: 'Resizable',
description: 'Toggles if table columns are resizable or not',
defaultValue: false,
});
});