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

Commit

Permalink
Remove unnecessary limitTo14 filter, since using Angular 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ammendonca committed Jul 23, 2015
1 parent be5694a commit f5c7111
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ <h3>Deployments</h3>
<td class="state" ng-show="res.state === 'down'"><i class="fa fa-square"></i> Stopped</td>
<td class="state" ng-show="res.state === 'unknown'"><i class="fa fa-times-circle-o"></i> Failed</td>
<td class="state" ng-hide="res.state"><i class="fa fa-chain-broken"></i> Unknown</td>
<td><strong>{{res.properties.name | limitTo14 : res.properties.name.length-13 : 12}}</strong> <span ng-show="false">({{res.properties.name | limitTo14 : res.properties.name.length-13 : 12}})</span> <span class="label label-danger label-alert pull-right" tooltip-trigger tooltip-placement="top" tooltip="Deployment alerts">{{res.alerts}}</span></td>
<td><strong>{{res.properties.name | limitTo : res.properties.name.length-13 : 12}}</strong> <span ng-show="false">({{res.properties.name | limitTo : res.properties.name.length-13 : 12}})</span> <span class="label label-danger label-alert pull-right" tooltip-trigger tooltip-placement="top" tooltip="Deployment alerts">{{res.alerts}}</span></td>
<td ng-show="true">Enabled</td>
<td ng-show="false">Disabled</td>
<td class="success" ng-show="true">Good</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h1>No application servers set up.</h1>
<p ng-hide="res.state"><span class="spinner spinner-sm spinner-inline"></span> <span class="fetching">Fetching state...</span></p>
{{res.state | firstUpper}}
</td>
<td><a href="/hawkular-ui/app/app-details/{{res.id | limitTo14 : res.id.length-4 : 1}}/jvm">{{res.id | limitTo14 : res.id.length-4 : 1}}</a> <a href="/hawkular-ui/app/app-details/{{res.id}}/jvm" class="pull-right"><span class="label label-danger label-alert" tooltip-trigger tooltip-placement="top" tooltip="Server alerts" ng-show="res.alerts.length > 0">{{res.alerts.length}}</span></a></td>
<td><a href="/hawkular-ui/app/app-details/{{res.id | limitTo : res.id.length-4 : 1}}/jvm">{{res.id | limitTo : res.id.length-4 : 1}}</a> <a href="/hawkular-ui/app/app-details/{{res.id}}/jvm" class="pull-right"><span class="label label-danger label-alert" tooltip-trigger tooltip-placement="top" tooltip="Server alerts" ng-show="res.alerts.length > 0">{{res.alerts.length}}</span></a></td>
<td>{{res.type.id}}</td>
<td>{{(res.properties.resourceConfiguration | filter:'Hostname':true)[0].value || 'n/a'}}</td>
<!-- <td class="center"><span class="label label-primary" ng-repeat="tag in res.tags">{{tag}}</span><span ng-hide="res.tags.length > 0">--</span></td> -->
Expand Down
30 changes: 0 additions & 30 deletions console/src/main/scripts/plugins/metrics/ts/metricsPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,36 +36,6 @@ module HawkularMetrics {
};
});

/**
* Replicates AngularJS 1.4 limitTo filter
*/
_module.filter('limitTo14', function () {
return function(input, limit, begin) {
if (Math.abs(Number(limit)) === Infinity) {
limit = Number(limit);
} else {
limit = parseInt(limit, 10);
}
if (isNaN(limit)) { return input; }

if (typeof input === 'number') { input = input.toString(); }
if (!Array.isArray(input) && !(typeof input === 'string')) { return input; }

begin = (!begin || isNaN(begin)) ? 0 : parseInt(begin, 10);
begin = (begin < 0 && begin >= -input.length) ? input.length + begin : begin;

if (limit >= 0) {
return input.slice(begin, begin + limit);
} else {
if (begin === 0) {
return input.slice(limit, input.length);
} else {
return input.slice(Math.max(0, begin + limit), begin);
}
}
};
});

_module.config(['$routeProvider', ($routeProvider) => {
$routeProvider.
// this was for single page.. remove ?
Expand Down

0 comments on commit f5c7111

Please sign in to comment.