mirror of
https://github.com/grafana/grafana.git
synced 2025-02-16 18:34:52 -06:00
* Justify to alignment in stat * No stats label in inspect * Use sentence case in panel names * typos * typo * Typo * Query -> query options * prettier * Transformer -> transform data * Do not show deprecated plugins in the viz picker * Update viz picker layout
53 lines
1.6 KiB
TypeScript
53 lines
1.6 KiB
TypeScript
import { sharedSingleStatMigrationHandler } from '@grafana/ui';
|
|
import { PanelPlugin } from '@grafana/data';
|
|
import { StatPanelOptions, addStandardDataReduceOptions } from './types';
|
|
import { StatPanel } from './StatPanel';
|
|
import { statPanelChangedHandler } from './StatMigrations';
|
|
|
|
export const plugin = new PanelPlugin<StatPanelOptions>(StatPanel)
|
|
.useFieldConfig()
|
|
.setPanelOptions(builder => {
|
|
addStandardDataReduceOptions(builder);
|
|
|
|
builder
|
|
.addRadio({
|
|
path: 'colorMode',
|
|
name: 'Color mode',
|
|
description: 'Color either the value or the background',
|
|
defaultValue: 'value',
|
|
settings: {
|
|
options: [
|
|
{ value: 'value', label: 'Value' },
|
|
{ value: 'background', label: 'Background' },
|
|
],
|
|
},
|
|
})
|
|
.addRadio({
|
|
path: 'graphMode',
|
|
name: 'Graph mode',
|
|
description: 'Stat panel graph / sparkline mode',
|
|
defaultValue: 'area',
|
|
settings: {
|
|
options: [
|
|
{ value: 'none', label: 'None' },
|
|
{ value: 'area', label: 'Area' },
|
|
],
|
|
},
|
|
})
|
|
.addRadio({
|
|
path: 'justifyMode',
|
|
name: 'Alignment mode',
|
|
description: 'Value & title posititioning',
|
|
defaultValue: 'auto',
|
|
settings: {
|
|
options: [
|
|
{ value: 'auto', label: 'Auto' },
|
|
{ value: 'center', label: 'Center' },
|
|
],
|
|
},
|
|
});
|
|
})
|
|
.setNoPadding()
|
|
.setPanelChangeHandler(statPanelChangedHandler)
|
|
.setMigrationHandler(sharedSingleStatMigrationHandler);
|