support show default value in setting page

This commit is contained in:
MaysWind 2016-06-22 22:05:47 +08:00
parent d096d70c52
commit bfd49f7db3
2 changed files with 224 additions and 112 deletions

View file

@ -8,10 +8,12 @@
type: 'string' type: 'string'
}, },
'max-concurrent-downloads': { 'max-concurrent-downloads': {
type: 'integer' type: 'integer',
defaultValue: '5'
}, },
'check-integrity': { 'check-integrity': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'continue': { 'continue': {
type: 'boolean' type: 'boolean'
@ -27,31 +29,39 @@
}, },
'connect-timeout': { 'connect-timeout': {
type: 'integer', type: 'integer',
suffix: 'Seconds' suffix: 'Seconds',
defaultValue: '60'
}, },
'dry-run': { 'dry-run': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'lowest-speed-limit': { 'lowest-speed-limit': {
type: 'string', type: 'string',
suffix: 'Bytes' suffix: 'Bytes',
defaultValue: '0'
}, },
'max-connection-per-server': { 'max-connection-per-server': {
type: 'integer' type: 'integer',
defaultValue: '1'
}, },
'max-file-not-found': { 'max-file-not-found': {
type: 'integer' type: 'integer',
defaultValue: '0'
}, },
'max-tries': { 'max-tries': {
type: 'integer' type: 'integer',
defaultValue: '5'
}, },
'min-split-size': { 'min-split-size': {
type: 'string', type: 'string',
suffix: 'Bytes' suffix: 'Bytes',
defaultValue: '20M'
}, },
'netrc-path': { 'netrc-path': {
type: 'string', type: 'string',
readonly: true readonly: true,
defaultValue: '$(HOME)/.netrc'
}, },
'no-netrc': { 'no-netrc': {
type: 'boolean' type: 'boolean'
@ -63,17 +73,21 @@
}, },
'proxy-method': { 'proxy-method': {
type: 'option', type: 'option',
options: ['get', 'tunnel'] options: ['get', 'tunnel'],
defaultValue: 'get'
}, },
'remote-time': { 'remote-time': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'reuse-uri': { 'reuse-uri': {
type: 'boolean' type: 'boolean',
defaultValue: 'true'
}, },
'retry-wait': { 'retry-wait': {
type: 'integer', type: 'integer',
suffix: 'Seconds' suffix: 'Seconds',
defaultValue: '0'
}, },
'server-stat-of': { 'server-stat-of': {
type: 'string' type: 'string'
@ -81,35 +95,44 @@
'server-stat-timeout': { 'server-stat-timeout': {
type: 'integer', type: 'integer',
suffix: 'Seconds', suffix: 'Seconds',
readonly: true readonly: true,
defaultValue: '86400'
}, },
'split': { 'split': {
type: 'integer' type: 'integer',
defaultValue: '5'
}, },
'stream-piece-selector': { 'stream-piece-selector': {
type: 'option', type: 'option',
options: ['default', 'inorder', 'random', 'geom'] options: ['default', 'inorder', 'random', 'geom'],
defaultValue: 'default'
}, },
'timeout': { 'timeout': {
type: 'integer', type: 'integer',
suffix: 'Seconds' suffix: 'Seconds',
defaultValue: '60'
}, },
'uri-selector': { 'uri-selector': {
type: 'option', type: 'option',
options: ['inorder', 'feedback', 'adaptive'] options: ['inorder', 'feedback', 'adaptive'],
defaultValue: 'feedback'
}, },
'check-certificate': { 'check-certificate': {
type: 'boolean', type: 'boolean',
readonly: true readonly: true,
defaultValue: 'true'
}, },
'http-accept-gzip': { 'http-accept-gzip': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'http-auth-challenge': { 'http-auth-challenge': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'http-no-cache': { 'http-no-cache': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'http-user': { 'http-user': {
type: 'string' type: 'string'
@ -139,10 +162,12 @@
type: 'string' type: 'string'
}, },
'enable-http-keep-alive': { 'enable-http-keep-alive': {
type: 'boolean' type: 'boolean',
defaultValue: 'true'
}, },
'enable-http-pipelining': { 'enable-http-pipelining': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'header': { 'header': {
type: 'string' type: 'string'
@ -151,19 +176,24 @@
type: 'string' type: 'string'
}, },
'use-head': { 'use-head': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'user-agent': { 'user-agent': {
type: 'string' type: 'string',
defaultValue: 'aria2/$VERSION'
}, },
'ftp-user': { 'ftp-user': {
type: 'string' type: 'string',
defaultValue: 'anonymous'
}, },
'ftp-passwd': { 'ftp-passwd': {
type: 'string' type: 'string',
defaultValue: 'ARIA2USER@'
}, },
'ftp-pasv': { 'ftp-pasv': {
type: 'boolean' type: 'boolean',
defaultValue: 'true'
}, },
'ftp-proxy': { 'ftp-proxy': {
type: 'string' type: 'string'
@ -176,10 +206,12 @@
}, },
'ftp-type': { 'ftp-type': {
type: 'option', type: 'option',
options: ['binary', 'ascii'] options: ['binary', 'ascii'],
defaultValue: 'binary'
}, },
'ftp-reuse-connection': { 'ftp-reuse-connection': {
type: 'boolean' type: 'boolean',
defaultValue: 'true'
}, },
'ssh-host-key-md': { 'ssh-host-key-md': {
type: 'string' type: 'string'
@ -190,13 +222,16 @@
}, },
'bt-detach-seed-only': { 'bt-detach-seed-only': {
type: 'boolean', type: 'boolean',
readonly: true readonly: true,
defaultValue: 'false'
}, },
'bt-enable-hook-after-hash-check': { 'bt-enable-hook-after-hash-check': {
type: 'boolean' type: 'boolean',
defaultValue: 'true'
}, },
'bt-enable-lpd': { 'bt-enable-lpd': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'bt-exclude-tracker': { 'bt-exclude-tracker': {
type: 'text', type: 'text',
@ -207,46 +242,58 @@
type: 'string' type: 'string'
}, },
'bt-force-encryption': { 'bt-force-encryption': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'bt-hash-check-seed': { 'bt-hash-check-seed': {
type: 'boolean' type: 'boolean',
defaultValue: 'true'
}, },
'bt-max-open-files': { 'bt-max-open-files': {
type: 'integer' type: 'integer',
defaultValue: '100'
}, },
'bt-max-peers': { 'bt-max-peers': {
type: 'integer' type: 'integer',
defaultValue: '55'
}, },
'bt-metadata-only': { 'bt-metadata-only': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'bt-min-crypto-level': { 'bt-min-crypto-level': {
type: 'option', type: 'option',
options: ['plain', 'arc4'] options: ['plain', 'arc4'],
defaultValue: 'plain'
}, },
'bt-prioritize-piece': { 'bt-prioritize-piece': {
type: 'string' type: 'string'
}, },
'bt-remove-unselected-file': { 'bt-remove-unselected-file': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'bt-require-crypto': { 'bt-require-crypto': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'bt-request-peer-speed-limit': { 'bt-request-peer-speed-limit': {
type: 'string', type: 'string',
suffix: 'Bytes' suffix: 'Bytes',
defaultValue: '50K'
}, },
'bt-save-metadata': { 'bt-save-metadata': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'bt-seed-unverified': { 'bt-seed-unverified': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'bt-stop-timeout': { 'bt-stop-timeout': {
type: 'integer', type: 'integer',
suffix: 'Seconds' suffix: 'Seconds',
defaultValue: '0'
}, },
'bt-tracker': { 'bt-tracker': {
type: 'text', type: 'text',
@ -255,66 +302,81 @@
}, },
'bt-tracker-connect-timeout': { 'bt-tracker-connect-timeout': {
type: 'integer', type: 'integer',
suffix: 'Seconds' suffix: 'Seconds',
defaultValue: '60'
}, },
'bt-tracker-interval': { 'bt-tracker-interval': {
type: 'integer', type: 'integer',
suffix: 'Seconds' suffix: 'Seconds',
defaultValue: '0'
}, },
'bt-tracker-timeout': { 'bt-tracker-timeout': {
type: 'integer', type: 'integer',
suffix: 'Seconds' suffix: 'Seconds',
defaultValue: '60'
}, },
'dht-file-path': { 'dht-file-path': {
type: 'string', type: 'string',
readonly: true readonly: true,
defaultValue: '$HOME/.aria2/dht.dat'
}, },
'dht-file-path6': { 'dht-file-path6': {
type: 'string', type: 'string',
readonly: true readonly: true,
defaultValue: '$HOME/.aria2/dht6.dat'
}, },
'dht-listen-port': { 'dht-listen-port': {
type: 'integer', type: 'integer',
readonly: true readonly: true,
defaultValue: '6881-6999'
}, },
'dht-message-timeout': { 'dht-message-timeout': {
type: 'integer', type: 'integer',
suffix: 'Seconds', suffix: 'Seconds',
readonly: true readonly: true,
defaultValue: '10'
}, },
'enable-dht': { 'enable-dht': {
type: 'boolean', type: 'boolean',
readonly: true readonly: true,
defaultValue: 'true'
}, },
'enable-dht6': { 'enable-dht6': {
type: 'boolean', type: 'boolean',
readonly: true readonly: true
}, },
'enable-peer-exchange': { 'enable-peer-exchange': {
type: 'boolean' type: 'boolean',
defaultValue: 'true'
}, },
'follow-torrent': { 'follow-torrent': {
type: 'option', type: 'option',
options: ['true', 'false', 'mem'] options: ['true', 'false', 'mem'],
defaultValue: 'true'
}, },
'listen-port': { 'listen-port': {
type: 'integer', type: 'integer',
readonly: true readonly: true,
defaultValue: '6881-6999'
}, },
'max-overall-upload-limit': { 'max-overall-upload-limit': {
type: 'string', type: 'string',
suffix: 'Bytes' suffix: 'Bytes',
defaultValue: '0'
}, },
'max-upload-limit': { 'max-upload-limit': {
type: 'string', type: 'string',
suffix: 'Bytes' suffix: 'Bytes',
defaultValue: '0'
}, },
'peer-id-prefix': { 'peer-id-prefix': {
type: 'string', type: 'string',
readonly: true readonly: true,
defaultValue: 'A2-$MAJOR-$MINOR-$PATCH-'
}, },
'seed-ratio': { 'seed-ratio': {
type: 'float' type: 'float',
defaultValue: '1.0'
}, },
'seed-time': { 'seed-time': {
type: 'integer', type: 'integer',
@ -322,7 +384,8 @@
}, },
'follow-metalink': { 'follow-metalink': {
type: 'option', type: 'option',
options: ['true', 'false', 'mem'] options: ['true', 'false', 'mem'],
defaultValue: 'true'
}, },
'metalink-base-uri': { 'metalink-base-uri': {
type: 'string' type: 'string'
@ -341,94 +404,117 @@
}, },
'metalink-preferred-protocol': { 'metalink-preferred-protocol': {
type: 'option', type: 'option',
options: ['http', 'https', 'ftp', 'none'] options: ['http', 'https', 'ftp', 'none'],
defaultValue: 'none'
}, },
'metalink-enable-unique-protocol': { 'metalink-enable-unique-protocol': {
type: 'boolean' type: 'boolean',
defaultValue: 'true'
}, },
'enable-rpc': { 'enable-rpc': {
type: 'boolean', type: 'boolean',
readonly: true readonly: true,
defaultValue: 'false'
}, },
'pause-metadata': { 'pause-metadata': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'rpc-allow-origin-all': { 'rpc-allow-origin-all': {
type: 'boolean', type: 'boolean',
readonly: true readonly: true,
defaultValue: 'false'
}, },
'rpc-listen-all': { 'rpc-listen-all': {
type: 'boolean', type: 'boolean',
readonly: true readonly: true,
defaultValue: 'false'
}, },
'rpc-listen-port': { 'rpc-listen-port': {
type: 'integer', type: 'integer',
readonly: true readonly: true,
defaultValue: '6800'
}, },
'rpc-max-request-size': { 'rpc-max-request-size': {
type: 'string', type: 'string',
suffix: 'Bytes', suffix: 'Bytes',
readonly: true readonly: true,
defaultValue: '2M'
}, },
'rpc-save-upload-metadata': { 'rpc-save-upload-metadata': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'rpc-secure': { 'rpc-secure': {
type: 'boolean', type: 'boolean',
readonly: true readonly: true
}, },
'allow-overwrite': { 'allow-overwrite': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'allow-piece-length-change': { 'allow-piece-length-change': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'always-resume': { 'always-resume': {
type: 'boolean' type: 'boolean',
defaultValue: 'true'
}, },
'async-dns': { 'async-dns': {
type: 'boolean' type: 'boolean',
defaultValue: 'true'
}, },
'auto-file-renaming': { 'auto-file-renaming': {
type: 'boolean' type: 'boolean',
defaultValue: 'true'
}, },
'auto-save-interval': { 'auto-save-interval': {
type: 'integer', type: 'integer',
suffix: 'Seconds', suffix: 'Seconds',
readonly: true readonly: true,
defaultValue: '60'
}, },
'conditional-get': { 'conditional-get': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'conf-path': { 'conf-path': {
type: 'string', type: 'string',
readonly: true readonly: true,
defaultValue: '$HOME/.aria2/aria2.conf'
}, },
'console-log-level': { 'console-log-level': {
type: 'option', type: 'option',
options: ['debug', 'info', 'notice', 'warn', 'error'], options: ['debug', 'info', 'notice', 'warn', 'error'],
readonly: true readonly: true,
defaultValue: 'notice'
}, },
'daemon': { 'daemon': {
type: 'boolean', type: 'boolean',
readonly: true readonly: true,
defaultValue: 'false'
}, },
'deferred-input': { 'deferred-input': {
type: 'boolean', type: 'boolean',
readonly: true readonly: true,
defaultValue: 'false'
}, },
'disable-ipv6': { 'disable-ipv6': {
type: 'boolean', type: 'boolean',
readonly: true readonly: true,
defaultValue: 'false'
}, },
'disk-cache': { 'disk-cache': {
type: 'string', type: 'string',
suffix: 'Bytes', suffix: 'Bytes',
readonly: true readonly: true,
defaultValue: '16M'
}, },
'download-result': { 'download-result': {
type: 'option', type: 'option',
options: ['default', 'full', 'hide'] options: ['default', 'full', 'hide'],
defaultValue: 'default'
}, },
'dscp': { 'dscp': {
type: 'string', type: 'string',
@ -440,10 +526,12 @@
}, },
'enable-color': { 'enable-color': {
type: 'boolean', type: 'boolean',
readonly: true readonly: true,
defaultValue: 'true'
}, },
'enable-mmap': { 'enable-mmap': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'event-poll': { 'event-poll': {
type: 'option', type: 'option',
@ -452,59 +540,74 @@
}, },
'file-allocation': { 'file-allocation': {
type: 'option', type: 'option',
options: ['none', 'prealloc', 'trunc', 'falloc'] options: ['none', 'prealloc', 'trunc', 'falloc'],
defaultValue: 'prealloc'
}, },
'force-save': { 'force-save': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'hash-check-only': { 'hash-check-only': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'human-readable': { 'human-readable': {
type: 'boolean', type: 'boolean',
readonly: true readonly: true,
defaultValue: 'true'
}, },
'max-download-result': { 'max-download-result': {
type: 'integer' type: 'integer',
defaultValue: '1000'
}, },
'max-mmap-limit': { 'max-mmap-limit': {
type: 'string', type: 'string',
suffix: 'Bytes' suffix: 'Bytes',
defaultValue: '9223372036854775807'
}, },
'max-resume-failure-tries': { 'max-resume-failure-tries': {
type: 'integer' type: 'integer',
defaultValue: '0'
}, },
'min-tls-version': { 'min-tls-version': {
type: 'option', type: 'option',
options: ['SSLv3', 'TLSv1', 'TLSv1.1', 'TLSv1.2'], options: ['SSLv3', 'TLSv1', 'TLSv1.1', 'TLSv1.2'],
readonly: true readonly: true,
defaultValue: 'TLSv1'
}, },
'log-level': { 'log-level': {
type: 'option', type: 'option',
options: ['debug', 'info', 'notice', 'warn', 'error'] options: ['debug', 'info', 'notice', 'warn', 'error'],
defaultValue: 'debug'
}, },
'optimize-concurrent-downloads': { 'optimize-concurrent-downloads': {
type: 'string' type: 'string',
defaultValue: 'false'
}, },
'piece-length': { 'piece-length': {
type: 'integer' type: 'integer',
defaultValue: '1M'
}, },
'show-console-readout': { 'show-console-readout': {
type: 'boolean', type: 'boolean',
readonly: true readonly: true,
defaultValue: 'true'
}, },
'summary-interval': { 'summary-interval': {
type: 'integer', type: 'integer',
suffix: 'Seconds', suffix: 'Seconds',
readonly: true readonly: true,
defaultValue: '60'
}, },
'max-overall-download-limit': { 'max-overall-download-limit': {
type: 'string', type: 'string',
suffix: 'Bytes' suffix: 'Bytes',
defaultValue: '0'
}, },
'max-download-limit': { 'max-download-limit': {
type: 'string', type: 'string',
suffix: 'Bytes' suffix: 'Bytes',
defaultValue: '0'
}, },
'no-conf': { 'no-conf': {
type: 'boolean', type: 'boolean',
@ -512,17 +615,21 @@
}, },
'no-file-allocation-limit': { 'no-file-allocation-limit': {
type: 'string', type: 'string',
suffix: 'Bytes' suffix: 'Bytes',
defaultValue: '5M'
}, },
'parameterized-uri': { 'parameterized-uri': {
type: 'boolean' type: 'boolean',
defaultValue: 'false'
}, },
'quiet': { 'quiet': {
type: 'boolean', type: 'boolean',
readonly: true readonly: true,
defaultValue: 'false'
}, },
'realtime-chunk-checksum': { 'realtime-chunk-checksum': {
type: 'boolean' type: 'boolean',
defaultValue: 'true'
}, },
'remove-control-file': { 'remove-control-file': {
type: 'boolean' type: 'boolean'
@ -533,21 +640,25 @@
'save-session-interval': { 'save-session-interval': {
type: 'integer', type: 'integer',
suffix: 'Seconds', suffix: 'Seconds',
readonly: true readonly: true,
defaultValue: '0'
}, },
'socket-recv-buffer-size': { 'socket-recv-buffer-size': {
type: 'string', type: 'string',
suffix: 'Bytes', suffix: 'Bytes',
readonly: true readonly: true,
defaultValue: '0'
}, },
'stop': { 'stop': {
type: 'integer', type: 'integer',
suffix: 'Seconds', suffix: 'Seconds',
readonly: true readonly: true,
defaultValue: '0'
}, },
'truncate-console-readout': { 'truncate-console-readout': {
type: 'boolean', type: 'boolean',
readonly: true readonly: true,
defaultValue: 'true'
} }
}).constant('aria2GlobalAvailableOptions', { }).constant('aria2GlobalAvailableOptions', {
basicOptions: ['dir', 'log', 'max-concurrent-downloads', 'check-integrity', 'continue'], basicOptions: ['dir', 'log', 'max-concurrent-downloads', 'check-integrity', 'continue'],

View file

@ -1,6 +1,7 @@
<section class="content no-padding"> <section class="content no-padding">
<div class="settings-table striped hoverable"> <div class="settings-table striped hoverable">
<ng-setting ng-repeat="option in context.availableOptions" option="option" ng-model="context.globalOptions[option.key]" <ng-setting ng-repeat="option in context.availableOptions" option="option" placeholder="option.defaultValue"
ng-model="context.globalOptions[option.key]"
on-change-value="setGlobalOption(key, value, optionStatus)"></ng-setting> on-change-value="setGlobalOption(key, value, optionStatus)"></ng-setting>
</div> </div>
</section> </section>