mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 07:42:23 +08:00
@ -23,6 +23,7 @@ export interface FeatureToggles {
|
||||
database_metrics?: boolean;
|
||||
dashboardPreviews?: boolean;
|
||||
dashboardPreviewsScheduler?: boolean;
|
||||
dashboardPreviewsAdmin?: boolean;
|
||||
['live-config']?: boolean;
|
||||
['live-pipeline']?: boolean;
|
||||
['live-service-web-worker']?: boolean;
|
||||
|
@ -336,8 +336,11 @@ func (hs *HTTPServer) registerRoutes() {
|
||||
|
||||
if hs.ThumbService != nil {
|
||||
dashboardRoute.Get("/uid/:uid/img/:kind/:theme", hs.ThumbService.GetImage)
|
||||
dashboardRoute.Post("/uid/:uid/img/:kind/:theme", hs.ThumbService.SetImage)
|
||||
dashboardRoute.Put("/uid/:uid/img/:kind/:theme", hs.ThumbService.UpdateThumbnailState)
|
||||
|
||||
if hs.Features.IsEnabled(featuremgmt.FlagDashboardPreviewsAdmin) {
|
||||
dashboardRoute.Post("/uid/:uid/img/:kind/:theme", reqGrafanaAdmin, hs.ThumbService.SetImage)
|
||||
dashboardRoute.Put("/uid/:uid/img/:kind/:theme", reqGrafanaAdmin, hs.ThumbService.UpdateThumbnailState)
|
||||
}
|
||||
}
|
||||
|
||||
dashboardRoute.Post("/calculate-diff", routing.Wrap(hs.CalculateDashboardDiff))
|
||||
@ -470,7 +473,7 @@ func (hs *HTTPServer) registerRoutes() {
|
||||
adminRoute.Get("/stats", authorize(reqGrafanaAdmin, ac.EvalPermission(ac.ActionServerStatsRead)), routing.Wrap(hs.AdminGetStats))
|
||||
adminRoute.Post("/pause-all-alerts", reqGrafanaAdmin, routing.Wrap(hs.PauseAllAlerts))
|
||||
|
||||
if hs.ThumbService != nil {
|
||||
if hs.ThumbService != nil && hs.Features.IsEnabled(featuremgmt.FlagDashboardPreviewsAdmin) {
|
||||
adminRoute.Post("/crawler/start", reqGrafanaAdmin, routing.Wrap(hs.ThumbService.StartCrawler))
|
||||
adminRoute.Post("/crawler/stop", reqGrafanaAdmin, routing.Wrap(hs.ThumbService.StopCrawler))
|
||||
adminRoute.Get("/crawler/status", reqGrafanaAdmin, routing.Wrap(hs.ThumbService.CrawlerStatus))
|
||||
|
@ -38,6 +38,11 @@ var (
|
||||
Description: "Schedule automatic updates to dashboard previews",
|
||||
State: FeatureStateAlpha,
|
||||
},
|
||||
{
|
||||
Name: "dashboardPreviewsAdmin",
|
||||
Description: "Manage the dashboard previews crawler process from the UI",
|
||||
State: FeatureStateAlpha,
|
||||
},
|
||||
{
|
||||
Name: "live-config",
|
||||
Description: "Save grafana live configuration in SQL tables",
|
||||
|
@ -31,6 +31,10 @@ const (
|
||||
// Schedule automatic updates to dashboard previews
|
||||
FlagDashboardPreviewsScheduler = "dashboardPreviewsScheduler"
|
||||
|
||||
// FlagDashboardPreviewsAdmin
|
||||
// Manage the dashboard previews crawler process from the UI
|
||||
FlagDashboardPreviewsAdmin = "dashboardPreviewsAdmin"
|
||||
|
||||
// FlagLiveConfig
|
||||
// Save grafana live configuration in SQL tables
|
||||
FlagLiveConfig = "live-config"
|
||||
|
@ -94,7 +94,7 @@ export const ServerStats = () => {
|
||||
<p className={styles.notFound}>No stats found.</p>
|
||||
)}
|
||||
|
||||
{config.featureToggles.dashboardPreviews && <CrawlerStatus />}
|
||||
{config.featureToggles.dashboardPreviews && config.featureToggles.dashboardPreviewsAdmin && <CrawlerStatus />}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -122,7 +122,9 @@ export function GeneralSettingsUnconnected({ dashboard, updateTimeZone, updateWe
|
||||
</Field>
|
||||
</div>
|
||||
|
||||
{config.featureToggles.dashboardPreviews && <PreviewSettings uid={dashboard.uid} />}
|
||||
{config.featureToggles.dashboardPreviews && config.featureToggles.dashboardPreviewsAdmin && (
|
||||
<PreviewSettings uid={dashboard.uid} />
|
||||
)}
|
||||
|
||||
<TimePickerSettings
|
||||
onTimeZoneChange={onTimeZoneChange}
|
||||
|
Reference in New Issue
Block a user