From e16073c1fed27831785e2c67a5ef2a6865bf53f7 Mon Sep 17 00:00:00 2001 From: gmanandhar-nr Date: Mon, 2 Sep 2024 10:50:36 +0530 Subject: [PATCH] feat(dashboard): add support for initial sorting and refresh rate (#1206) --- pkg/dashboards/dashboards_types.go | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/pkg/dashboards/dashboards_types.go b/pkg/dashboards/dashboards_types.go index 4fd3263a7..5ab46d058 100644 --- a/pkg/dashboards/dashboards_types.go +++ b/pkg/dashboards/dashboards_types.go @@ -307,14 +307,16 @@ type RawConfiguration struct { // Used by viz.markdown Text string `json:"text,omitempty"` - Thresholds interface{} `json:"thresholds,omitempty"` - Legend *DashboardWidgetLegend `json:"legend,omitempty"` - YAxisLeft *DashboardWidgetYAxisLeft `json:"yAxisLeft,omitempty"` - YAxisRight *DashboardWidgetYAxisRight `json:"yAxisRight,omitempty"` - NullValues *DashboardWidgetNullValues `json:"nullValues,omitempty"` - Units *DashboardWidgetUnits `json:"units,omitempty"` - Colors *DashboardWidgetColors `json:"colors,omitempty"` - Facet *DashboardWidgetFacet `json:"facet,omitempty"` + Thresholds interface{} `json:"thresholds,omitempty"` + Legend *DashboardWidgetLegend `json:"legend,omitempty"` + YAxisLeft *DashboardWidgetYAxisLeft `json:"yAxisLeft,omitempty"` + YAxisRight *DashboardWidgetYAxisRight `json:"yAxisRight,omitempty"` + NullValues *DashboardWidgetNullValues `json:"nullValues,omitempty"` + Units *DashboardWidgetUnits `json:"units,omitempty"` + Colors *DashboardWidgetColors `json:"colors,omitempty"` + Facet *DashboardWidgetFacet `json:"facet,omitempty"` + RefreshRate *DashboardWidgetRefreshRate `json:"refreshRate,omitempty"` + InitialSorting *DashboardWidgetInitialSorting `json:"initialSorting,omitempty"` } // RawConfigurationPlatformOptions represents the platform widget options @@ -326,6 +328,15 @@ type DashboardWidgetLegend struct { Enabled *bool `json:"enabled,omitempty"` } +type DashboardWidgetRefreshRate struct { + Frequency interface{} `json:"frequency,omitempty"` +} + +type DashboardWidgetInitialSorting struct { + Direction string `json:"direction,omitempty"` + Name string `json:"name,omitempty"` +} + type DashboardWidgetYAxisLeft struct { Max float64 `json:"max,omitempty"` Min *float64 `json:"min,omitempty"`