ソースを参照

feat(alerting): set default title for alerts

bergquist 9 年 前
コミット
7757d6d636

+ 2 - 1
public/app/plugins/panel/graph/alert_tab_ctrl.ts

@@ -21,7 +21,8 @@ export class AlertTabCtrl {
     this.panel.alerting.queryRange = this.panel.alerting.queryRange || '10m';
     this.panel.alerting.warnOperator = this.panel.alerting.warnOperator || '>';
     this.panel.alerting.critOperator = this.panel.alerting.critOperator || '>';
-    this.panel.alerting.title = this.panel.alerting.title || this.panel.title + ' alert';
+    var defaultTitle = (this.panelCtrl.dashboard.title + ' ' + this.panel.title + ' alert');
+    this.panel.alerting.title = this.panel.alerting.title || defaultTitle;
 
     this.panel.targets.map(target => {
       this.metricTargets.push(target);

+ 2 - 2
public/app/plugins/panel/graph/partials/tab_alerting.html

@@ -60,14 +60,14 @@
     <h5 class="section-heading">Alert info</h5>
     <div class="gf-form">
       <span class="gf-form-label width-10">Alert name</span>
-      <input type="text" class="gf-form-input width-18" ng-model="ctrl.panel.alerting.title">
+      <input type="text" class="gf-form-input width-22" ng-model="ctrl.panel.alerting.title">
     </div>
     <div class="gf-form-inline">
       <div class="gf-form">
         <span class="gf-form-label width-10" style="margin-top: -73px;">Alert description</span>
       </div>
       <div class="gf-form">
-        <textarea rows="5" ng-model="ctrl.panel.alerting.description" class="gf-form-input width-18"></textarea>
+        <textarea rows="5" ng-model="ctrl.panel.alerting.description" class="gf-form-input width-22"></textarea>
       </div>
     </div>
   </div>