support for tweaking download page size in the webui configuration

This commit is contained in:
hamza zia 2014-06-03 04:02:23 +08:00
parent 5ba428d4ae
commit 36c282536f
3 changed files with 7 additions and 5 deletions

View File

@ -1,7 +1,7 @@
angular angular
.module('webui.services.configuration', []) .module('webui.services.configuration', [])
.constant('$name', 'webui-aria2') // name used accross the entire UI .constant('$name', 'webui-aria2') // name used accross the entire UI
.constant('$globalTimeout', 1000) // interval to update the individual downloads .constant('$pageSize', 11) // number of downloads shown before pagination kicks in
.constant('$authconf', { // default authentication configuration, never fill it in case the webui is hosted in public IP as it can be compromised .constant('$authconf', { // default authentication configuration, never fill it in case the webui is hosted in public IP as it can be compromised
host: 'localhost', host: 'localhost',
port: 6800, port: 6800,
@ -32,6 +32,7 @@ angular
// go to Global Settings dialog to see their description // go to Global Settings dialog to see their description
'dir', 'conf-path', 'auto-file-renaming', 'max-connection-per-server', 'dir', 'conf-path', 'auto-file-renaming', 'max-connection-per-server',
]) ])
.constant('$globalTimeout', 1000) // interval to update the individual downloads
; ;

View File

@ -600,7 +600,7 @@
<pagination <pagination
total-items="totalDownloads" total-items="totalDownloads"
items-per-page="pageSize" items-per-page="pageSize"
max-size="6" max-size="11"
page="currentPage" page="currentPage"
boundary-links="true" boundary-links="true"
previous-text="&lsaquo;" previous-text="&lsaquo;"

View File

@ -6,12 +6,13 @@ angular
]) ])
.controller('MainCtrl', [ .controller('MainCtrl', [
'$scope', '$name', '$enable', '$rpc', '$utils', '$alerts', '$modals', '$scope', '$name', '$enable', '$rpc', '$utils', '$alerts', '$modals',
'$fileSettings', '$activeInclude', '$waitingExclude', '$fileSettings', '$activeInclude', '$waitingExclude', '$pageSize',
// for document title // for document title
'$window', '$window',
function( function(
scope, name, enable, rpc, utils, alerts, modals, scope, name, enable, rpc, utils, alerts, modals,
fsettings, activeInclude, waitingExclude, window fsettings, activeInclude, waitingExclude, pageSize,
window
) { ) {
scope.name = name; // default UI name scope.name = name; // default UI name
@ -244,7 +245,7 @@ function(
// max downloads shown in one page // max downloads shown in one page
scope.pageSize = 32; scope.pageSize = pageSize;
// current displayed page // current displayed page
scope.currentPage = 1; scope.currentPage = 1;