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

Commit

Permalink
HAWKULAR-226 Display traits from a URL
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalaga committed Jul 26, 2015
1 parent 946ac84 commit dd31630
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 3 additions & 1 deletion console/src/main/scripts/plugins/metrics/html/url-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ <h2 ng-show="vm.resourceList.length > 0" class="text-center hk-fade-in">Current

<div ng-class="{'hk-fade-in': vm.resourceList}">
<div class="hk-url-item" ng-repeat="res in vm.resourceList | orderBy:'properties.url':vm.reverse">
<div class="hk-url-heading">
<div class="panel panel-default hk-url-heading">
<a href="/hawkular-ui/url/availability/{{res.id}}">{{res.properties.url}}</a>
<span ng-show="res.properties['trait-collected-on']" class="pull-right">{{res.traits}}</span>
</div>

<div class="panel panel-default hk-summary">
<div class="row">
<div class="col-sm-3 hk-summary-item">
Expand Down
8 changes: 7 additions & 1 deletion console/src/main/scripts/plugins/metrics/less/metrics.less
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,17 @@ a:hover .fa-spinner {
margin-top: @grid-gutter-width/4*3;

.hk-url-heading {
margin-bottom: @grid-gutter-width/4;
margin-bottom: 1px;
padding: @grid-gutter-width/4 @grid-gutter-width/3;

a {
font-size: ceil(@font-size-base * 1.333333);
}

span {
color: @gray-light;
margin-top: ceil(@font-size-base * 1.333333) - @font-size-base;
}
}

.hk-summary {
Expand Down
8 changes: 8 additions & 0 deletions console/src/main/scripts/plugins/metrics/ts/urlList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,14 @@ module HawkularMetrics {
}, this);
var promises = [];
angular.forEach(aResourceList, function(res, idx) {
var traitsArray:string[] = [];
if (res.properties['trait-remote-address']) {
traitsArray.push('IP: ' + res.properties['trait-remote-address']);
}
if (res.properties['trait-powered-by']) {
traitsArray.push('Powered by: ' + res.properties['trait-powered-by']);
}
res['traits'] = traitsArray.join(' | ');
promises.push(this.HawkularMetric.GaugeMetricData(tenantId).queryMetrics({
resourceId: res.id, gaugeId: (res.id + '.status.duration'),
start: moment().subtract(1, 'hours').valueOf(), end: moment().valueOf()}, (resource) => {
Expand Down

0 comments on commit dd31630

Please sign in to comment.