mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
TablePanel: Add support for basic gauge as a cell display mode (#26595)
This commit is contained in:
parent
9ce7fdc130
commit
95ef0417cf
@ -37,6 +37,8 @@ export const BarGaugeCell: FC<TableCellProps> = props => {
|
|||||||
|
|
||||||
if (field.config.custom && field.config.custom.displayMode === TableCellDisplayMode.LcdGauge) {
|
if (field.config.custom && field.config.custom.displayMode === TableCellDisplayMode.LcdGauge) {
|
||||||
barGaugeMode = BarGaugeDisplayMode.Lcd;
|
barGaugeMode = BarGaugeDisplayMode.Lcd;
|
||||||
|
} else if (field.config.custom && field.config.custom.displayMode === TableCellDisplayMode.BasicGauge) {
|
||||||
|
barGaugeMode = BarGaugeDisplayMode.Basic;
|
||||||
}
|
}
|
||||||
|
|
||||||
let width;
|
let width;
|
||||||
|
@ -17,6 +17,7 @@ export enum TableCellDisplayMode {
|
|||||||
GradientGauge = 'gradient-gauge',
|
GradientGauge = 'gradient-gauge',
|
||||||
LcdGauge = 'lcd-gauge',
|
LcdGauge = 'lcd-gauge',
|
||||||
JSONView = 'json-view',
|
JSONView = 'json-view',
|
||||||
|
BasicGauge = 'basic',
|
||||||
}
|
}
|
||||||
|
|
||||||
export type FieldTextAlignment = 'auto' | 'left' | 'right' | 'center';
|
export type FieldTextAlignment = 'auto' | 'left' | 'right' | 'center';
|
||||||
|
@ -91,6 +91,7 @@ function getCellComponent(displayMode: TableCellDisplayMode, field: Field) {
|
|||||||
case TableCellDisplayMode.ColorBackground:
|
case TableCellDisplayMode.ColorBackground:
|
||||||
return withTableStyles(DefaultCell, getBackgroundColorStyle);
|
return withTableStyles(DefaultCell, getBackgroundColorStyle);
|
||||||
case TableCellDisplayMode.LcdGauge:
|
case TableCellDisplayMode.LcdGauge:
|
||||||
|
case TableCellDisplayMode.BasicGauge:
|
||||||
case TableCellDisplayMode.GradientGauge:
|
case TableCellDisplayMode.GradientGauge:
|
||||||
return BarGaugeCell;
|
return BarGaugeCell;
|
||||||
case TableCellDisplayMode.JSONView:
|
case TableCellDisplayMode.JSONView:
|
||||||
|
@ -45,6 +45,7 @@ export const plugin = new PanelPlugin<Options, CustomFieldConfig>(TablePanel)
|
|||||||
{ value: TableCellDisplayMode.ColorBackground, label: 'Color background' },
|
{ value: TableCellDisplayMode.ColorBackground, label: 'Color background' },
|
||||||
{ value: TableCellDisplayMode.GradientGauge, label: 'Gradient gauge' },
|
{ value: TableCellDisplayMode.GradientGauge, label: 'Gradient gauge' },
|
||||||
{ value: TableCellDisplayMode.LcdGauge, label: 'LCD gauge' },
|
{ value: TableCellDisplayMode.LcdGauge, label: 'LCD gauge' },
|
||||||
|
{ value: TableCellDisplayMode.BasicGauge, label: 'Basic gauge' },
|
||||||
{ value: TableCellDisplayMode.JSONView, label: 'JSON View' },
|
{ value: TableCellDisplayMode.JSONView, label: 'JSON View' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user