Add column sorting to networks and volumes pages.
parent
93dba3f92f
commit
db90a0eed7
|
@ -9,7 +9,6 @@
|
||||||
<li><a tabindex="-1" href="" ng-click="removeAction()">Remove</a></li>
|
<li><a tabindex="-1" href="" ng-click="removeAction()">Remove</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<!--<li><a data-toggle="modal" data-target="#pull-modal" href="">Pull</a></li>-->
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="pull-right form-inline">
|
<div class="pull-right form-inline">
|
||||||
|
@ -20,18 +19,60 @@
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" ng-model="toggle" ng-change="toggleSelectAll()"/> Select</th>
|
<th><label><input type="checkbox" ng-model="toggle" ng-change="toggleSelectAll()"/> Select</label></th>
|
||||||
<th>Name</th>
|
<th>
|
||||||
<th>Id</th>
|
<a href="#/networks/" ng-click="order('Name')">
|
||||||
<th>Scope</th>
|
Name
|
||||||
<th>Driver</th>
|
<span ng-show="sortType == 'Name' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
|
||||||
<th>IPAM Driver</th>
|
<span ng-show="sortType == 'Name' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
|
||||||
<th>IPAM Subnet</th>
|
</a>
|
||||||
<th>IPAM Gateway</th>
|
</th>
|
||||||
|
<th>
|
||||||
|
<a href="#/networks/" ng-click="order('Id')">
|
||||||
|
Id
|
||||||
|
<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="#/networks/" ng-click="order('Scope')">
|
||||||
|
Scope
|
||||||
|
<span ng-show="sortType == 'Scope' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
|
||||||
|
<span ng-show="sortType == 'Scope' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a href="#/networks/" ng-click="order('Driver')">
|
||||||
|
Driver
|
||||||
|
<span ng-show="sortType == 'Driver' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
|
||||||
|
<span ng-show="sortType == 'Driver' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a href="#/networks/" ng-click="order('IPAM.Driver')">
|
||||||
|
IPAM Driver
|
||||||
|
<span ng-show="sortType == 'IPAM.Driver' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
|
||||||
|
<span ng-show="sortType == 'IPAM.Driver' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a href="#/networks/" ng-click="order('IPAM.Config[0].Subnet')">
|
||||||
|
IPAM Subnet
|
||||||
|
<span ng-show="sortType == 'IPAM.Config[0].Subnet' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
|
||||||
|
<span ng-show="sortType == 'IPAM.Config[0].Subnet' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a href="#/networks/" ng-click="order('IPAM.Config[0].Gateway')">
|
||||||
|
IPAM Gateway
|
||||||
|
<span ng-show="sortType == 'IPAM.Config[0].Gateway' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
|
||||||
|
<span ng-show="sortType == 'IPAM.Config[0].Gateway' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="network in networks | filter:filter | orderBy:predicate">
|
<tr ng-repeat="network in networks | filter:filter | orderBy:sortType:sortReverse">
|
||||||
<td><input type="checkbox" ng-model="network.Checked"/></td>
|
<td><input type="checkbox" ng-model="network.Checked"/></td>
|
||||||
<td><a href="#/networks/{{ network.Id }}/">{{ network.Name|truncate:20}}</a></td>
|
<td><a href="#/networks/{{ network.Id }}/">{{ network.Name|truncate:20}}</a></td>
|
||||||
<td>{{ network.Id }}</td>
|
<td>{{ network.Id }}</td>
|
||||||
|
|
|
@ -1,12 +1,17 @@
|
||||||
angular.module('networks', []).config(['$routeProvider', function ($routeProvider) {
|
angular.module('networks', []).config(['$routeProvider', function ($routeProvider) {
|
||||||
$routeProvider.when('/networks', {
|
$routeProvider.when('/networks/', {
|
||||||
templateUrl: 'app/components/networks/networks.html',
|
templateUrl: 'app/components/networks/networks.html',
|
||||||
controller: 'NetworksController'
|
controller: 'NetworksController'
|
||||||
});
|
});
|
||||||
}]).controller('NetworksController', ['$scope', 'Network', 'ViewSpinner', 'Messages', '$route', 'errorMsgFilter',
|
}]).controller('NetworksController', ['$scope', 'Network', 'ViewSpinner', 'Messages', '$route', 'errorMsgFilter',
|
||||||
function ($scope, Network, ViewSpinner, Messages, $route, errorMsgFilter) {
|
function ($scope, Network, ViewSpinner, Messages, $route, errorMsgFilter) {
|
||||||
|
$scope.sortType = 'Name';
|
||||||
|
$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.createNetworkConfig = {
|
$scope.createNetworkConfig = {
|
||||||
"Name": '',
|
"Name": '',
|
||||||
"Driver": '',
|
"Driver": '',
|
||||||
|
|
|
@ -19,14 +19,32 @@
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" ng-model="toggle" ng-change="toggleSelectAll()"/> Select</th>
|
<th><label><input type="checkbox" ng-model="toggle" ng-change="toggleSelectAll()"/> Select</label></th>
|
||||||
<th>Name</th>
|
<th>
|
||||||
<th>Driver</th>
|
<a href="#/volumes/" ng-click="order('Name')">
|
||||||
<th>Mountpoint</th>
|
Name
|
||||||
|
<span ng-show="sortType == 'Name' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
|
||||||
|
<span ng-show="sortType == 'Name' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a href="#/volumes/" ng-click="order('Driver')">
|
||||||
|
Driver
|
||||||
|
<span ng-show="sortType == 'Driver' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
|
||||||
|
<span ng-show="sortType == 'Driver' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a href="#/volumes/" ng-click="order('Mountpoint')">
|
||||||
|
Mountpoint
|
||||||
|
<span ng-show="sortType == 'Mountpoint' && !sortReverse" class="glyphicon glyphicon-chevron-down"></span>
|
||||||
|
<span ng-show="sortType == 'Mountpoint' && sortReverse" class="glyphicon glyphicon-chevron-up"></span>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="volume in volumes | filter:filter | orderBy:predicate">
|
<tr ng-repeat="volume in volumes | filter:filter | orderBy:sortType:sortReverse">
|
||||||
<td><input type="checkbox" ng-model="volume.Checked"/></td>
|
<td><input type="checkbox" ng-model="volume.Checked"/></td>
|
||||||
<td>{{ volume.Name|truncate:20 }}</td>
|
<td>{{ volume.Name|truncate:20 }}</td>
|
||||||
<td>{{ volume.Driver }}</td>
|
<td>{{ volume.Driver }}</td>
|
||||||
|
|
|
@ -1,12 +1,17 @@
|
||||||
angular.module('volumes', []).config(['$routeProvider', function ($routeProvider) {
|
angular.module('volumes', []).config(['$routeProvider', function ($routeProvider) {
|
||||||
$routeProvider.when('/volumes', {
|
$routeProvider.when('/volumes/', {
|
||||||
templateUrl: 'app/components/volumes/volumes.html',
|
templateUrl: 'app/components/volumes/volumes.html',
|
||||||
controller: 'VolumesController'
|
controller: 'VolumesController'
|
||||||
});
|
});
|
||||||
}]).controller('VolumesController', ['$scope', 'Volume', 'ViewSpinner', 'Messages', '$route', 'errorMsgFilter',
|
}]).controller('VolumesController', ['$scope', 'Volume', 'ViewSpinner', 'Messages', '$route', 'errorMsgFilter',
|
||||||
function ($scope, Volume, ViewSpinner, Messages, $route, errorMsgFilter) {
|
function ($scope, Volume, ViewSpinner, Messages, $route, errorMsgFilter) {
|
||||||
|
$scope.sortType = 'Name';
|
||||||
|
$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.createVolumeConfig = {
|
$scope.createVolumeConfig = {
|
||||||
"Name": "",
|
"Name": "",
|
||||||
"Driver": ""
|
"Driver": ""
|
||||||
|
|
Loading…
Reference in New Issue