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 (Complete)
Browse files Browse the repository at this point in the history
- Fix bug with navigating to alert detail
- Change alerts list to show resource name as opposed to resource path
- Add resource name to alert detail
- Fix alert detail link offered in alerts sidebar on trigger detail view
- rebased on master for easy PR merge
  - fix rebase issue (duplicate code) in appServerDatasourceDetails
- fix dep versions for Bus and Alerts
  • Loading branch information
jshaughn committed Nov 11, 2015
1 parent b5600fe commit aff07a3
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ <h2>{{acd.description | characters: 55}}</h2>
<span class="hk-input-text">{{acd.detailAlert.ctime | date:'d MMM yyyy, HH:mm'}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Resource Name</label>
<div class="col-sm-10">
<span class="hk-input-text">{{acd.detailAlert.context.resourceName}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Resource Path
<a class="hk-btn-icon"><i tooltip="e = environment, f = feed, r = the resource id" tooltip-trigger tooltip-placement="top" class="fa fa-info-circle"></i></a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h3 class="pull-left">Alerts ({{ac.headerLinks.total}})</h3>
<th ng-class="{'sorting_asc': ac.sortField == 'severity' && ac.sortAsc, 'sorting_desc': ac.sortField == 'severity' && !ac.sortAsc, 'sorting': ac.sortField != 'severity'}" ng-click="ac.sortBy('severity')">Severity</th>
<th ng-class="{'sorting_asc': ac.sortField == 'context.description' && ac.sortAsc, 'sorting_desc': ac.sortField == 'context.description' && !ac.sortAsc, 'sorting': ac.sortField != 'context.description'}" ng-click="ac.sortBy('context.description')">Description</th>
<th ng-class="{'sorting_asc': ac.sortField == 'ctime' && ac.sortAsc, 'sorting_desc': ac.sortField == 'ctime' && !ac.sortAsc, 'sorting': ac.sortField != 'ctime'}" ng-click="ac.sortBy('ctime')" ng-click="ac.sortBy('ctime')">Created</th>
<th ng-class="{'sorting_asc': ac.sortField == 'context.resourcePath' && ac.sortAsc, 'sorting_desc': ac.sortField == 'context.resourcePath' && !ac.sortAsc, 'sorting': ac.sortField != 'context.resourcePath'}" ng-click="ac.sortBy('context.resourcePath')">Resource Path</th>
<th ng-class="{'sorting_asc': ac.sortField == 'context.resourceName' && ac.sortAsc, 'sorting_desc': ac.sortField == 'context.resourceName' && !ac.sortAsc, 'sorting': ac.sortField != 'context.resourceName'}" ng-click="ac.sortBy('context.resourceName')">Resource Name</th>
<th></th>
</tr>
</thead>
Expand All @@ -81,10 +81,10 @@ <h3 class="pull-left">Alerts ({{ac.headerLinks.total}})</h3>
<td>{{alert.severity|firstUpper}}</td>
<td>{{alert.trigger.description| characters: 50}}</td>
<td>{{alert.ctime | date:'d MMM yyyy, HH:mm'}}</td>
<td>{{alert.context.resourcePath | truncate: 30}}</td>
<td>{{alert.context.resourceName | truncate: 30}}</td>
<td><a class="btn btn-link"><i class="fa fa-chevron-circle-right fa-lg"
tooltip="View Details" tooltip-trigger tooltip-placement="top"
ng-click="ac.showDetailPage(alert.alertId)">
ng-click="ac.showDetailPage(alert.id)">
</i></a>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h2 class="pull-left">Alerts</h2>
<p class="hk-info-info">{{alert.ctime | date:'d MMM yyyy, HH:mm'}}</p>
</div>
<div class="hk-icon-container">
<a href="alert-center-detail.html" class="btn btn-link" data-toggle="tooltip" data-placement="top"
<a ng-href="{{tc.getAlertRoute(alert.id)}}" class="btn btn-link" data-toggle="tooltip" data-placement="top"
data-original-title="View Details"><i class="fa fa-chevron-circle-right"></i></a>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ module HawkularMetrics {
this.statuses = [];
this.getAlert(this._alertId);
this.getActions(this._alertId);

}

public getAlert(alertId:AlertId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ module HawkularMetrics {
statuses: this.alertsStatuses,
startTime: this.alertsTimeStart,
endTime: this.alertsTimeEnd,
thin: true,
currentPage: this.alertsCurPage,
perPage: this.alertsPerPage,
sort: this.sortField,
Expand Down Expand Up @@ -138,7 +139,7 @@ module HawkularMetrics {
let resolveIdList = '';
this.alertsList.forEach((alertItem:IAlert) => {
if (alertItem.selected) {
resolveIdList = resolveIdList + alertItem.alertId + ',';
resolveIdList = resolveIdList + alertItem.id + ',';
}
});
resolveIdList = resolveIdList.slice(0, -1);
Expand All @@ -165,7 +166,7 @@ module HawkularMetrics {
let ackIdList = '';
this.alertsList.forEach((alertItem:IAlert) => {
if (alertItem.selected && (alertItem.status !== 'ACKNOWLEDGED' || alertItem.status !== 'RESOLVED')) {
ackIdList = ackIdList + alertItem.alertId + ',';
ackIdList = ackIdList + alertItem.id + ',';
}
});
ackIdList = ackIdList.slice(0, -1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,24 +125,6 @@ module HawkularMetrics {
});


this.$q.all([connPromise, respPromise]).finally(()=> {
res.alertList = [].concat(connArray, respArray);
});

let respPromise = this.HawkularAlertsManager.queryAlerts({
statuses: 'OPEN',
triggerIds: metricIdPrefix + '_ds_resp', startTime: startTime, endTime: endTime
}).then((respData)=> {
_.forEach(respData.alertList, (item) => {
item['alertType'] = 'DSRESP';
item['condition'] = item['dataId'].substr(item['dataId'].lastIndexOf('~') + 1);
});
respArray = respData.alertList;
}, (error) => {
//return this.ErrorsManager.errorHandler(error, 'Error fetching alerts.');
});


this.$q.all([connPromise, respPromise]).finally(()=> {
res.alertList = [].concat(connArray, respArray);
});
Expand Down
8 changes: 8 additions & 0 deletions console/src/main/scripts/plugins/metrics/ts/metricsAlerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,14 @@ module HawkularMetrics {
});
}

public getAlertRoute(alertId:AlertId):string {
let route = 'unknown-trigger-type';
let encodedId = this.encodeResourceId(alertId);
route = '/hawkular-ui/alerts-center-detail/' + encodedId;

return route;
}

loadTrigger(triggerId:string):Array<ng.IPromise<any>> {
throw new Error('This method is abstract');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ module HawkularMetrics {
}

export interface IAlert {
alertId: string;
id: string;
ackBy: string;
ackNotes: string;
ackTime: TimestampInMillis;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ module HawkularMetrics {
let serverAlert = serverAlerts[i];
let consoleAlert:any = serverAlert;

consoleAlert.id = serverAlert.alertId;
consoleAlert.id = serverAlert.id;

consoleAlert.triggerId = serverAlert.triggerId;

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<version.org.hawkular.accounts>1.1.1.Final-SRC-revision-3583f50aa1ae524dae320462a75ef9006b2d1fb3</version.org.hawkular.accounts>
<version.org.hawkular.agent>0.12.0.Final</version.org.hawkular.agent>
<version.org.hawkular.alerts>0.6.0.Final-SRC-revision-53dafd419c5165f6fe4620d8d09ec64a6d068cbf</version.org.hawkular.alerts>
<version.org.hawkular.bus>0.7.2.Final-SRC-revision-51939085c81845b21841503921d48442dde6f32b</version.org.hawkular.bus>
<version.org.hawkular.bus>0.7.2.Final</version.org.hawkular.bus>
<version.org.hawkular.commons>0.2.3.Final-SRC-revision-dc2c2fc6cd725df4b120458590208fcc52dd6080</version.org.hawkular.commons>
<version.org.hawkular.cmdgw>0.10.2.Final-SRC-revision-70128f2962949da23ba3e71a985871c2f9f509b3</version.org.hawkular.cmdgw>
<version.org.hawkular.metrics>0.9.0.Final</version.org.hawkular.metrics>
Expand Down

0 comments on commit aff07a3

Please sign in to comment.