Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Hawkular-654 Trigger Detail (Checkpoint 3, WIP)
Browse files Browse the repository at this point in the history
- Migrate trigger defs into resource controllers for earlier creation
  - also because resource alert controllers are likely doomed
  - more migration pendning
- Move to having 'Alert Settings' links forward to pre-filtered AC defs view
  - Tag triggers with owning resourceIds to allow for fetch by resource
- Improve percentage range view
  • Loading branch information
jshaughn committed Nov 11, 2015
1 parent 95e0e3b commit 219a224
Show file tree
Hide file tree
Showing 10 changed files with 1,005 additions and 500 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h3 class="pull-left">
</button>
</h3>
<span class="hk-settings pull-left">
<a href="#" ng-controller="JvmAlertController as jac" ng-click="jac.openSetup()">
<a href="/hawkular-ui/alerts-center-triggers/{{vm.resourceId}}">
<i class="fa fa-cog"></i>Alert Settings
</a>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,35 @@ <h3>Alert Settings</h3>
tc.adm.trigger.conditionContext.description : "Range"}}
</legend>

<!--
<div class="form-group">
<label class="col-sm-3 control-label">Maximum</label>
<label class="col-sm-3 control-label">Current {{tc.adm.trigger.context.triggerTypeProperty2}}</label>
<div class="col-sm-6">
<span class="hk-input-text">{{tc.ceiling / 1024 / 1024 | number : 2}} MB</span>
<span class="hk-input-text">{{tc.ceiling | number : 2}} {{tc.adm.trigger.conditionContext.unit}}</span>
</div>
</div>
-->
<div class="form-group">
<label class="col-sm-3 control-label" for="usage-greater">Usage greater than</label>
<label class="col-sm-3 control-label" for="usage-greater">Greater than</label>

<div class="col-sm-5">
<div class="input-group hk-input-small">
<div class="input-group">
<input type="number" min="0" max="100" ng-model="tc.adm.trigger.conditionGtPercent"
class="form-control" id="usage-greater">

<div class="input-group-addon">%</div>
<div class="input-group-addon">% {{tc.adm.trigger.context.triggerTypeProperty2}}</div>
</div>
<span class="input-detail">({{tc.adm.trigger.conditionGtPercent ? (tc.ceiling * tc.adm.trigger.conditionGtPercent / 100/1024/1024 | number:2) : '-'}} MB)</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="usage-less">Usage less than</label>
<label class="col-sm-3 control-label" for="usage-less">or Less than</label>

<div class="col-sm-5">
<div class="input-group hk-input-small">
<div class="input-group">
<input type="number" min="0" max="100" ng-model="tc.adm.trigger.conditionLtPercent"
class="form-control" id="usage-less">

<div class="input-group-addon">%</div>
<div class="input-group-addon">% {{tc.adm.trigger.context.triggerTypeProperty2}}</div>
</div>
<span class="input-detail">({{tc.adm.trigger.conditionLtPercent ? (tc.ceiling * tc.adm.trigger.conditionLtPercent / 100/1024/1024 | number:2) : '-'}} MB)</span>
</div>
</div>
</fieldset>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module HawkularMetrics {
public hasDisabledSelectedItems:boolean = false;
public sortField:string = 'name';
public sortAsc:boolean = false;

public resourceId;

public loadingMoreItems:boolean = false;
public addProgress:boolean = false;
Expand All @@ -60,6 +60,8 @@ module HawkularMetrics {
$scope.ac = this;

this.autoRefresh(120);
this.resourceId = $routeParams.resourceId;

if ($rootScope.currentPersona) {
this.getTriggers();
} else {
Expand Down Expand Up @@ -88,7 +90,10 @@ module HawkularMetrics {
ordering = 'desc';
}

this.HawkularAlertsManager.queryTriggers({currentPage: this.triggersCurPage,
let tagValue = this.resourceId ? this.resourceId : '*';
this.HawkularAlertsManager.queryTriggers({
tags: 'resourceId|' + tagValue,
currentPage: this.triggersCurPage,
perPage: this.triggersPerPage,
sort: this.sortField,
order: ordering
Expand Down

0 comments on commit 219a224

Please sign in to comment.