mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(alerting): adds fearture toogle for alerting
This commit is contained in:
parent
bd30a4d23e
commit
6d66d9f42d
@ -332,3 +332,8 @@ global_api_key = -1
|
||||
|
||||
# global limit on number of logged in users.
|
||||
global_session = -1
|
||||
|
||||
|
||||
#################################### Alerting ######################################
|
||||
[alerting]
|
||||
enabled = true
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user