Query history: Create API to add query to query history (#44479)

* Create config to enable/disable query history

* Create add to query history functionality

* Add documentation

* Add test

* Refactor

* Add test

* Fix built errors and linting errors

* Refactor

* Remove old tests

* Refactor, adjust based on feedback, add new test

* Update default value
This commit is contained in:
Ivana Huckova
2022-01-28 17:55:09 +01:00
committed by GitHub
parent ca24b95b49
commit 4e37a53a1c
15 changed files with 339 additions and 2 deletions

View File

@ -429,6 +429,9 @@ type Cfg struct {
// Unified Alerting
UnifiedAlerting UnifiedAlertingSettings
// Query history
QueryHistoryEnabled bool
}
type CommandLineArgs struct {
@ -940,6 +943,9 @@ func (cfg *Cfg) Load(args CommandLineArgs) error {
explore := iniFile.Section("explore")
ExploreEnabled = explore.Key("enabled").MustBool(true)
queryHistory := iniFile.Section("query_history")
cfg.QueryHistoryEnabled = queryHistory.Key("enabled").MustBool(false)
panelsSection := iniFile.Section("panels")
cfg.DisableSanitizeHtml = panelsSection.Key("disable_sanitize_html").MustBool(false)