TablePanel: Add support for basic gauge as a cell display mode (#26595)

pull/25705/head
Jake Utley 5 years ago committed by GitHub
parent 9ce7fdc130
commit 95ef0417cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/grafana-ui/src/components/Table/BarGaugeCell.tsx
  2. 1
      packages/grafana-ui/src/components/Table/types.ts
  3. 1
      packages/grafana-ui/src/components/Table/utils.ts
  4. 1
      public/app/plugins/panel/table/module.tsx

@ -37,6 +37,8 @@ export const BarGaugeCell: FC<TableCellProps> = props => {
if (field.config.custom && field.config.custom.displayMode === TableCellDisplayMode.LcdGauge) {
barGaugeMode = BarGaugeDisplayMode.Lcd;
} else if (field.config.custom && field.config.custom.displayMode === TableCellDisplayMode.BasicGauge) {
barGaugeMode = BarGaugeDisplayMode.Basic;
}
let width;

@ -17,6 +17,7 @@ export enum TableCellDisplayMode {
GradientGauge = 'gradient-gauge',
LcdGauge = 'lcd-gauge',
JSONView = 'json-view',
BasicGauge = 'basic',
}
export type FieldTextAlignment = 'auto' | 'left' | 'right' | 'center';

@ -91,6 +91,7 @@ function getCellComponent(displayMode: TableCellDisplayMode, field: Field) {
case TableCellDisplayMode.ColorBackground:
return withTableStyles(DefaultCell, getBackgroundColorStyle);
case TableCellDisplayMode.LcdGauge:
case TableCellDisplayMode.BasicGauge:
case TableCellDisplayMode.GradientGauge:
return BarGaugeCell;
case TableCellDisplayMode.JSONView:

@ -45,6 +45,7 @@ export const plugin = new PanelPlugin<Options, CustomFieldConfig>(TablePanel)
{ value: TableCellDisplayMode.ColorBackground, label: 'Color background' },
{ value: TableCellDisplayMode.GradientGauge, label: 'Gradient gauge' },
{ value: TableCellDisplayMode.LcdGauge, label: 'LCD gauge' },
{ value: TableCellDisplayMode.BasicGauge, label: 'Basic gauge' },
{ value: TableCellDisplayMode.JSONView, label: 'JSON View' },
],
},

Loading…
Cancel
Save