1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-08 07:15:23 +02:00

feat(image-details): display image layer order and sort by it by default (#1715)

* feat(image-details): display image layer depth and sort by it by default (#1706)

* refactor(image-details): rename 'Depth' to 'Order' in image layers table

* refactor(image-details): sort image layers from the bottom to the top one
This commit is contained in:
Paweł Kozioł 2018-03-14 01:27:06 +01:00 committed by Anthony Lapenna
parent f0621cb09c
commit 4e38e4ba33
4 changed files with 17 additions and 4 deletions

View file

@ -182,6 +182,13 @@
<rd-widget-body classes="no-padding">
<table id="image-layers" class="table">
<thead>
<th style="white-space:nowrap;">
<a ng-click="order('Order')">
Order
<span ng-show="sortType == 'Order' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
<span ng-show="sortType == 'Order' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
</a>
</th>
<th>
<a ng-click="order('Size')">
Size
@ -199,6 +206,9 @@
</thead>
<tbody>
<tr ng-repeat="layer in history | orderBy:sortType:sortReverse">
<td style="white-space:nowrap;">
{{ layer.Order }}
</td>
<td style="white-space:nowrap;">
{{ layer.Size | humansize }}
</td>

View file

@ -6,8 +6,8 @@ function ($q, $scope, $transition$, $state, $timeout, ImageService, RegistryServ
Registry: ''
};
$scope.sortType = 'Size';
$scope.sortReverse = true;
$scope.sortType = 'Order';
$scope.sortReverse = false;
$scope.order = function(sortType) {
$scope.sortReverse = ($scope.sortType === sortType) ? !$scope.sortReverse : false;