From 99155c75e6e70dddad2a492aa808e81cc1e7c5d1 Mon Sep 17 00:00:00 2001 From: Jo Date: Tue, 31 Jan 2023 16:12:20 +0100 Subject: [PATCH] SupportBundles: Add URL in troubleshoot panels to support bundles (#62477) * add link * add link * update text * update access --------- Co-authored-by: Ryan McKinley --- pkg/api/frontendsettings.go | 2 +- pkg/services/navtree/navtreeimpl/navtree.go | 2 +- .../dashboard/components/HelpWizard/HelpWizard.tsx | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pkg/api/frontendsettings.go b/pkg/api/frontendsettings.go index ea05fdfdbaa..130b8d34a91 100644 --- a/pkg/api/frontendsettings.go +++ b/pkg/api/frontendsettings.go @@ -237,7 +237,7 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *contextmodel.ReqContext) (map[st } func isSupportBundlesEnabled(hs *HTTPServer) bool { - return hs.Cfg.SectionWithEnvOverrides("support_bundles").Key("enabled").MustBool(false) && + return hs.Cfg.SectionWithEnvOverrides("support_bundles").Key("enabled").MustBool(true) && hs.Features.IsEnabled(featuremgmt.FlagSupportBundles) } diff --git a/pkg/services/navtree/navtreeimpl/navtree.go b/pkg/services/navtree/navtreeimpl/navtree.go index 47ca4bbafc9..d1a69e780a0 100644 --- a/pkg/services/navtree/navtreeimpl/navtree.go +++ b/pkg/services/navtree/navtreeimpl/navtree.go @@ -234,7 +234,7 @@ func (s *ServiceImpl) getHomeNode(c *contextmodel.ReqContext, prefs *pref.Prefer } func isSupportBundlesEnabled(s *ServiceImpl) bool { - return s.cfg.SectionWithEnvOverrides("support_bundles").Key("enabled").MustBool(false) && + return s.cfg.SectionWithEnvOverrides("support_bundles").Key("enabled").MustBool(true) && s.features.IsEnabled(featuremgmt.FlagSupportBundles) } diff --git a/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx b/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx index 43070ebcd72..ddece468a35 100644 --- a/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx +++ b/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx @@ -24,6 +24,7 @@ import { } from '@grafana/ui'; import { contextSrv } from 'app/core/services/context_srv'; import { PanelModel } from 'app/features/dashboard/state'; +import { AccessControlAction } from 'app/types'; import { ShowMessage, SnapshotTab, SupportSnapshotService } from './SupportSnapshotService'; @@ -70,6 +71,10 @@ export function HelpWizard({ panel, plugin, onClose }: Props) { { label: 'Data', value: SnapshotTab.Data }, ]; + const hasSupportBundleAccess = + config.supportBundlesEnabled && + contextSrv.hasAccess(AccessControlAction.ActionSupportBundlesCreate, contextSrv.isGrafanaAdmin); + return ( + {hasSupportBundleAccess && ( + + You can also retrieve a support bundle containing information concerning your Grafana instance and + configured datasources in the support bundles section. + + )} } tabs={