mirror of
https://github.com/grafana/grafana.git
synced 2026-08-14 07:04:57 -05:00
News: Expose config option to disable News feed (#69365)
* customize news feed * remove url customisation
This commit is contained in:
@@ -147,6 +147,7 @@ type FrontendSettingsDTO struct {
|
||||
ExploreEnabled bool `json:"exploreEnabled"`
|
||||
HelpEnabled bool `json:"helpEnabled"`
|
||||
ProfileEnabled bool `json:"profileEnabled"`
|
||||
NewsFeedEnabled bool `json:"newsFeedEnabled"`
|
||||
QueryHistoryEnabled bool `json:"queryHistoryEnabled"`
|
||||
|
||||
GoogleAnalyticsId string `json:"googleAnalyticsId"`
|
||||
|
||||
@@ -32,5 +32,6 @@ type IndexViewData struct {
|
||||
CSPEnabled bool
|
||||
IsDevelopmentEnv bool
|
||||
// Nonce is a cryptographic identifier for use with Content Security Policy.
|
||||
Nonce string
|
||||
Nonce string
|
||||
NewsFeedEnabled bool
|
||||
}
|
||||
|
||||
@@ -123,6 +123,7 @@ func (hs *HTTPServer) getFrontendSettings(c *contextmodel.ReqContext) (*dtos.Fro
|
||||
ExploreEnabled: setting.ExploreEnabled,
|
||||
HelpEnabled: setting.HelpEnabled,
|
||||
ProfileEnabled: setting.ProfileEnabled,
|
||||
NewsFeedEnabled: setting.NewsFeedEnabled,
|
||||
QueryHistoryEnabled: hs.Cfg.QueryHistoryEnabled,
|
||||
GoogleAnalyticsId: hs.Cfg.GoogleAnalyticsID,
|
||||
GoogleAnalytics4Id: hs.Cfg.GoogleAnalytics4ID,
|
||||
|
||||
@@ -110,6 +110,7 @@ func (hs *HTTPServer) setIndexViewData(c *contextmodel.ReqContext) (*dtos.IndexV
|
||||
ThemeType: theme.Type,
|
||||
AppUrl: appURL,
|
||||
AppSubUrl: appSubURL,
|
||||
NewsFeedEnabled: setting.NewsFeedEnabled,
|
||||
GoogleAnalyticsId: settings.GoogleAnalyticsId,
|
||||
GoogleAnalytics4Id: settings.GoogleAnalytics4Id,
|
||||
GoogleAnalytics4SendManualPageViews: hs.Cfg.GoogleAnalytics4SendManualPageViews,
|
||||
|
||||
@@ -135,6 +135,9 @@ var (
|
||||
// Profile UI
|
||||
ProfileEnabled bool
|
||||
|
||||
// News Feed
|
||||
NewsFeedEnabled bool
|
||||
|
||||
// Grafana.NET URL
|
||||
GrafanaComUrl string
|
||||
|
||||
@@ -1104,6 +1107,9 @@ func (cfg *Cfg) Load(args CommandLineArgs) error {
|
||||
profile := iniFile.Section("profile")
|
||||
ProfileEnabled = profile.Key("enabled").MustBool(true)
|
||||
|
||||
news := iniFile.Section("news")
|
||||
NewsFeedEnabled = news.Key("news_feed_enabled").MustBool(true)
|
||||
|
||||
queryHistory := iniFile.Section("query_history")
|
||||
cfg.QueryHistoryEnabled = queryHistory.Key("enabled").MustBool(true)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user