feat(alerting): adds fearture toogle for alerting

This commit is contained in:
bergquist 2016-04-29 14:35:58 +02:00
parent bd30a4d23e
commit 6d66d9f42d
4 changed files with 16 additions and 1 deletions

View File

@ -332,3 +332,8 @@ global_api_key = -1
# global limit on number of logged in users.
global_session = -1
#################################### Alerting ######################################
[alerting]
enabled = true

View File

@ -143,6 +143,7 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro
"latestVersion": plugins.GrafanaLatestVersion,
"hasUpdate": plugins.GrafanaHasUpdate,
},
"alertingEnabled": setting.AlertingEnabled,
}
return jsonObj, nil

View File

@ -137,6 +137,9 @@ var (
// QUOTA
Quota QuotaSettings
// Alerting
AlertingEnabled bool
)
type CommandLineArgs struct {
@ -484,6 +487,9 @@ func NewConfigContext(args *CommandLineArgs) error {
LdapEnabled = ldapSec.Key("enabled").MustBool(false)
LdapConfigFile = ldapSec.Key("config_file").String()
alerting := Cfg.Section("alerting")
AlertingEnabled = alerting.Key("enabled").MustBool(false)
readSessionConfig()
readSmtpSettings()
readQuotaSettings()

View File

@ -10,6 +10,7 @@ import moment from 'moment';
import kbn from 'app/core/utils/kbn';
import _ from 'lodash';
import TimeSeries from 'app/core/time_series2';
import config from 'app/core/config';
import * as fileExport from 'app/core/utils/file_export';
import {MetricsPanelCtrl} from 'app/plugins/sdk';
import {graphAlertEditor} from './alert_tab_ctrl';
@ -130,7 +131,9 @@ class GraphCtrl extends MetricsPanelCtrl {
this.addEditorTab('Axes', 'public/app/plugins/panel/graph/tab_axes.html', 2);
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('Alerting', graphAlertEditor, 5);
if (config.alertingEnabled) {
this.addEditorTab('Alerting', graphAlertEditor, 5);
}
this.logScales = {
'linear': 1,