Commit fee48464 by Torkel Ödegaard

Merge branch 'alerting_ui' of https://github.com/smalik03/grafana into smalik03-alerting_ui

parents 4e30aa9d 9862c9ff
...@@ -404,6 +404,7 @@ global_session = -1 ...@@ -404,6 +404,7 @@ global_session = -1
[alerting] [alerting]
# Makes it possible to turn off alert rule execution. # Makes it possible to turn off alert rule execution.
execute_alerts = true execute_alerts = true
show_alerting_ui = true
#################################### Internal Grafana Metrics ############ #################################### Internal Grafana Metrics ############
# Metrics available at HTTP API Url /api/metrics # Metrics available at HTTP API Url /api/metrics
......
...@@ -140,6 +140,7 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro ...@@ -140,6 +140,7 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro
"allowOrgCreate": (setting.AllowUserOrgCreate && c.IsSignedIn) || c.IsGrafanaAdmin, "allowOrgCreate": (setting.AllowUserOrgCreate && c.IsSignedIn) || c.IsGrafanaAdmin,
"authProxyEnabled": setting.AuthProxyEnabled, "authProxyEnabled": setting.AuthProxyEnabled,
"ldapEnabled": setting.LdapEnabled, "ldapEnabled": setting.LdapEnabled,
"showAlertingUI": setting.ShowAlertingUI,
"buildInfo": map[string]interface{}{ "buildInfo": map[string]interface{}{
"version": setting.BuildVersion, "version": setting.BuildVersion,
"commit": setting.BuildCommit, "commit": setting.BuildCommit,
......
...@@ -103,7 +103,7 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) { ...@@ -103,7 +103,7 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
Children: dashboardChildNavs, Children: dashboardChildNavs,
}) })
if c.OrgRole == m.ROLE_ADMIN || c.OrgRole == m.ROLE_EDITOR { if setting.ShowAlertingUI && (c.OrgRole == m.ROLE_ADMIN || c.OrgRole == m.ROLE_EDITOR) {
alertChildNavs := []*dtos.NavLink{ alertChildNavs := []*dtos.NavLink{
{Text: "Alert List", Url: setting.AppSubUrl + "/alerting/list"}, {Text: "Alert List", Url: setting.AppSubUrl + "/alerting/list"},
{Text: "Notification channels", Url: setting.AppSubUrl + "/alerting/notifications"}, {Text: "Notification channels", Url: setting.AppSubUrl + "/alerting/notifications"},
......
...@@ -151,6 +151,7 @@ var ( ...@@ -151,6 +151,7 @@ var (
// Alerting // Alerting
ExecuteAlerts bool ExecuteAlerts bool
ShowAlertingUI bool
// logger // logger
logger log.Logger logger log.Logger
...@@ -579,6 +580,7 @@ func NewConfigContext(args *CommandLineArgs) error { ...@@ -579,6 +580,7 @@ func NewConfigContext(args *CommandLineArgs) error {
alerting := Cfg.Section("alerting") alerting := Cfg.Section("alerting")
ExecuteAlerts = alerting.Key("execute_alerts").MustBool(true) ExecuteAlerts = alerting.Key("execute_alerts").MustBool(true)
ShowAlertingUI = alerting.Key("show_alerting_ui").MustBool(true)
readSessionConfig() readSessionConfig()
readSmtpSettings() readSmtpSettings()
......
...@@ -132,7 +132,9 @@ class GraphCtrl extends MetricsPanelCtrl { ...@@ -132,7 +132,9 @@ class GraphCtrl extends MetricsPanelCtrl {
this.addEditorTab('Axes', axesEditorComponent, 2); this.addEditorTab('Axes', axesEditorComponent, 2);
this.addEditorTab('Legend', 'public/app/plugins/panel/graph/tab_legend.html', 3); this.addEditorTab('Legend', 'public/app/plugins/panel/graph/tab_legend.html', 3);
this.addEditorTab('Display', 'public/app/plugins/panel/graph/tab_display.html', 4); this.addEditorTab('Display', 'public/app/plugins/panel/graph/tab_display.html', 4);
if (config.showAlertingUI) {
this.addEditorTab('Alert', alertTab, 5); this.addEditorTab('Alert', alertTab, 5);
}
this.subTabIndex = 0; this.subTabIndex = 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment