feat(alerting): rename alerting dashboard names

This commit is contained in:
bergquist 2016-04-26 16:06:29 +02:00
parent 3ef2be13df
commit 55e83a3d62
4 changed files with 14 additions and 14 deletions

View File

@ -43,13 +43,13 @@ func (cmd *SaveDashboardCommand) GetAlertModels() *[]AlertRule {
OrgId: cmd.Result.OrgId, OrgId: cmd.Result.OrgId,
PanelId: panel.Get("id").MustInt64(), PanelId: panel.Get("id").MustInt64(),
Id: alerting.Get("id").MustInt64(), Id: alerting.Get("id").MustInt64(),
QueryRefId: alerting.Get("query_ref").MustString(), QueryRefId: alerting.Get("queryRef").MustString(),
WarnLevel: alerting.Get("warn_level").MustString(), WarnLevel: alerting.Get("warnLevel").MustString(),
CritLevel: alerting.Get("crit_level").MustString(), CritLevel: alerting.Get("critLevel").MustString(),
Interval: alerting.Get("interval").MustString(), Interval: alerting.Get("interval").MustString(),
Title: alerting.Get("title").MustString(), Title: alerting.Get("title").MustString(),
Description: alerting.Get("description").MustString(), Description: alerting.Get("description").MustString(),
QueryRange: alerting.Get("query_range").MustString(), QueryRange: alerting.Get("queryRange").MustString(),
Aggregator: alerting.Get("aggregator").MustString(), Aggregator: alerting.Get("aggregator").MustString(),
} }

View File

@ -67,12 +67,12 @@ func TestAlertModel(t *testing.T) {
"stack": false, "stack": false,
"steppedLine": false, "steppedLine": false,
"alerting": { "alerting": {
"query_ref": "A", "queryRef": "A",
"warn_level": "> 30", "warnLevel": "> 30",
"crit_level": "> 50", "critLevel": "> 50",
"title": "desktop visiter alerts", "title": "desktop visiter alerts",
"description": "Restart the webservers", "description": "Restart the webservers",
"query_range": "5m", "queryRange": "5m",
"aggregator": "avg", "aggregator": "avg",
"interval": "10" "interval": "10"
}, },

View File

@ -313,11 +313,11 @@ class GraphCtrl extends MetricsPanelCtrl {
convertThresholdsToAlerts() { convertThresholdsToAlerts() {
if (this.panel.grid && this.panel.grid.thresholds1) { if (this.panel.grid && this.panel.grid.thresholds1) {
this.panel.alerting.warn_level = '< ' + this.panel.grid.threshold1; this.panel.alerting.warnLevel = '< ' + this.panel.grid.threshold1;
} }
if (this.panel.grid && this.panel.grid.thresholds2) { if (this.panel.grid && this.panel.grid.thresholds2) {
this.panel.alerting.crit_level = '< ' + this.panel.grid.threshold2; this.panel.alerting.critLevel = '< ' + this.panel.grid.threshold2;
} }
} }

View File

@ -8,7 +8,7 @@
<span class="gf-form-label">Query to watch</span> <span class="gf-form-label">Query to watch</span>
<div class="gf-form-select-wrapper"> <div class="gf-form-select-wrapper">
<select class="gf-form-input gf-size-auto" <select class="gf-form-input gf-size-auto"
ng-model="ctrl.panel.alerting.query_ref" ng-model="ctrl.panel.alerting.queryRef"
ng-options="target.refId as target.refId for target in ctrl.panel.targets"></select> ng-options="target.refId as target.refId for target in ctrl.panel.targets"></select>
</div> </div>
</div> </div>
@ -17,11 +17,11 @@
<p ng-show="ctrl.panel.grid.threshold1 || ctrl.panel.grid.threshold2">We noticed you have existing threshholds.<a href="#" ng-click="ctrl.convertThresholdsToAlert()">Convert them</a></p> <p ng-show="ctrl.panel.grid.threshold1 || ctrl.panel.grid.threshold2">We noticed you have existing threshholds.<a href="#" ng-click="ctrl.convertThresholdsToAlert()">Convert them</a></p>
<div class="gf-form"> <div class="gf-form">
<span class="gf-form-label width-7">Warn level</span> <span class="gf-form-label width-7">Warn level</span>
<input class="gf-form-input max-width-7" type="text" ng-model="ctrl.panel.alerting.warn_level"></input> <input class="gf-form-input max-width-7" type="text" ng-model="ctrl.panel.alerting.warnLevel"></input>
</div> </div>
<div class="gf-form"> <div class="gf-form">
<span class="gf-form-label width-7">Critical level</span> <span class="gf-form-label width-7">Critical level</span>
<input class="gf-form-input max-width-7" type="text" ng-model="ctrl.panel.alerting.crit_level"></input> <input class="gf-form-input max-width-7" type="text" ng-model="ctrl.panel.alerting.critLevel"></input>
</div> </div>
</div> </div>
@ -39,7 +39,7 @@
<div class="gf-form"> <div class="gf-form">
<span class="gf-form-label width-10">Query range</span> <span class="gf-form-label width-10">Query range</span>
<input class="gf-form-input max-width-10" type="text" <input class="gf-form-input max-width-10" type="text"
ng-model="ctrl.panel.alerting.query_range" placeholder="10m"></input> ng-model="ctrl.panel.alerting.queryRange" placeholder="10m"></input>
</div> </div>
<div class="gf-form"> <div class="gf-form">