feat(alerting): add pause button to alert list

This commit is contained in:
bergquist 2016-10-11 09:45:38 +02:00
parent 804797245d
commit 4bbc2108f9
2 changed files with 7 additions and 4 deletions

View File

@ -270,13 +270,16 @@ func PauseAlert(c *middleware.Context, dto dtos.PauseAlertCommand) Response {
}
var response models.AlertStateType = models.AlertStateNoData
pausedState := "un paused"
if cmd.Paused {
response = models.AlertStatePaused
pausedState = "paused"
}
result := map[string]interface{}{
"alertId": cmd.AlertId,
"state": response,
"message": "alert " + pausedState,
}
return Json(200, result)

View File

@ -29,13 +29,13 @@
<div class="card-item card-item--alert">
<div class="card-item-header">
<div class="card-item-type">
<a class="card-item-cog" href="dashboard/{{alert.dashboardUri}}?panelId={{alert.panelId}}&fullscreen&edit&tab=alert" bs-tooltip="'Edit alert rule'">
<a class="card-item-cog" bs-tooltip="'Pausing an alert rule prevents it from executing'" ng-click="ctrl.pauseAlertRule(alert.id)">
<i class="fa fa-pause"></i>
</a>
<a class="card-item-cog" href="dashboard/{{alert.dashboardUri}}?panelId={{alert.panelId}}&fullscreen&edit&tab=alert" bs-tooltip="'Edit alert rule'">
<i class="icon-gf icon-gf-settings"></i>
</a>
</div>
<div class="card-item-header">
<a class="card-item-cog" ng-click="ctrl.pauseAlertRule(alert.id)">pause</a>
</div>
</div>
<div class="card-item-body">
<div class="card-item-details">