mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Schema: Remove exclusion for timeseries and update imports (#65242)
This commit is contained in:
parent
51fdf37faa
commit
7835aacc8f
@ -77,6 +77,7 @@ func corePlugins(rt *thema.Runtime) []pfs.ParsedPlugin {
|
|||||||
parsePluginOrPanic("public/app/plugins/panel/table", "table", rt),
|
parsePluginOrPanic("public/app/plugins/panel/table", "table", rt),
|
||||||
parsePluginOrPanic("public/app/plugins/panel/table-old", "table_old", rt),
|
parsePluginOrPanic("public/app/plugins/panel/table-old", "table_old", rt),
|
||||||
parsePluginOrPanic("public/app/plugins/panel/text", "text", rt),
|
parsePluginOrPanic("public/app/plugins/panel/text", "text", rt),
|
||||||
|
parsePluginOrPanic("public/app/plugins/panel/timeseries", "timeseries", rt),
|
||||||
parsePluginOrPanic("public/app/plugins/panel/traces", "traces", rt),
|
parsePluginOrPanic("public/app/plugins/panel/traces", "traces", rt),
|
||||||
parsePluginOrPanic("public/app/plugins/panel/welcome", "welcome", rt),
|
parsePluginOrPanic("public/app/plugins/panel/welcome", "welcome", rt),
|
||||||
parsePluginOrPanic("public/app/plugins/panel/xychart", "xychart", rt),
|
parsePluginOrPanic("public/app/plugins/panel/xychart", "xychart", rt),
|
||||||
|
@ -30,7 +30,7 @@ import {
|
|||||||
useTheme2,
|
useTheme2,
|
||||||
} from '@grafana/ui';
|
} from '@grafana/ui';
|
||||||
import { defaultGraphConfig, getGraphFieldConfig } from 'app/plugins/panel/timeseries/config';
|
import { defaultGraphConfig, getGraphFieldConfig } from 'app/plugins/panel/timeseries/config';
|
||||||
import { TimeSeriesOptions } from 'app/plugins/panel/timeseries/types';
|
import { PanelOptions as TimeSeriesOptions } from 'app/plugins/panel/timeseries/panelcfg.gen';
|
||||||
import { ExploreGraphStyle } from 'app/types';
|
import { ExploreGraphStyle } from 'app/types';
|
||||||
|
|
||||||
import { seriesVisibilityConfigFactory } from '../../dashboard/dashgrid/SeriesVisibilityConfigFactory';
|
import { seriesVisibilityConfigFactory } from '../../dashboard/dashgrid/SeriesVisibilityConfigFactory';
|
||||||
|
@ -2,7 +2,7 @@ import { VizPanel, VizPanelState } from '@grafana/scenes';
|
|||||||
import { GraphFieldConfig, TableFieldOptions } from '@grafana/schema';
|
import { GraphFieldConfig, TableFieldOptions } from '@grafana/schema';
|
||||||
import { PanelOptions as BarGaugePanelOptions } from 'app/plugins/panel/bargauge/panelcfg.gen';
|
import { PanelOptions as BarGaugePanelOptions } from 'app/plugins/panel/bargauge/panelcfg.gen';
|
||||||
import { PanelOptions as TablePanelOptions } from 'app/plugins/panel/table/panelcfg.gen';
|
import { PanelOptions as TablePanelOptions } from 'app/plugins/panel/table/panelcfg.gen';
|
||||||
import { TimeSeriesOptions } from 'app/plugins/panel/timeseries/types';
|
import { PanelOptions as TimeSeriesOptions } from 'app/plugins/panel/timeseries/panelcfg.gen';
|
||||||
|
|
||||||
export type TypedVizPanelState<TOptions, TFieldConfig> = Omit<
|
export type TypedVizPanelState<TOptions, TFieldConfig> = Omit<
|
||||||
Partial<VizPanelState<TOptions, TFieldConfig>>,
|
Partial<VizPanelState<TOptions, TFieldConfig>>,
|
||||||
|
@ -25,7 +25,6 @@ import (
|
|||||||
var skipPlugins = map[string]bool{
|
var skipPlugins = map[string]bool{
|
||||||
"canvas": true,
|
"canvas": true,
|
||||||
"candlestick": true,
|
"candlestick": true,
|
||||||
"timeseries": true,
|
|
||||||
"influxdb": true, // plugin.json fails validation (defaultMatchFormat)
|
"influxdb": true, // plugin.json fails validation (defaultMatchFormat)
|
||||||
"mixed": true, // plugin.json fails validation (mixed)
|
"mixed": true, // plugin.json fails validation (mixed)
|
||||||
"opentsdb": true, // plugin.json fails validation (defaultMatchFormat)
|
"opentsdb": true, // plugin.json fails validation (defaultMatchFormat)
|
||||||
|
@ -7,16 +7,16 @@ import { KeyboardPlugin, TimeSeries, TooltipPlugin, usePanelContext, ZoomPlugin
|
|||||||
import { config } from 'app/core/config';
|
import { config } from 'app/core/config';
|
||||||
import { getFieldLinksForExplore } from 'app/features/explore/utils/links';
|
import { getFieldLinksForExplore } from 'app/features/explore/utils/links';
|
||||||
|
|
||||||
|
import { PanelOptions } from './panelcfg.gen';
|
||||||
import { AnnotationEditorPlugin } from './plugins/AnnotationEditorPlugin';
|
import { AnnotationEditorPlugin } from './plugins/AnnotationEditorPlugin';
|
||||||
import { AnnotationsPlugin } from './plugins/AnnotationsPlugin';
|
import { AnnotationsPlugin } from './plugins/AnnotationsPlugin';
|
||||||
import { ContextMenuPlugin } from './plugins/ContextMenuPlugin';
|
import { ContextMenuPlugin } from './plugins/ContextMenuPlugin';
|
||||||
import { ExemplarsPlugin, getVisibleLabels } from './plugins/ExemplarsPlugin';
|
import { ExemplarsPlugin, getVisibleLabels } from './plugins/ExemplarsPlugin';
|
||||||
import { OutsideRangePlugin } from './plugins/OutsideRangePlugin';
|
import { OutsideRangePlugin } from './plugins/OutsideRangePlugin';
|
||||||
import { ThresholdControlsPlugin } from './plugins/ThresholdControlsPlugin';
|
import { ThresholdControlsPlugin } from './plugins/ThresholdControlsPlugin';
|
||||||
import { TimeSeriesOptions } from './types';
|
|
||||||
import { getTimezones, prepareGraphableFields, regenerateLinksSupplier } from './utils';
|
import { getTimezones, prepareGraphableFields, regenerateLinksSupplier } from './utils';
|
||||||
|
|
||||||
interface TimeSeriesPanelProps extends PanelProps<TimeSeriesOptions> {}
|
interface TimeSeriesPanelProps extends PanelProps<PanelOptions> {}
|
||||||
|
|
||||||
export const TimeSeriesPanel = ({
|
export const TimeSeriesPanel = ({
|
||||||
data,
|
data,
|
||||||
|
@ -33,7 +33,7 @@ import {
|
|||||||
} from '@grafana/schema';
|
} from '@grafana/schema';
|
||||||
|
|
||||||
import { defaultGraphConfig } from './config';
|
import { defaultGraphConfig } from './config';
|
||||||
import { TimeSeriesOptions } from './types';
|
import { PanelOptions } from './panelcfg.gen';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is called when the panel changes from another panel
|
* This is called when the panel changes from another panel
|
||||||
@ -61,7 +61,7 @@ export const graphPanelChangedHandler: PanelTypeChangedHandler = (
|
|||||||
return {};
|
return {};
|
||||||
};
|
};
|
||||||
|
|
||||||
export function graphToTimeseriesOptions(angular: any): { fieldConfig: FieldConfigSource; options: TimeSeriesOptions } {
|
export function graphToTimeseriesOptions(angular: any): { fieldConfig: FieldConfigSource; options: PanelOptions } {
|
||||||
const overrides: ConfigOverrideRule[] = angular.fieldConfig?.overrides ?? [];
|
const overrides: ConfigOverrideRule[] = angular.fieldConfig?.overrides ?? [];
|
||||||
const yaxes = angular.yaxes ?? [];
|
const yaxes = angular.yaxes ?? [];
|
||||||
let y1 = getFieldConfigFromOldAxis(yaxes[0]);
|
let y1 = getFieldConfigFromOldAxis(yaxes[0]);
|
||||||
@ -316,7 +316,7 @@ export function graphToTimeseriesOptions(angular: any): { fieldConfig: FieldConf
|
|||||||
y1.custom = omitBy(graph, isNil);
|
y1.custom = omitBy(graph, isNil);
|
||||||
y1.nullValueMode = angular.nullPointMode as NullValueMode;
|
y1.nullValueMode = angular.nullPointMode as NullValueMode;
|
||||||
|
|
||||||
const options: TimeSeriesOptions = {
|
const options: PanelOptions = {
|
||||||
legend: {
|
legend: {
|
||||||
displayMode: LegendDisplayMode.List,
|
displayMode: LegendDisplayMode.List,
|
||||||
showLegend: true,
|
showLegend: true,
|
||||||
|
@ -6,10 +6,10 @@ import { TimeSeriesPanel } from './TimeSeriesPanel';
|
|||||||
import { TimezonesEditor } from './TimezonesEditor';
|
import { TimezonesEditor } from './TimezonesEditor';
|
||||||
import { defaultGraphConfig, getGraphFieldConfig } from './config';
|
import { defaultGraphConfig, getGraphFieldConfig } from './config';
|
||||||
import { graphPanelChangedHandler } from './migrations';
|
import { graphPanelChangedHandler } from './migrations';
|
||||||
|
import { PanelOptions } from './panelcfg.gen';
|
||||||
import { TimeSeriesSuggestionsSupplier } from './suggestions';
|
import { TimeSeriesSuggestionsSupplier } from './suggestions';
|
||||||
import { TimeSeriesOptions } from './types';
|
|
||||||
|
|
||||||
export const plugin = new PanelPlugin<TimeSeriesOptions, GraphFieldConfig>(TimeSeriesPanel)
|
export const plugin = new PanelPlugin<PanelOptions, GraphFieldConfig>(TimeSeriesPanel)
|
||||||
.setPanelChangeHandler(graphPanelChangedHandler)
|
.setPanelChangeHandler(graphPanelChangedHandler)
|
||||||
.useFieldConfig(getGraphFieldConfig(defaultGraphConfig))
|
.useFieldConfig(getGraphFieldConfig(defaultGraphConfig))
|
||||||
.setPanelOptions((builder) => {
|
.setPanelOptions((builder) => {
|
||||||
|
@ -24,10 +24,11 @@ composableKinds: PanelCfg: {
|
|||||||
{
|
{
|
||||||
schemas: [
|
schemas: [
|
||||||
{
|
{
|
||||||
PanelOptions: {
|
PanelOptions: common.OptionsWithTimezones & {
|
||||||
legend: common.VizLegendOptions
|
legend: common.VizLegendOptions
|
||||||
tooltip: common.VizTooltipOptions
|
tooltip: common.VizTooltipOptions
|
||||||
} @cuetsy(kind="interface")
|
} @cuetsy(kind="interface")
|
||||||
|
|
||||||
PanelFieldConfig: common.GraphFieldConfig & {} @cuetsy(kind="interface")
|
PanelFieldConfig: common.GraphFieldConfig & {} @cuetsy(kind="interface")
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
20
public/app/plugins/panel/timeseries/panelcfg.gen.ts
Normal file
20
public/app/plugins/panel/timeseries/panelcfg.gen.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Generated by:
|
||||||
|
// public/app/plugins/gen.go
|
||||||
|
// Using jennies:
|
||||||
|
// TSTypesJenny
|
||||||
|
// PluginTSTypesJenny
|
||||||
|
//
|
||||||
|
// Run 'make gen-cue' from repository root to regenerate.
|
||||||
|
|
||||||
|
import * as common from '@grafana/schema';
|
||||||
|
|
||||||
|
export const PanelCfgModelVersion = Object.freeze([0, 0]);
|
||||||
|
|
||||||
|
export interface PanelOptions extends common.OptionsWithTimezones {
|
||||||
|
legend: common.VizLegendOptions;
|
||||||
|
tooltip: common.VizTooltipOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PanelFieldConfig extends common.GraphFieldConfig {}
|
@ -2,7 +2,7 @@ import { FieldColorModeId, VisualizationSuggestionsBuilder } from '@grafana/data
|
|||||||
import { GraphDrawStyle, GraphFieldConfig, GraphGradientMode, LineInterpolation, StackingMode } from '@grafana/schema';
|
import { GraphDrawStyle, GraphFieldConfig, GraphGradientMode, LineInterpolation, StackingMode } from '@grafana/schema';
|
||||||
import { SuggestionName } from 'app/types/suggestions';
|
import { SuggestionName } from 'app/types/suggestions';
|
||||||
|
|
||||||
import { TimeSeriesOptions } from './types';
|
import { PanelOptions } from './panelcfg.gen';
|
||||||
|
|
||||||
export class TimeSeriesSuggestionsSupplier {
|
export class TimeSeriesSuggestionsSupplier {
|
||||||
getSuggestionsForData(builder: VisualizationSuggestionsBuilder) {
|
getSuggestionsForData(builder: VisualizationSuggestionsBuilder) {
|
||||||
@ -12,7 +12,7 @@ export class TimeSeriesSuggestionsSupplier {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const list = builder.getListAppender<TimeSeriesOptions, GraphFieldConfig>({
|
const list = builder.getListAppender<PanelOptions, GraphFieldConfig>({
|
||||||
name: SuggestionName.LineChart,
|
name: SuggestionName.LineChart,
|
||||||
pluginId: 'timeseries',
|
pluginId: 'timeseries',
|
||||||
options: {
|
options: {
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
import { OptionsWithLegend, OptionsWithTimezones, OptionsWithTooltip } from '@grafana/schema';
|
|
||||||
|
|
||||||
export interface TimeSeriesOptions extends OptionsWithLegend, OptionsWithTooltip, OptionsWithTimezones {}
|
|
Loading…
Reference in New Issue
Block a user