link and highlight silence in UI

This commit is contained in:
Fabian Reinartz 2015-11-09 15:30:02 +01:00
parent 5f46042dd5
commit fa64b7d1b9
4 changed files with 7 additions and 3 deletions

View File

@ -76,6 +76,9 @@ header #logo {
background: #bfbfbf;
padding: .8em;
}
.silence.highlight .overview {
background: #dfdfdf;
}
.silence .detail, .alert-item .detail {
background: #fff;
padding: .8em;

View File

@ -201,8 +201,9 @@ angular.module('am.controllers').controller('AlertsCtrl',
);
angular.module('am.controllers').controller('SilenceCtrl',
function($scope, Silence) {
function($scope, $location, Silence) {
$scope.highlight = $location.search()['hl'] == $scope.sil.id;
$scope.showDetails = false;
$scope.toggleDetails = function() {

View File

@ -10,7 +10,7 @@
<div class="right">
<div ng-show="alert.inhibited" class="left lbl muted-lbl">inhibited</div>
<div ng-show="alert.silenced" class="left lbl muted-lbl">silenced by {{ alert.silenced }}</div>
<div ng-show="alert.silenced" class="left lbl muted-lbl"><a ng-href="/#/silences?hl={{ alert.silenced }}">silenced</div>
<button type="black" disabled small>Since {{ alert.startsAt | amCalendar }}</button>
<button class="silence-button" type="secondary" ng-click="toggleSilenceForm()" small upper>Silence</button>

View File

@ -1,4 +1,4 @@
<div class="silence" ng-controller="SilenceCtrl">
<div class="silence {{ highlight ? 'highlight' : ''}}" ng-controller="SilenceCtrl">
<div class="overview group">
<div class="labels left" ng-click="toggleDetails()">
<span ng-repeat="m in sil.matchers | orderBy:name">