mirror of https://github.com/grafana/grafana
Cue: Use BarGauge, DashList and Gauge panel cue schemas (#49580)
* user essentials mob! 🔱 * Wip * user essentials mob! 🔱 lastFile:public/app/plugins/panel/bargauge/module.tsx * user essentials mob! 🔱 * update betterer results file Co-authored-by: kay delaney <kay@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> Co-authored-by: Joao Silva <joao.silva@grafana.com>pull/49617/head
parent
ccb8888055
commit
970c395fb1
@ -1,8 +1,8 @@ |
||||
import { PanelModel } from '@grafana/data'; |
||||
import { sharedSingleStatMigrationHandler } from '@grafana/ui'; |
||||
|
||||
import { BarGaugeOptions } from './types'; |
||||
import { PanelOptions } from './models.gen'; |
||||
|
||||
export const barGaugePanelMigrationHandler = (panel: PanelModel<BarGaugeOptions>): Partial<BarGaugeOptions> => { |
||||
export const barGaugePanelMigrationHandler = (panel: PanelModel<PanelOptions>): Partial<PanelOptions> => { |
||||
return sharedSingleStatMigrationHandler(panel); |
||||
}; |
||||
|
||||
@ -0,0 +1,22 @@ |
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// This file was autogenerated by cuetsy. DO NOT EDIT!
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
import * as ui from '@grafana/schema'; |
||||
|
||||
export const modelVersion = Object.freeze([0, 0]); |
||||
|
||||
|
||||
export interface PanelOptions extends ui.SingleStatBaseOptions { |
||||
displayMode: ui.BarGaugeDisplayMode; |
||||
minVizHeight: number; |
||||
minVizWidth: number; |
||||
showUnfilled: boolean; |
||||
} |
||||
|
||||
export const defaultPanelOptions: Partial<PanelOptions> = { |
||||
displayMode: ui.BarGaugeDisplayMode.Gradient, |
||||
minVizHeight: 10, |
||||
minVizWidth: 0, |
||||
showUnfilled: true, |
||||
}; |
||||
@ -1,15 +0,0 @@ |
||||
import { SelectableValue } from '@grafana/data'; |
||||
import { SingleStatBaseOptions, BarGaugeDisplayMode } from '@grafana/ui'; |
||||
|
||||
export interface BarGaugeOptions extends SingleStatBaseOptions { |
||||
displayMode: BarGaugeDisplayMode; |
||||
showUnfilled: boolean; |
||||
minVizWidth: number; |
||||
minVizHeight: number; |
||||
} |
||||
|
||||
export const displayModes: Array<SelectableValue<string>> = [ |
||||
{ value: BarGaugeDisplayMode.Gradient, label: 'Gradient' }, |
||||
{ value: BarGaugeDisplayMode.Lcd, label: 'Retro LCD' }, |
||||
{ value: BarGaugeDisplayMode.Basic, label: 'Basic' }, |
||||
]; |
||||
@ -0,0 +1,18 @@ |
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// This file was autogenerated by cuetsy. DO NOT EDIT!
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
import * as ui from '@grafana/schema'; |
||||
|
||||
export const modelVersion = Object.freeze([0, 0]); |
||||
|
||||
|
||||
export interface PanelOptions extends ui.SingleStatBaseOptions { |
||||
showThresholdLabels: boolean; |
||||
showThresholdMarkers: boolean; |
||||
} |
||||
|
||||
export const defaultPanelOptions: Partial<PanelOptions> = { |
||||
showThresholdLabels: false, |
||||
showThresholdMarkers: true, |
||||
}; |
||||
@ -1,13 +0,0 @@ |
||||
import { VizOrientation, SelectableValue } from '@grafana/data'; |
||||
import { SingleStatBaseOptions } from '@grafana/ui/src/components/SingleStatShared/SingleStatBaseOptions'; |
||||
|
||||
export interface GaugeOptions extends SingleStatBaseOptions { |
||||
showThresholdLabels: boolean; |
||||
showThresholdMarkers: boolean; |
||||
} |
||||
|
||||
export const orientationOptions: Array<SelectableValue<VizOrientation>> = [ |
||||
{ value: VizOrientation.Auto, label: 'Auto' }, |
||||
{ value: VizOrientation.Horizontal, label: 'Horizontal' }, |
||||
{ value: VizOrientation.Vertical, label: 'Vertical' }, |
||||
]; |
||||
Loading…
Reference in new issue