ui: split silences into pending/elapsed/active
This commit is contained in:
parent
c0103dd8c6
commit
1e5babd843
|
@ -298,13 +298,20 @@ angular.module('am.controllers').controller('SilencesCtrl',
|
|||
$scope.refresh();
|
||||
});
|
||||
|
||||
$scope.elapsed = function(elapsed) {
|
||||
$scope.elapsed = function() {
|
||||
return function(sil) {
|
||||
if (elapsed) {
|
||||
return sil.endsAt <= new Date;
|
||||
}
|
||||
return sil.endsAt > new Date;
|
||||
}
|
||||
return sil.endsAt < new Date;
|
||||
};
|
||||
};
|
||||
$scope.pending = function() {
|
||||
return function(sil) {
|
||||
return sil.startsAt > new Date;
|
||||
};
|
||||
};
|
||||
$scope.active = function() {
|
||||
return function(sil) {
|
||||
return sil.startsAt <= new Date;
|
||||
};
|
||||
};
|
||||
|
||||
$scope.refresh();
|
||||
|
|
|
@ -29,15 +29,22 @@
|
|||
|
||||
<div class="active-silences">
|
||||
<h4 class="thin">Active</h4>
|
||||
<div class="list-item group" ng-repeat="sil in silences | filter:query | filter:elapsed(false) | orderBy:order">
|
||||
<div class="list-item group" ng-repeat="sil in silences | filter:query | filter:active() | orderBy:order">
|
||||
<silence sil="sil"></silence>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pending-silences">
|
||||
<h4 class="thin">Pending</h4>
|
||||
<div class="list-item group" ng-repeat="sil in silences | filter:query | filter:pending() | orderBy:order">
|
||||
<silence sil="sil"></silence>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="elapsed-silences">
|
||||
<h4 class="thin">Elapsed</h4>
|
||||
<div class="list-item group" ng-repeat="sil in silences | filter:query | filter:elapsed(true) | orderBy:order">
|
||||
<div class="list-item group" ng-repeat="sil in silences | filter:query | filter:elapsed() | orderBy:order">
|
||||
<silence sil="sil"></silence>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue