mirror of https://github.com/portainer/portainer
Add column sorting to images page.
parent
5a20b9fc04
commit
93dba3f92f
|
@ -21,15 +21,39 @@
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" ng-model="toggle" ng-change="toggleSelectAll()" /> Action</th>
|
<th><label><input type="checkbox" ng-model="toggle" ng-change="toggleSelectAll()" /> Select</label></th>
|
||||||
<th>Id</th>
|
<th>
|
||||||
<th>Repository</th>
|
<a href="#/images/" ng-click="order('Id')">
|
||||||
<th>VirtualSize</th>
|
Id
|
||||||
<th>Created</th>
|
<span ng-show="sortType == 'Id' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
|
||||||
|
<span ng-show="sortType == 'Id' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a href="#/images/" ng-click="order('RepoTags')">
|
||||||
|
Repository
|
||||||
|
<span ng-show="sortType == 'RepoTags' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
|
||||||
|
<span ng-show="sortType == 'RepoTags' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a href="#/images/" ng-click="order('VirtualSize')">
|
||||||
|
VirtualSize
|
||||||
|
<span ng-show="sortType == 'VirtualSize' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
|
||||||
|
<span ng-show="sortType == 'VirtualSize' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a href="#/images/" ng-click="order('Created')">
|
||||||
|
Created
|
||||||
|
<span ng-show="sortType == 'Created' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
|
||||||
|
<span ng-show="sortType == 'Created' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="image in images | filter:filter | orderBy:predicate">
|
<tr ng-repeat="image in images | filter:filter | orderBy:sortType:sortReverse">
|
||||||
<td><input type="checkbox" ng-model="image.Checked" /></td>
|
<td><input type="checkbox" ng-model="image.Checked" /></td>
|
||||||
<td><a href="#/images/{{ image.Id }}/?tag={{ image|repotag }}">{{ image.Id|truncate:20}}</a></td>
|
<td><a href="#/images/{{ image.Id }}/?tag={{ image|repotag }}">{{ image.Id|truncate:20}}</a></td>
|
||||||
<td>{{ image|repotag }}</td>
|
<td>{{ image|repotag }}</td>
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
angular.module('images', [])
|
angular.module('images', [])
|
||||||
.controller('ImagesController', ['$scope', 'Image', 'ViewSpinner', 'Messages',
|
.controller('ImagesController', ['$scope', 'Image', 'ViewSpinner', 'Messages',
|
||||||
function ($scope, Image, ViewSpinner, Messages) {
|
function ($scope, Image, ViewSpinner, Messages) {
|
||||||
|
$scope.sortType = 'Created';
|
||||||
|
$scope.sortReverse = true;
|
||||||
$scope.toggle = false;
|
$scope.toggle = false;
|
||||||
$scope.predicate = '-Created';
|
|
||||||
|
$scope.order = function(sortType) {
|
||||||
|
$scope.sortReverse = ($scope.sortType === sortType) ? !$scope.sortReverse : false;
|
||||||
|
$scope.sortType = sortType;
|
||||||
|
};
|
||||||
|
|
||||||
$scope.showBuilder = function () {
|
$scope.showBuilder = function () {
|
||||||
$('#build-modal').modal('show');
|
$('#build-modal').modal('show');
|
||||||
|
|
Loading…
Reference in New Issue