diff --git a/app/index.html b/app/index.html index 8cd8dee..2ff78b2 100644 --- a/app/index.html +++ b/app/index.html @@ -156,9 +156,6 @@
  • FTP/SFTP Settings
  • -
  • - BitTorrent/MegaLink Settings -
  • BitTorrent Settings
  • diff --git a/app/langs/zh-CN.json b/app/langs/zh-CN.json index f95eda3..f069829 100644 --- a/app/langs/zh-CN.json +++ b/app/langs/zh-CN.json @@ -36,7 +36,6 @@ "HTTP/FTP/SFTP Settings": "HTTP/FTP/SFTP 设置", "HTTP Settings": "HTTP 设置", "FTP/SFTP Settings": "FTP/SFTP 设置", - "BitTorrent/MegaLink Settings": "BitTorrent/磁链设置", "BitTorrent Settings": "BitTorrent 设置", "MegaLink Settings": "磁链设置", "RPC Settings": "RPC 设置", @@ -83,34 +82,6 @@ "Milliseconds": "毫秒", "(0 is disabled)": "(0为禁用)", "Changes to the settings take effect after refreshing page.": "设置将在页面刷新后生效.", - "Download Path": "下载路径", - "The directory to store the downloaded file.": "", - "Input File": "输入文件", - "The input file can contain a list of URIs for aria2 to download.": "", - "Log File": "日志文件", - "The file name of the log file. If - is specified, log is written to stdout. If empty string(\"\") is specified, or this option is omitted, no log is written to disk at all.": "日志文件的路径. 如果设置为 \"-\", 日志则写入到 stdout. 如果设置为空字符串(\"\"), 日志将不会记录到磁盘上.", - "Max Concurrent Downloads": "最大同时下载数", - "Set the maximum number of parallel downloads for every queue item.": "", - "Check Integrity": "检查完整性", - "Check file integrity by validating piece hashes or a hash of entire file. This option has effect only in BitTorrent, Metalink downloads with checksums or HTTP(S)/FTP downloads with --checksum option.": "通过对文件的每个分块或整个文件进行哈希验证来检查文件的完整性. 此选项仅对于BT、磁力链接及设置了 --checksum 选项的 HTTP(S)/FTP 链接.", - "Resume Download": "断点续传", - "Continue downloading a partially downloaded file. Use this option to resume a download started by a web browser or another program which downloads files sequentially from the beginning. Currently this option is only applicable to HTTP(S)/FTP downloads.": "继续下载部分完成的文件. 启用此选项可以继续下载从浏览器或其他程序按顺序下载的文件. 此选项目前只支持 HTTP(S)/FTP 下载的文件.", - "Enable JSON-RPC/XML-RPC Server": "启用 JSON-RPC/XML-RPC 服务器", - "Enable JSON-RPC/XML-RPC server.": "", - "Pause After Metadata Downloaded": "元数据下载完后暂停", - "Pause downloads created as a result of metadata download. There are 3 types of metadata downloads in aria2: (1) downloading .torrent file. (2) downloading torrent metadata using magnet link. (3) downloading metalink file. These metadata downloads will generate downloads using their metadata. This option pauses these subsequent downloads. This option is effective only when --enable-rpc=true is given.": "当元数据下载完成后暂停后续的下载. 在 aria2 中有三种类型的元数据下载: (1) 下载 .torrent 文件. (2) 通过磁链下载种子元数据. (3) 下载磁链文件. 这些元数据下载完后会根据元数据内容进行下载. 这个选项会暂停这些后续的下载. 此选项仅当 --enable-rpc 启用时生效.", - "Allow All Origin Request": "接受所有远程请求", - "Add Access-Control-Allow-Origin header field with value * to the RPC response.": "在 RPC 响应头增加 Access-Control-Allow-Origin 字段, 值为 * .", - "Listen on All Network Interfaces": "在所有网卡上监听", - "Listen incoming JSON-RPC/XML-RPC requests on all network interfaces. If false is given, listen only on local loopback interface.": "在所有网络适配器上监听 JSON-RPC/XML-RPC 的请求, 如果设置为否, 仅监听本地网络的请求.", - "Listen Port": "监听端口", - "Specify a port number for JSON-RPC/XML-RPC server to listen to.": "", - "Max Request Size": "最大请求大小", - "Set max size of JSON-RPC/XML-RPC request. If aria2 detects the request is more than SIZE bytes, it drops connection.": "设置 JSON-RPC/XML-RPC 最大的请求大小. 如果 aria2 检测到请求超过设定的字节数, 会直接取消连接.", - "Save Upload Metadata": "保存上传的元数据", - "Save the uploaded torrent or metalink meta data in the directory specified by --dir option. The file name consists of SHA-1 hash hex string of meta data plus extension. For torrent, the extension is '.torrent'. For metalink, it is '.meta4'. If false is given to this option, the downloads added by aria2.addTorrent() or aria2.addMetalink() will not be saved by --save-session option.": "在 dir 参数设置的目录中保存上传的种子文件或磁链的元数据. 文件名包括 SHA-1 哈希后的元数据和扩展名两部分. 对于种子文件, 扩展名为 '.torrent'. 对于磁链为 '.meta4'. 如果此选项设置为否, 通过 aria2.addTorrent() 或 aria2.addMetalink() 方法添加的下载将无法通过 --save-session 选项保存.", - "Enable SSL/TLS": "启用 SSL/TLS", - "RPC transport will be encrypted by SSL/TLS. The RPC clients must use https scheme to access the server. For WebSocket client, use wss scheme. Use --rpc-certificate and --rpc-private-key options to specify the server certificate and private key.": "RPC 将通过 SSL/TLS 加密传输. RPC 客户端需要使用 https 协议连接服务器. 对于 WebSocket 客户端, 使用 wss 协议. 使用 --rpc-certificate 和 --rpc-private-key 选项设置服务器的证书和私钥.", "Type is illegal!": "类型错误!", "none": "无", "http": "Http", @@ -125,5 +96,298 @@ "info": "普通 (Info)", "notice": "一般 (Notice)", "warn": "警告 (Warn)", - "error": "错误 (Error)" + "error": "错误 (Error)", + "options.dir.name": "下载路径", + "options.dir.description": "", + "options.log.name": "日志文件", + "options.log.description": "日志文件的路径. 如果设置为 \"-\", 日志则写入到 stdout. 如果设置为空字符串(\"\"), 日志将不会记录到磁盘上.", + "options.max-concurrent-downloads.name": "最大同时下载数", + "options.max-concurrent-downloads.description": "", + "options.check-integrity.name": "检查完整性", + "options.check-integrity.description": "通过对文件的每个分块或整个文件进行哈希验证来检查文件的完整性. 此选项仅对于BT、磁力链接及设置了 --checksum 选项的 HTTP(S)/FTP 链接.", + "options.continue.name": "断点续传", + "options.continue.description": "继续下载部分完成的文件. 启用此选项可以继续下载从浏览器或其他程序按顺序下载的文件. 此选项目前只支持 HTTP(S)/FTP 下载的文件.", + "options.all-proxy.name": "代理服务器", + "options.all-proxy.description": "设置所有协议的代理服务器地址. 如果覆盖之前设置的代理服务器, 使用 \"\" 即可. 您还可以针对特定的协议覆盖此参数, 即使用 --http-proxy, --https-proxy 和 --ftp-proxy 参数. 此设置将会影响所有下载. 代理服务器地址的格式为 [http://][USER:PASSWORD@]HOST[:PORT].", + "options.all-proxy-user.name": "代理服务器用户名", + "options.all-proxy-user.description": "", + "options.all-proxy-passwd.name": "代理服务器密码", + "options.all-proxy-passwd.description": "", + "options.connect-timeout.name": "连接超时时间", + "options.connect-timeout.description": "设置建立 HTTP/FTP/代理服务器 连接的超时时间(秒). 当连接建立后, 此选项不再生效, 请使用 --timeout 参数.", + "options.dry-run.name": "模拟运行", + "options.dry-run.description": "如果设置为是, aria2 将仅检查远程文件是否存在而不会下载文件内容. 此选项仅对 HTTP/FTP 下载生效. 如果设置为 true, BT 下载将会直接取消.", + "options.lowest-speed-limit.name": "最小速度限制", + "options.lowest-speed-limit.description": "当下载速度低于此选项设置的值(B/s) 时将会关闭连接. 0 表示不设置最小速度限制. 您还增加数值的单位 K 或 M (1K = 1024, 1M = 1024K). 此选项不会影响 BT 下载.", + "options.max-connection-per-server.name": "单服务器最大连接数", + "options.max-connection-per-server.description": "", + "options.max-file-not-found.name": "文件未找到重试次数", + "options.max-file-not-found.description": "如果 aria2 从远程 HTTP/FTP 服务器收到 \"文件未找到\" 的状态超过此选项设置的次数后下载将会失败. 设置为 0 将会禁用此选项. 此选项仅影响 HTTP/FTP 服务器. 重试时同时会记录重试次数, 所以也需要设置 --max-tries 这个参数.", + "options.max-tries.name": "最大尝试次数", + "options.max-tries.description": "设置最大尝试次数. 0 表示不限制.", + "options.min-split-size.name": "文件最小分割大小", + "options.netrc-path.name": ".netrc 文件路径", + "options.netrc-path.description": "", + "options.no-netrc.name": "禁用 netrc", + "options.no-netrc.description": "", + "options.no-proxy.name": "不使用代理服务器列表", + "options.no-proxy.description": "设置不使用代理服务器的主机名, 域名, 包含或不包含子网掩码的网络地址, 多个使用逗号分隔.", + "options.proxy-method.name": "代理服务器请求方法", + "options.remote-time.name": "获取服务器文件时间", + "options.remote-time.description": "从 HTTP/FTP 服务获取远程文件的时间戳, 如果可用将设置到本地文件", + "options.reuse-uri.name": "URI 复用", + "options.reuse-uri.description": "当所有给定的 URI 地址都已使用, 继续使用已经使用过的 URI 地址.", + "options.retry-wait.name": "重试等待时间", + "options.retry-wait.description": "设置重试间隔时间(秒). 当此选项的值大于 0 时, aria2 在 HTTP 服务器返回 503 响应时将会重试.", + "options.server-stat-of.name": "服务器状态保存文件", + "options.server-stat-timeout.name": "服务器状态超时", + "options.split.name": "文件分割数量", + "options.stream-piece-selector.name": "分片选择算法", + "options.timeout.name": "超时时间", + "options.timeout.description": "", + "options.uri-selector.name": "URI 选择算法", + "options.check-certificate.name": "检查证书", + "options.check-certificate.description": "", + "options.http-accept-gzip.name": "支持 GZip", + "options.http-auth-challenge.name": "HTTP 认证质询", + "options.http-no-cache.name": "禁用缓存", + "options.http-user.name": "HTTP 默认用户名", + "options.http-user.description": "", + "options.http-passwd.name": "HTTP 默认密码", + "options.http-passwd.description": "", + "options.http-proxy.name": "HTTP 代理服务器", + "options.http-proxy.description": "", + "options.http-proxy-user.name": "HTTP 代理服务器用户名", + "options.http-proxy-user.description": "", + "options.http-proxy-passwd.name": "HTTP 代理服务器密码", + "options.http-proxy-passwd.description": "", + "options.https-proxy.name": "HTTPS 代理服务器", + "options.https-proxy.description": "", + "options.https-proxy-user.name": "HTTPS 代理服务器用户名", + "options.https-proxy-user.description": "", + "options.https-proxy-passwd.name": "HTTPS 代理服务器密码", + "options.https-proxy-passwd.description": "", + "options.referer.name": "请求来源", + "options.enable-http-keep-alive.name": "启用持久连接", + "options.enable-http-keep-alive.description": "启用 HTTP/1.1 持久连接.", + "options.enable-http-pipelining.name": "启用 HTTP 管线化", + "options.enable-http-pipelining.description": "启用 HTTP/1.1 管线化.", + "options.header.name": "自定义请求头", + "options.header.description": "增加 HTTP 请求头内容.", + "options.save-cookies.name": "Cookies 保存路径", + "options.use-head.name": "启用 HEAD 方法", + "options.use-head.description": "第一次请求 HTTP 服务器时使用 HEAD 方法.", + "options.user-agent.name": "自定义 User Agent", + "options.user-agent.description": "", + "options.ftp-user.name": "FTP 默认用户名", + "options.ftp-user.description": "", + "options.ftp-passwd.name": "FTP 默认密码", + "options.ftp-passwd.description": "如果 URI 中包含用户名单不包含密码, aria2 首先会从 .netrc 文件中获取密码. 如果在 .netrc 文件中找到密码, 则使用该密码. 否则, 使用此选项设置的密码.", + "options.ftp-pasv.name": "被动模式", + "options.ftp-pasv.description": "在 FTP 中使用被动模式. 如果设置为否, 则使用主动模式. 此选项不适用于 SFTP 传输.", + "options.ftp-proxy.name": "FTP 代理服务器", + "options.ftp-proxy.description": "", + "options.ftp-proxy-user.name": "FTP 代理服务器用户名", + "options.ftp-proxy-user.description": "", + "options.ftp-proxy-passwd.name": "FTP 代理服务器密码", + "options.ftp-proxy-passwd.description": "", + "options.ftp-type.name": "传输类型", + "options.ftp-type.description": "", + "options.ftp-reuse-connection.name": "连接复用", + "options.ftp-reuse-connection.description": "", + "options.ssh-host-key-md.name": "SSH 公钥校验和", + "options.bt-detach-seed-only.name": "", + "options.bt-detach-seed-only.description": "", + "options.bt-enable-hook-after-hash-check.name": "", + "options.bt-enable-hook-after-hash-check.description": "", + "options.bt-enable-lpd.name": "", + "options.bt-enable-lpd.description": "", + "options.bt-exclude-tracker.name": "", + "options.bt-exclude-tracker.description": "", + "options.bt-external-ip.name": "", + "options.bt-external-ip.description": "", + "options.bt-force-encryption.name": "", + "options.bt-force-encryption.description": "", + "options.bt-hash-check-seed.name": "", + "options.bt-hash-check-seed.description": "", + "options.bt-max-open-files.name": "", + "options.bt-max-open-files.description": "", + "options.bt-max-peers.name": "", + "options.bt-max-peers.description": "", + "options.bt-metadata-only.name": "", + "options.bt-metadata-only.description": "", + "options.bt-min-crypto-level.name": "", + "options.bt-min-crypto-level.description": "", + "options.bt-prioritize-piece.name": "", + "options.bt-prioritize-piece.description": "", + "options.bt-remove-unselected-file.name": "", + "options.bt-remove-unselected-file.description": "", + "options.bt-require-crypto.name": "", + "options.bt-require-crypto.description": "", + "options.bt-request-peer-speed-limit.name": "", + "options.bt-request-peer-speed-limit.description": "", + "options.bt-save-metadata.name": "", + "options.bt-save-metadata.description": "", + "options.bt-seed-unverified.name": "", + "options.bt-seed-unverified.description": "", + "options.bt-stop-timeout.name": "", + "options.bt-stop-timeout.description": "", + "options.bt-tracker.name": "", + "options.bt-tracker.description": "", + "options.bt-tracker-connect-timeout.name": "", + "options.bt-tracker-connect-timeout.description": "", + "options.bt-tracker-interval.name": "", + "options.bt-tracker-interval.description": "", + "options.bt-tracker-timeout.name": "", + "options.bt-tracker-timeout.description": "", + "options.dht-file-path.name": "", + "options.dht-file-path.description": "", + "options.dht-file-path6.name": "", + "options.dht-file-path6.description": "", + "options.dht-listen-port.name": "", + "options.dht-listen-port.description": "", + "options.dht-message-timeout.name": "", + "options.dht-message-timeout.description": "", + "options.enable-dht.name": "", + "options.enable-dht.description": "", + "options.enable-dht6.name": "", + "options.enable-dht6.description": "", + "options.enable-peer-exchange.name": "", + "options.enable-peer-exchange.description": "", + "options.follow-torrent.name": "", + "options.follow-torrent.description": "", + "options.listen-port.name": "", + "options.listen-port.description": "", + "options.max-overall-upload-limit.name": "", + "options.max-overall-upload-limit.description": "", + "options.max-upload-limit.name": "", + "options.max-upload-limit.description": "", + "options.peer-id-prefix.name": "", + "options.peer-id-prefix.description": "", + "options.seed-ratio.name": "", + "options.seed-ratio.description": "", + "options.seed-time.name": "", + "options.seed-time.description": "", + "options.follow-metalink.name": "", + "options.follow-metalink.description": "", + "options.metalink-base-uri.name": "", + "options.metalink-base-uri.description": "", + "options.metalink-language.name": "", + "options.metalink-language.description": "", + "options.metalink-location.name": "", + "options.metalink-location.description": "", + "options.metalink-os.name": "", + "options.metalink-os.description": "", + "options.metalink-version.name": "", + "options.metalink-version.description": "", + "options.metalink-preferred-protocol.name": "", + "options.metalink-preferred-protocol.description": "", + "options.metalink-enable-unique-protocol.name": "", + "options.metalink-enable-unique-protocol.description": "", + "options.enable-rpc.name": "启用 JSON-RPC/XML-RPC 服务器", + "options.enable-rpc.description": "", + "options.pause-metadata.name": "元数据下载完后暂停", + "options.pause-metadata.description": "当元数据下载完成后暂停后续的下载. 在 aria2 中有三种类型的元数据下载: (1) 下载 .torrent 文件. (2) 通过磁链下载种子元数据. (3) 下载磁链文件. 这些元数据下载完后会根据元数据内容进行下载. 这个选项会暂停这些后续的下载. 此选项仅当 --enable-rpc 启用时生效.", + "options.rpc-allow-origin-all.name": "接受所有远程请求", + "options.rpc-allow-origin-all.description": "在 RPC 响应头增加 Access-Control-Allow-Origin 字段, 值为 * .", + "options.rpc-listen-all.name": "在所有网卡上监听", + "options.rpc-listen-all.description": "在所有网络适配器上监听 JSON-RPC/XML-RPC 的请求, 如果设置为否, 仅监听本地网络的请求.", + "options.rpc-listen-port.name": "监听端口", + "options.rpc-listen-port.description": "", + "options.rpc-max-request-size.name": "最大请求大小", + "options.rpc-max-request-size.description": "设置 JSON-RPC/XML-RPC 最大的请求大小. 如果 aria2 检测到请求超过设定的字节数, 会直接取消连接.", + "options.rpc-save-upload-metadata.name": "保存上传的元数据", + "options.rpc-save-upload-metadata.description": "在 dir 参数设置的目录中保存上传的种子文件或磁链的元数据. 文件名包括 SHA-1 哈希后的元数据和扩展名两部分. 对于种子文件, 扩展名为 '.torrent'. 对于磁链为 '.meta4'. 如果此选项设置为否, 通过 aria2.addTorrent() 或 aria2.addMetalink() 方法添加的下载将无法通过 --save-session 选项保存.", + "options.rpc-secure.name": "启用 SSL/TLS", + "options.rpc-secure.description": "RPC 将通过 SSL/TLS 加密传输. RPC 客户端需要使用 https 协议连接服务器. 对于 WebSocket 客户端, 使用 wss 协议. 使用 --rpc-certificate 和 --rpc-private-key 选项设置服务器的证书和私钥.", + "options.allow-overwrite.name": "", + "options.allow-overwrite.description": "", + "options.allow-piece-length-change.name": "", + "options.allow-piece-length-change.description": "", + "options.always-resume.name": "", + "options.always-resume.description": "", + "options.async-dns.name": "", + "options.async-dns.description": "", + "options.auto-file-renaming.name": "", + "options.auto-file-renaming.description": "", + "options.auto-save-interval.name": "", + "options.auto-save-interval.description": "", + "options.conditional-get.name": "", + "options.conditional-get.description": "", + "options.conf-path.name": "", + "options.conf-path.description": "", + "options.console-log-level.name": "", + "options.console-log-level.description": "", + "options.daemon.name": "", + "options.daemon.description": "", + "options.deferred-input.name": "", + "options.deferred-input.description": "", + "options.disable-ipv6.name": "", + "options.disable-ipv6.description": "", + "options.disk-cache.name": "", + "options.disk-cache.description": "", + "options.download-result.name": "", + "options.download-result.description": "", + "options.dscp.name": "", + "options.dscp.description": "", + "options.rlimit-nofile.name": "", + "options.rlimit-nofile.description": "", + "options.enable-color.name": "", + "options.enable-color.description": "", + "options.enable-mmap.name": "", + "options.enable-mmap.description": "", + "options.event-poll.name": "", + "options.event-poll.description": "", + "options.file-allocation.name": "", + "options.file-allocation.description": "", + "options.force-save.name": "", + "options.force-save.description": "", + "options.hash-check-only.name": "", + "options.hash-check-only.description": "", + "options.human-readable.name": "", + "options.human-readable.description": "", + "options.max-download-result.name": "", + "options.max-download-result.description": "", + "options.max-mmap-limit.name": "", + "options.max-mmap-limit.description": "", + "options.max-resume-failure-tries.name": "", + "options.max-resume-failure-tries.description": "", + "options.min-tls-version.name": "", + "options.min-tls-version.description": "", + "options.log-level.name": "", + "options.log-level.description": "", + "options.piece-length.name": "", + "options.piece-length.description": "", + "options.optimize-concurrent-downloads.name": "", + "options.optimize-concurrent-downloads.description": "", + "options.show-console-readout.name": "", + "options.show-console-readout.description": "", + "options.summary-interval.name": "", + "options.summary-interval.description": "", + "options.max-overall-download-limit.name": "", + "options.max-overall-download-limit.description": "", + "options.max-download-limit.name": "", + "options.max-download-limit.description": "", + "options.no-conf.name": "", + "options.no-conf.description": "", + "options.no-file-allocation-limit.name": "", + "options.no-file-allocation-limit.description": "", + "options.parameterized-uri.name": "", + "options.parameterized-uri.description": "", + "options.quiet.name": "", + "options.quiet.description": "", + "options.realtime-chunk-checksum.name": "", + "options.realtime-chunk-checksum.description": "", + "options.remove-control-file.name": "", + "options.remove-control-file.description": "", + "options.save-session.name": "", + "options.save-session.description": "", + "options.save-session-interval.name": "", + "options.save-session-interval.description": "", + "options.socket-recv-buffer-size.name": "", + "options.socket-recv-buffer-size.description": "", + "options.stop.name": "", + "options.stop.description": "", + "options.truncate-console-readout.name": "", + "options.truncate-console-readout.description": "" } diff --git a/app/scripts/controllers/settings-aria2.js b/app/scripts/controllers/settings-aria2.js index 008611e..d30c961 100644 --- a/app/scripts/controllers/settings-aria2.js +++ b/app/scripts/controllers/settings-aria2.js @@ -1,34 +1,43 @@ (function () { 'use strict'; - angular.module('ariaNg').controller('Aria2SettingsController', ['$scope', '$location', '$timeout', 'ariaNgConstants', 'aria2AvailableOptions', 'aria2RpcService', 'utils', function ($scope, $location, $timeout, ariaNgConstants, aria2AvailableOptions, aria2RpcService, utils) { + angular.module('ariaNg').controller('Aria2SettingsController', ['$scope', '$location', '$timeout', 'ariaNgConstants', 'aria2GlobalAvailableOptions', 'aria2RpcService', 'utils', function ($scope, $location, $timeout, ariaNgConstants, aria2GlobalAvailableOptions, aria2RpcService, utils) { var location = $location.path().substring($location.path().lastIndexOf('/') + 1); var pendingSaveRequest = {}; - var getAvailableOptions = function (location) { + var getAvailableOptionsKeys = function (location) { if (location == 'basic') { - return aria2AvailableOptions.basicOptions; + return aria2GlobalAvailableOptions.basicOptions; } else if (location == 'http-ftp-sftp') { - return aria2AvailableOptions.httpFtpSFtpOptions; + return aria2GlobalAvailableOptions.httpFtpSFtpOptions; } else if (location == 'http') { - return aria2AvailableOptions.httpOptions; + return aria2GlobalAvailableOptions.httpOptions; } else if (location == 'ftp-sftp') { - return aria2AvailableOptions.ftpSFtpOptions; - } else if (location == 'bt-metalink') { - return aria2AvailableOptions.btMetalinkOptions; + return aria2GlobalAvailableOptions.ftpSFtpOptions; } else if (location == 'bt') { - return aria2AvailableOptions.btOptions; + return aria2GlobalAvailableOptions.btOptions; } else if (location == 'metalink') { - return aria2AvailableOptions.metalinkOptions; + return aria2GlobalAvailableOptions.metalinkOptions; } else if (location == 'rpc') { - return aria2AvailableOptions.rpcOptions; + return aria2GlobalAvailableOptions.rpcOptions; } else if (location == 'advanced') { - return aria2AvailableOptions.advancedOptions; + return aria2GlobalAvailableOptions.advancedOptions; } else { utils.alert('Type is illegal!'); + return false; } }; + var getAvailableOptions = function (location) { + var keys = getAvailableOptionsKeys(location); + + if (!keys) { + return; + } + + return utils.getOptions(keys); + }; + $scope.optionStatus = {}; $scope.availableOptions = getAvailableOptions(location); $scope.setGlobalOption = function (option, value, lazySave) { diff --git a/app/scripts/core/aria2options.js b/app/scripts/core/aria2options.js index d960d59..795cfa8 100644 --- a/app/scripts/core/aria2options.js +++ b/app/scripts/core/aria2options.js @@ -1,1022 +1,551 @@ (function () { 'use strict'; - - angular.module('ariaNg').constant('aria2AvailableOptions', { - basicOptions: [ - { - key: 'dir', - name: 'Download Path', - type: 'string', - description: 'The directory to store the downloaded file.' - }, - { - key: 'log', - name: 'Log File', - type: 'string', - description: 'The file name of the log file. If - is specified, log is written to stdout. If empty string("") is specified, or this option is omitted, no log is written to disk at all.' - }, - { - key: 'max-concurrent-downloads', - name: 'Max Concurrent Downloads', - type: 'integer', - description: 'Set the maximum number of parallel downloads for every queue item.' - }, - { - key: 'check-integrity', - name: 'Check Integrity', - type: 'boolean', - description: 'Check file integrity by validating piece hashes or a hash of entire file. This option has effect only in BitTorrent, Metalink downloads with checksums or HTTP(S)/FTP downloads with --checksum option.' - }, - { - key: 'continue', - name: 'Resume Download', - type: 'boolean', - description: 'Continue downloading a partially downloaded file. Use this option to resume a download started by a web browser or another program which downloads files sequentially from the beginning. Currently this option is only applicable to HTTP(S)/FTP downloads.' - } - ], - httpFtpSFtpOptions: [ - { - key: 'all-proxy', - name: '', - type: 'string', - description: '' - }, - { - key: 'all-proxy-user', - name: '', - type: 'string', - description: '' - }, - { - key: 'all-proxy-passwd', - name: '', - type: 'string', - description: '' - }, - { - key: 'connect-timeout', - name: '', - type: 'integer', - suffix: 'Seconds', - description: '' - }, - { - key: 'dry-run', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'lowest-speed-limit', - name: '', - type: 'string', - description: '' - }, - { - key: 'max-connection-per-server', - name: '', - type: 'integer', - description: '' - }, - { - key: 'max-file-not-found', - name: '', - type: 'integer', - description: '' - }, - { - key: 'max-tries', - name: '', - type: 'integer', - description: '' - }, - { - key: 'min-split-size', - name: '', - type: 'string', - suffix: 'Bytes', - description: '' - }, - { - key: 'netrc-path', - name: '', - type: 'string', - description: '', - readonly: true - }, - { - key: 'no-netrc', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'no-proxy', - name: '', - type: 'string', - description: '' - }, - { - key: 'proxy-method', - name: '', - type: 'option', - options: ['get', 'tunnel'], - description: '' - }, - { - key: 'remote-time', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'reuse-uri', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'retry-wait', - name: '', - type: 'integer', - suffix: 'Seconds', - description: '' - }, - { - key: 'server-stat-of', - name: '', - type: 'string', - description: '' - }, - { - key: 'server-stat-timeout', - name: '', - type: 'integer', - suffix: 'Seconds', - description: '', - readonly: true - }, - { - key: 'split', - name: '', - type: 'integer', - description: '' - }, - { - key: 'stream-piece-selector', - name: '', - type: 'option', - options: ['default', 'inorder', 'random', 'geom'], - description: '' - }, - { - key: 'timeout', - name: '', - type: 'integer', - suffix: 'Seconds', - description: '' - }, - { - key: 'uri-selector', - name: '', - type: 'option', - options: ['inorder', 'feedback', 'adaptive'], - description: '' - } - ], - httpOptions: [ - { - key: 'check-certificate', - name: '', - type: 'boolean', - description: '', - readonly: true - }, - { - key: 'http-accept-gzip', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'http-auth-challenge', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'http-no-cache', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'http-user', - name: '', - type: 'string', - description: '' - }, - { - key: 'http-passwd', - name: '', - type: 'string', - description: '' - }, - { - key: 'http-proxy', - name: '', - type: 'string', - description: '' - }, - { - key: 'http-proxy-user', - name: '', - type: 'string', - description: '' - }, - { - key: 'http-proxy-passwd', - name: '', - type: 'string', - description: '' - }, - { - key: 'https-proxy', - name: '', - type: 'string', - description: '' - }, - { - key: 'https-proxy-user', - name: '', - type: 'string', - description: '' - }, - { - key: 'https-proxy-passwd', - name: '', - type: 'string', - description: '' - }, - { - key: 'referer', - name: '', - type: 'string', - description: '' - }, - { - key: 'enable-http-keep-alive', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'enable-http-pipelining', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'header', - name: '', - type: 'string', - description: '' - }, - { - key: 'save-cookies', - name: '', - type: 'string', - description: '' - }, - { - key: 'use-head', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'user-agent', - name: '', - type: 'string', - description: '' - } - ], - ftpSFtpOptions: [ - { - key: 'ftp-user', - name: '', - type: 'string', - description: '' - }, - { - key: 'ftp-passwd', - name: '', - type: 'string', - description: '' - }, - { - key: 'ftp-pasv', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'ftp-proxy', - name: '', - type: 'string', - description: '' - }, - { - key: 'ftp-proxy-user', - name: '', - type: 'string', - description: '' - }, - { - key: 'ftp-proxy-passwd', - name: '', - type: 'string', - description: '' - }, - { - key: 'ftp-type', - name: '', - type: 'option', - options: ['binary', 'ascii'], - description: '' - }, - { - key: 'ftp-reuse-connection', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'ssh-host-key-md', - name: '', - type: 'string', - description: '' - } - ], - btMetalinkOptions: [ - { - key: 'show-files', - name: '', - type: 'boolean', - description: '', - readonly: true - } - ], - btOptions: [ - { - key: 'bt-detach-seed-only', - name: '', - type: 'boolean', - description: '', - readonly: true - }, - { - key: 'bt-enable-hook-after-hash-check', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'bt-enable-lpd', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'bt-exclude-tracker', - name: '', - type: 'text', - description: '' - }, - { - key: 'bt-external-ip', - name: '', - type: 'string', - description: '' - }, - { - key: 'bt-force-encryption', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'bt-hash-check-seed', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'bt-max-open-files', - name: '', - type: 'integer', - description: '' - }, - { - key: 'bt-max-peers', - name: '', - type: 'integer', - description: '' - }, - { - key: 'bt-metadata-only', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'bt-min-crypto-level', - name: '', - type: 'option', - options: ['plain', 'arc4'], - description: '' - }, - { - key: 'bt-prioritize-piece', - name: '', - type: 'string', - description: '' - }, - { - key: 'bt-remove-unselected-file', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'bt-require-crypto', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'bt-request-peer-speed-limit', - name: '', - type: 'string', - description: '' - }, - { - key: 'bt-save-metadata', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'bt-seed-unverified', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'bt-stop-timeout', - name: '', - type: 'integer', - suffix: 'Seconds', - description: '' - }, - { - key: 'bt-tracker', - name: '', - type: 'text', - description: '' - }, - { - key: 'bt-tracker-connect-timeout', - name: '', - type: 'integer', - suffix: 'Seconds', - description: '' - }, - { - key: 'bt-tracker-interval', - name: '', - type: 'integer', - suffix: 'Seconds', - description: '' - }, - { - key: 'bt-tracker-timeout', - name: '', - type: 'integer', - suffix: 'Seconds', - description: '' - }, - { - key: 'dht-file-path', - name: '', - type: 'string', - description: '', - readonly: true - }, - { - key: 'dht-file-path6', - name: '', - type: 'string', - description: '', - readonly: true - }, - { - key: 'dht-listen-port', - name: '', - type: 'integer', - description: '', - readonly: true - }, - { - key: 'dht-message-timeout', - name: '', - type: 'integer', - suffix: 'Seconds', - description: '', - readonly: true - }, - { - key: 'enable-dht', - name: '', - type: 'boolean', - description: '', - readonly: true - }, - { - key: 'enable-dht6', - name: '', - type: 'boolean', - description: '', - readonly: true - }, - { - key: 'enable-peer-exchange', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'follow-torrent', - name: '', - type: 'option', - options: ['true', 'false', 'mem'], - description: '' - }, - { - key: 'listen-port', - name: '', - type: 'integer', - description: '', - readonly: true - }, - { - key: 'max-overall-upload-limit', - name: '', - type: 'string', - description: '' - }, - { - key: 'max-upload-limit', - name: '', - type: 'string', - description: '' - }, - { - key: 'peer-id-prefix', - name: '', - type: 'string', - description: '', - readonly: true - }, - { - key: 'seed-ratio', - name: '', - type: 'float', - description: '' - }, - { - key: 'seed-time', - name: '', - type: 'integer', - suffix: 'Minutes', - description: '' - } - ], - metalinkOptions: [ - { - key: 'follow-metalink', - name: '', - type: 'option', - options: ['true', 'false', 'mem'], - description: '' - }, - { - key: 'metalink-base-uri', - name: '', - type: 'string', - description: '' - }, - { - key: 'metalink-language', - name: '', - type: 'string', - description: '' - }, - { - key: 'metalink-location', - name: '', - type: 'string', - description: '' - }, - { - key: 'metalink-os', - name: '', - type: 'string', - description: '' - }, - { - key: 'metalink-version', - name: '', - type: 'string', - description: '' - }, - { - key: 'metalink-preferred-protocol', - name: '', - type: 'option', - options: ['http', 'https', 'ftp', 'none'], - description: '' - }, - { - key: 'metalink-enable-unique-protocol', - name: '', - type: 'boolean', - description: '' - } - ], - rpcOptions: [ - { - key: 'enable-rpc', - name: 'Enable JSON-RPC/XML-RPC Server', - type: 'boolean', - description: 'Enable JSON-RPC/XML-RPC server.', - readonly: true - }, - { - key: 'pause-metadata', - name: 'Pause After Metadata Downloaded', - type: 'boolean', - description: 'Pause downloads created as a result of metadata download. There are 3 types of metadata downloads in aria2: (1) downloading .torrent file. (2) downloading torrent metadata using magnet link. (3) downloading metalink file. These metadata downloads will generate downloads using their metadata. This option pauses these subsequent downloads. This option is effective only when --enable-rpc=true is given.' - }, - { - key: 'rpc-allow-origin-all', - name: 'Allow All Origin Request', - type: 'boolean', - description: 'Add Access-Control-Allow-Origin header field with value * to the RPC response.', - readonly: true - }, - { - key: 'rpc-listen-all', - name: 'Listen on All Network Interfaces', - type: 'boolean', - description: 'Listen incoming JSON-RPC/XML-RPC requests on all network interfaces. If false is given, listen only on local loopback interface.', - readonly: true - }, - { - key: 'rpc-listen-port', - name: 'Listen Port', - type: 'integer', - description: 'Specify a port number for JSON-RPC/XML-RPC server to listen to.', - readonly: true - }, - { - key: 'rpc-max-request-size', - name: 'Max Request Size', - type: 'string', - suffix: 'Bytes', - description: 'Set max size of JSON-RPC/XML-RPC request. If aria2 detects the request is more than SIZE bytes, it drops connection.', - readonly: true - }, - { - key: 'rpc-save-upload-metadata', - name: 'Save Upload Metadata', - type: 'boolean', - description: 'Save the uploaded torrent or metalink meta data in the directory specified by --dir option. The file name consists of SHA-1 hash hex string of meta data plus extension. For torrent, the extension is \'.torrent\'. For metalink, it is \'.meta4\'. If false is given to this option, the downloads added by aria2.addTorrent() or aria2.addMetalink() will not be saved by --save-session option.' - }, - { - key: 'rpc-secure', - name: 'Enable SSL/TLS', - type: 'boolean', - description: 'RPC transport will be encrypted by SSL/TLS. The RPC clients must use https scheme to access the server. For WebSocket client, use wss scheme. Use --rpc-certificate and --rpc-private-key options to specify the server certificate and private key.', - readonly: true - } - ], - advancedOptions: [ - { - key: 'allow-overwrite', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'allow-piece-length-change', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'always-resume', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'async-dns', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'auto-file-renaming', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'auto-save-interval', - name: '', - type: 'integer', - suffix: 'Seconds', - description: '', - readonly: true - }, - { - key: 'conditional-get', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'conf-path', - name: '', - type: 'string', - description: '', - readonly: true - }, - { - key: 'console-log-level', - name: '', - type: 'option', - options: ['debug', 'info', 'notice', 'warn', 'error'], - description: '', - readonly: true - }, - { - key: 'daemon', - name: '', - type: 'boolean', - description: '', - readonly: true - }, - { - key: 'deferred-input', - name: '', - type: 'boolean', - description: '', - readonly: true - }, - { - key: 'disable-ipv6', - name: '', - type: 'boolean', - description: '', - readonly: true - }, - { - key: 'disk-cache', - name: '', - type: 'string', - suffix: 'Bytes', - description: '', - readonly: true - }, - { - key: 'download-result', - name: '', - type: 'option', - options: ['default', 'full', 'hide'], - description: '' - }, - { - key: 'dscp', - name: '', - type: 'string', - description: '', - readonly: true - }, - { - key: 'rlimit-nofile', - name: '', - type: 'string', - description: '', - readonly: true - }, - { - key: 'enable-color', - name: '', - type: 'boolean', - description: '', - readonly: true - }, - { - key: 'enable-mmap', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'event-poll', - name: '', - type: 'option', - options: ['epoll', 'kqueue', 'port', 'poll', 'select'], - description: '', - readonly: true - }, - { - key: 'file-allocation', - name: '', - type: 'option', - options: ['none', 'prealloc', 'trunc', 'falloc'], - description: '' - }, - { - key: 'force-save', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'hash-check-only', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'human-readable', - name: '', - type: 'boolean', - description: '', - readonly: true - }, - { - key: 'max-download-result', - name: '', - type: 'integer', - description: '' - }, - { - key: 'max-mmap-limit', - name: '', - type: 'string', - suffix: 'Bytes', - description: '' - }, - { - key: 'max-resume-failure-tries', - name: '', - type: 'integer', - description: '' - }, - { - key: 'min-tls-version', - name: '', - type: 'option', - options: ['SSLv3', 'TLSv1', 'TLSv1.1', 'TLSv1.2'], - description: '', - readonly: true - }, - { - key: 'log-level', - name: '', - type: 'option', - options: ['debug', 'info', 'notice', 'warn', 'error'], - description: '' - }, - { - key: 'piece-length', - name: '', - type: 'integer', - description: '' - }, - { - key: 'optimize-concurrent-downloads', - name: '', - type: 'string', - description: '' - }, - { - key: 'show-console-readout', - name: '', - type: 'boolean', - description: '', - readonly: true - }, - { - key: 'summary-interval', - name: '', - type: 'integer', - suffix: 'Seconds', - description: '', - readonly: true - }, - { - key: 'max-overall-download-limit', - name: '', - type: 'string', - description: '' - }, - { - key: 'max-download-limit', - name: '', - type: 'string', - description: '' - }, - { - key: 'no-conf', - name: '', - type: 'boolean', - description: '', - readonly: true - }, - { - key: 'no-file-allocation-limit', - name: '', - type: 'string', - suffix: 'Bytes', - description: '' - }, - { - key: 'parameterized-uri', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'quiet', - name: '', - type: 'boolean', - description: '', - readonly: true - }, - { - key: 'realtime-chunk-checksum', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'remove-control-file', - name: '', - type: 'boolean', - description: '' - }, - { - key: 'save-session', - name: '', - type: 'string', - description: '' - }, - { - key: 'save-session-interval', - name: '', - type: 'integer', - suffix: 'Seconds', - description: '', - readonly: true - }, - { - key: 'socket-recv-buffer-size', - name: '', - type: 'string', - suffix: 'Bytes', - description: '', - readonly: true - }, - { - key: 'stop', - name: '', - type: 'integer', - suffix: 'Seconds', - description: '', - readonly: true - }, - { - key: 'truncate-console-readout', - name: '', - type: 'boolean', - description: '', - readonly: true - } - ] + angular.module('ariaNg').constant('aria2AllOptions', { + 'dir': { + type: 'string' + }, + 'log': { + type: 'string' + }, + 'max-concurrent-downloads': { + type: 'integer' + }, + 'check-integrity': { + type: 'boolean' + }, + 'continue': { + type: 'boolean' + }, + 'all-proxy': { + type: 'string' + }, + 'all-proxy-user': { + type: 'string' + }, + 'all-proxy-passwd': { + type: 'string' + }, + 'connect-timeout': { + type: 'integer', + suffix: 'Seconds' + }, + 'dry-run': { + type: 'boolean' + }, + 'lowest-speed-limit': { + type: 'string', + suffix: 'Bytes' + }, + 'max-connection-per-server': { + type: 'integer' + }, + 'max-file-not-found': { + type: 'integer' + }, + 'max-tries': { + type: 'integer' + }, + 'min-split-size': { + type: 'string', + suffix: 'Bytes' + }, + 'netrc-path': { + type: 'string', + readonly: true + }, + 'no-netrc': { + type: 'boolean' + }, + 'no-proxy': { + type: 'string' + }, + 'proxy-method': { + type: 'option', + options: ['get', 'tunnel'] + }, + 'remote-time': { + type: 'boolean' + }, + 'reuse-uri': { + type: 'boolean' + }, + 'retry-wait': { + type: 'integer', + suffix: 'Seconds' + }, + 'server-stat-of': { + type: 'string' + }, + 'server-stat-timeout': { + type: 'integer', + suffix: 'Seconds', + readonly: true + }, + 'split': { + type: 'integer' + }, + 'stream-piece-selector': { + type: 'option', + options: ['default', 'inorder', 'random', 'geom'] + }, + 'timeout': { + type: 'integer', + suffix: 'Seconds' + }, + 'uri-selector': { + type: 'option', + options: ['inorder', 'feedback', 'adaptive'] + }, + 'check-certificate': { + type: 'boolean', + readonly: true + }, + 'http-accept-gzip': { + type: 'boolean' + }, + 'http-auth-challenge': { + type: 'boolean' + }, + 'http-no-cache': { + type: 'boolean' + }, + 'http-user': { + type: 'string' + }, + 'http-passwd': { + type: 'string' + }, + 'http-proxy': { + type: 'string' + }, + 'http-proxy-user': { + type: 'string' + }, + 'http-proxy-passwd': { + type: 'string' + }, + 'https-proxy': { + type: 'string' + }, + 'https-proxy-user': { + type: 'string' + }, + 'https-proxy-passwd': { + type: 'string' + }, + 'referer': { + type: 'string' + }, + 'enable-http-keep-alive': { + type: 'boolean' + }, + 'enable-http-pipelining': { + type: 'boolean' + }, + 'header': { + type: 'string' + }, + 'save-cookies': { + type: 'string' + }, + 'use-head': { + type: 'boolean' + }, + 'user-agent': { + type: 'string' + }, + 'ftp-user': { + type: 'string' + }, + 'ftp-passwd': { + type: 'string' + }, + 'ftp-pasv': { + type: 'boolean' + }, + 'ftp-proxy': { + type: 'string' + }, + 'ftp-proxy-user': { + type: 'string' + }, + 'ftp-proxy-passwd': { + type: 'string' + }, + 'ftp-type': { + type: 'option', + options: ['binary', 'ascii'] + }, + 'ftp-reuse-connection': { + type: 'boolean' + }, + 'ssh-host-key-md': { + type: 'string' + }, + 'show-files': { + type: 'boolean', + readonly: true + }, + 'bt-detach-seed-only': { + type: 'boolean', + readonly: true + }, + 'bt-enable-hook-after-hash-check': { + type: 'boolean' + }, + 'bt-enable-lpd': { + type: 'boolean' + }, + 'bt-exclude-tracker': { + type: 'text' + }, + 'bt-external-ip': { + type: 'string' + }, + 'bt-force-encryption': { + type: 'boolean' + }, + 'bt-hash-check-seed': { + type: 'boolean' + }, + 'bt-max-open-files': { + type: 'integer' + }, + 'bt-max-peers': { + type: 'integer' + }, + 'bt-metadata-only': { + type: 'boolean' + }, + 'bt-min-crypto-level': { + type: 'option', + options: ['plain', 'arc4'] + }, + 'bt-prioritize-piece': { + type: 'string' + }, + 'bt-remove-unselected-file': { + type: 'boolean' + }, + 'bt-require-crypto': { + type: 'boolean' + }, + 'bt-request-peer-speed-limit': { + type: 'string' + }, + 'bt-save-metadata': { + type: 'boolean' + }, + 'bt-seed-unverified': { + type: 'boolean' + }, + 'bt-stop-timeout': { + type: 'integer', + suffix: 'Seconds' + }, + 'bt-tracker': { + type: 'text' + }, + 'bt-tracker-connect-timeout': { + type: 'integer', + suffix: 'Seconds' + }, + 'bt-tracker-interval': { + type: 'integer', + suffix: 'Seconds' + }, + 'bt-tracker-timeout': { + type: 'integer', + suffix: 'Seconds' + }, + 'dht-file-path': { + type: 'string', + readonly: true + }, + 'dht-file-path6': { + type: 'string', + readonly: true + }, + 'dht-listen-port': { + type: 'integer', + readonly: true + }, + 'dht-message-timeout': { + type: 'integer', + suffix: 'Seconds', + readonly: true + }, + 'enable-dht': { + type: 'boolean', + readonly: true + }, + 'enable-dht6': { + type: 'boolean', + readonly: true + }, + 'enable-peer-exchange': { + type: 'boolean' + }, + 'follow-torrent': { + type: 'option', + options: ['true', 'false', 'mem'] + }, + 'listen-port': { + type: 'integer', + readonly: true + }, + 'max-overall-upload-limit': { + type: 'string' + }, + 'max-upload-limit': { + type: 'string' + }, + 'peer-id-prefix': { + type: 'string', + readonly: true + }, + 'seed-ratio': { + type: 'float' + }, + 'seed-time': { + type: 'integer', + suffix: 'Minutes' + }, + 'follow-metalink': { + type: 'option', + options: ['true', 'false', 'mem'] + }, + 'metalink-base-uri': { + type: 'string' + }, + 'metalink-language': { + type: 'string' + }, + 'metalink-location': { + type: 'string' + }, + 'metalink-os': { + type: 'string' + }, + 'metalink-version': { + type: 'string' + }, + 'metalink-preferred-protocol': { + type: 'option', + options: ['http', 'https', 'ftp', 'none'] + }, + 'metalink-enable-unique-protocol': { + type: 'boolean' + }, + 'enable-rpc': { + type: 'boolean', + readonly: true + }, + 'pause-metadata': { + type: 'boolean' + }, + 'rpc-allow-origin-all': { + type: 'boolean', + readonly: true + }, + 'rpc-listen-all': { + type: 'boolean', + readonly: true + }, + 'rpc-listen-port': { + type: 'integer', + readonly: true + }, + 'rpc-max-request-size': { + type: 'string', + suffix: 'Bytes', + readonly: true + }, + 'rpc-save-upload-metadata': { + type: 'boolean' + }, + 'rpc-secure': { + type: 'boolean', + readonly: true + }, + 'allow-overwrite': { + type: 'boolean' + }, + 'allow-piece-length-change': { + type: 'boolean' + }, + 'always-resume': { + type: 'boolean' + }, + 'async-dns': { + type: 'boolean' + }, + 'auto-file-renaming': { + type: 'boolean' + }, + 'auto-save-interval': { + type: 'integer', + suffix: 'Seconds', + readonly: true + }, + 'conditional-get': { + type: 'boolean' + }, + 'conf-path': { + type: 'string', + readonly: true + }, + 'console-log-level': { + type: 'option', + options: ['debug', 'info', 'notice', 'warn', 'error'], + readonly: true + }, + 'daemon': { + type: 'boolean', + readonly: true + }, + 'deferred-input': { + type: 'boolean', + readonly: true + }, + 'disable-ipv6': { + type: 'boolean', + readonly: true + }, + 'disk-cache': { + type: 'string', + suffix: 'Bytes', + readonly: true + }, + 'download-result': { + type: 'option', + options: ['default', 'full', 'hide'] + }, + 'dscp': { + type: 'string', + readonly: true + }, + 'rlimit-nofile': { + type: 'string', + readonly: true + }, + 'enable-color': { + type: 'boolean', + readonly: true + }, + 'enable-mmap': { + type: 'boolean' + }, + 'event-poll': { + type: 'option', + options: ['epoll', 'kqueue', 'port', 'poll', 'select'], + readonly: true + }, + 'file-allocation': { + type: 'option', + options: ['none', 'prealloc', 'trunc', 'falloc'] + }, + 'force-save': { + type: 'boolean' + }, + 'hash-check-only': { + type: 'boolean' + }, + 'human-readable': { + type: 'boolean', + readonly: true + }, + 'max-download-result': { + type: 'integer' + }, + 'max-mmap-limit': { + type: 'string', + suffix: 'Bytes' + }, + 'max-resume-failure-tries': { + type: 'integer' + }, + 'min-tls-version': { + type: 'option', + options: ['SSLv3', 'TLSv1', 'TLSv1.1', 'TLSv1.2'], + readonly: true + }, + 'log-level': { + type: 'option', + options: ['debug', 'info', 'notice', 'warn', 'error'] + }, + 'piece-length': { + type: 'integer' + }, + 'optimize-concurrent-downloads': { + type: 'string' + }, + 'show-console-readout': { + type: 'boolean', + readonly: true + }, + 'summary-interval': { + type: 'integer', + suffix: 'Seconds', + readonly: true + }, + 'max-overall-download-limit': { + type: 'string' + }, + 'max-download-limit': { + type: 'string' + }, + 'no-conf': { + type: 'boolean', + readonly: true + }, + 'no-file-allocation-limit': { + type: 'string', + suffix: 'Bytes' + }, + 'parameterized-uri': { + type: 'boolean' + }, + 'quiet': { + type: 'boolean', + readonly: true + }, + 'realtime-chunk-checksum': { + type: 'boolean' + }, + 'remove-control-file': { + type: 'boolean' + }, + 'save-session': { + type: 'string' + }, + 'save-session-interval': { + type: 'integer', + suffix: 'Seconds', + readonly: true + }, + 'socket-recv-buffer-size': { + type: 'string', + suffix: 'Bytes', + readonly: true + }, + 'stop': { + type: 'integer', + suffix: 'Seconds', + readonly: true + }, + 'truncate-console-readout': { + type: 'boolean', + readonly: true + } + }).constant('aria2GlobalAvailableOptions', { + basicOptions: ['dir', 'log', 'max-concurrent-downloads', 'check-integrity', 'continue'], + httpFtpSFtpOptions: ['all-proxy', 'all-proxy-user', 'all-proxy-passwd', 'connect-timeout', 'dry-run', 'lowest-speed-limit', 'max-connection-per-server', 'max-file-not-found', 'max-tries', 'min-split-size', 'netrc-path', 'no-netrc', 'no-proxy', 'proxy-method', 'remote-time', 'reuse-uri', 'retry-wait', 'server-stat-of', 'server-stat-timeout', 'split', 'stream-piece-selector', 'timeout', 'uri-selector'], + httpOptions: ['check-certificate', 'http-accept-gzip', 'http-auth-challenge', 'http-no-cache', 'http-user', 'http-passwd', 'http-proxy', 'http-proxy-user', 'http-proxy-passwd', 'https-proxy', 'https-proxy-user', 'https-proxy-passwd', 'referer', 'enable-http-keep-alive', 'enable-http-pipelining', 'header', 'save-cookies', 'use-head', 'user-agent'], + ftpSFtpOptions: ['ftp-user', 'ftp-passwd', 'ftp-pasv', 'ftp-proxy', 'ftp-proxy-user', 'ftp-proxy-passwd', 'ftp-type', 'ftp-reuse-connection', 'ssh-host-key-md'], + btOptions: ['bt-detach-seed-only', 'bt-enable-hook-after-hash-check', 'bt-enable-lpd', 'bt-exclude-tracker', 'bt-external-ip', 'bt-force-encryption', 'bt-hash-check-seed', 'bt-max-open-files', 'bt-max-peers', 'bt-metadata-only', 'bt-min-crypto-level', 'bt-prioritize-piece', 'bt-remove-unselected-file', 'bt-require-crypto', 'bt-request-peer-speed-limit', 'bt-save-metadata', 'bt-seed-unverified', 'bt-stop-timeout', 'bt-tracker', 'bt-tracker-connect-timeout', 'bt-tracker-interval', 'bt-tracker-timeout', 'dht-file-path', 'dht-file-path6', 'dht-listen-port', 'dht-message-timeout', 'enable-dht', 'enable-dht6', 'enable-peer-exchange', 'follow-torrent', 'listen-port', 'max-overall-upload-limit', 'max-upload-limit', 'peer-id-prefix', 'seed-ratio', 'seed-time'], + metalinkOptions: ['follow-metalink', 'metalink-base-uri', 'metalink-language', 'metalink-location', 'metalink-os', 'metalink-version', 'metalink-preferred-protocol', 'metalink-enable-unique-protocol'], + rpcOptions: ['enable-rpc', 'pause-metadata', 'rpc-allow-origin-all', 'rpc-listen-all', 'rpc-listen-port', 'rpc-max-request-size', 'rpc-save-upload-metadata', 'rpc-secure'], + advancedOptions: ['allow-overwrite', 'allow-piece-length-change', 'always-resume', 'async-dns', 'auto-file-renaming', 'auto-save-interval', 'conditional-get', 'conf-path', 'console-log-level', 'daemon', 'deferred-input', 'disable-ipv6', 'disk-cache', 'download-result', 'dscp', 'rlimit-nofile', 'enable-color', 'enable-mmap', 'event-poll', 'file-allocation', 'force-save', 'hash-check-only', 'human-readable', 'max-download-result', 'max-mmap-limit', 'max-resume-failure-tries', 'min-tls-version', 'log-level', 'piece-length', 'optimize-concurrent-downloads', 'show-console-readout', 'summary-interval', 'max-overall-download-limit', 'max-download-limit', 'no-conf', 'no-file-allocation-limit', 'parameterized-uri', 'quiet', 'realtime-chunk-checksum', 'remove-control-file', 'save-session', 'save-session-interval', 'socket-recv-buffer-size', 'stop', 'truncate-console-readout'] }); })(); diff --git a/app/scripts/core/config.js b/app/scripts/core/config.js index 11fb19e..c43b250 100644 --- a/app/scripts/core/config.js +++ b/app/scripts/core/config.js @@ -10,10 +10,10 @@ $translateProvider.useStaticFilesLoader({ prefix: 'langs/', suffix: '.json' - }); - $translateProvider.useLoaderCache(true); - $translateProvider.preferredLanguage('en-US'); - $translateProvider.useSanitizeValueStrategy('escape'); + }).useLoaderCache(true) + .preferredLanguage('en-US') + .fallbackLanguage('en-US') + .useSanitizeValueStrategy('escape'); }]).run(['$translate', 'amMoment', 'moment', 'ariaNgConstants', 'ariaNgSettingService', function ($translate, amMoment, moment, ariaNgConstants, ariaNgSettingService) { ariaNgSettingService.applyLanguage(ariaNgSettingService.getLanguage()); diff --git a/app/scripts/core/lang-default.js b/app/scripts/core/lang-default.js index 84124a4..ab81230 100644 --- a/app/scripts/core/lang-default.js +++ b/app/scripts/core/lang-default.js @@ -40,7 +40,6 @@ 'HTTP/FTP/SFTP Settings': 'HTTP/FTP/SFTP Settings', 'HTTP Settings': 'HTTP Settings', 'FTP/SFTP Settings': 'FTP/SFTP Settings', - 'BitTorrent/MegaLink Settings': 'BitTorrent/MegaLink Settings', 'BitTorrent Settings': 'BitTorrent Settings', 'MegaLink Settings': 'MegaLink Settings', 'RPC Settings': 'RPC Settings', @@ -87,34 +86,6 @@ 'Milliseconds': 'Milliseconds', '(0 is disabled)': '(0 is disabled)', 'Changes to the settings take effect after refreshing page.': 'Changes to the settings take effect after refreshing page.', - 'Download Path': 'Download Path', - 'The directory to store the downloaded file.': '', - 'Input File': 'Input File', - 'The input file can contain a list of URIs for aria2 to download.': '', - 'Log File': 'Log File', - 'The file name of the log file. If - is specified, log is written to stdout. If empty string("") is specified, or this option is omitted, no log is written to disk at all.': 'The file name of the log file. If - is specified, log is written to stdout. If empty string("") is specified, or this option is omitted, no log is written to disk at all.', - 'Max Concurrent Downloads': 'Max Concurrent Downloads', - 'Set the maximum number of parallel downloads for every queue item.': '', - 'Check Integrity': 'Check Integrity', - 'Check file integrity by validating piece hashes or a hash of entire file. This option has effect only in BitTorrent, Metalink downloads with checksums or HTTP(S)/FTP downloads with --checksum option.': 'Check file integrity by validating piece hashes or a hash of entire file. This option has effect only in BitTorrent, Metalink downloads with checksums or HTTP(S)/FTP downloads with --checksum option.', - 'Resume Download': 'Resume Download', - 'Continue downloading a partially downloaded file. Use this option to resume a download started by a web browser or another program which downloads files sequentially from the beginning. Currently this option is only applicable to HTTP(S)/FTP downloads.': 'Continue downloading a partially downloaded file. Use this option to resume a download started by a web browser or another program which downloads files sequentially from the beginning. Currently this option is only applicable to HTTP(S)/FTP downloads.', - 'Enable JSON-RPC/XML-RPC Server': 'Enable JSON-RPC/XML-RPC Server', - 'Enable JSON-RPC/XML-RPC server.': '', - 'Pause After Metadata Downloaded': 'Pause After Metadata Downloaded', - 'Pause downloads created as a result of metadata download. There are 3 types of metadata downloads in aria2: (1) downloading .torrent file. (2) downloading torrent metadata using magnet link. (3) downloading metalink file. These metadata downloads will generate downloads using their metadata. This option pauses these subsequent downloads. This option is effective only when --enable-rpc=true is given.': 'Pause downloads created as a result of metadata download. There are 3 types of metadata downloads in aria2: (1) downloading .torrent file. (2) downloading torrent metadata using magnet link. (3) downloading metalink file. These metadata downloads will generate downloads using their metadata. This option pauses these subsequent downloads. This option is effective only when --enable-rpc=true is given.', - 'Allow All Origin Request': 'Allow All Origin Request', - 'Add Access-Control-Allow-Origin header field with value * to the RPC response.': 'Add Access-Control-Allow-Origin header field with value * to the RPC response.', - 'Listen on All Network Interfaces': 'Listen on All Network Interfaces', - 'Listen incoming JSON-RPC/XML-RPC requests on all network interfaces. If false is given, listen only on local loopback interface.': 'Listen incoming JSON-RPC/XML-RPC requests on all network interfaces. If false is given, listen only on local loopback interface.', - 'Listen Port': 'Listen Port', - 'Specify a port number for JSON-RPC/XML-RPC server to listen to.': '', - 'Max Request Size': 'Max Request Size', - 'Set max size of JSON-RPC/XML-RPC request. If aria2 detects the request is more than SIZE bytes, it drops connection.': 'Set max size of JSON-RPC/XML-RPC request. If aria2 detects the request is more than SIZE bytes, it drops connection.', - 'Save Upload Metadata': 'Save Upload Metadata', - 'Save the uploaded torrent or metalink meta data in the directory specified by --dir option. The file name consists of SHA-1 hash hex string of meta data plus extension. For torrent, the extension is \'.torrent\'. For metalink, it is \'.meta4\'. If false is given to this option, the downloads added by aria2.addTorrent() or aria2.addMetalink() will not be saved by --save-session option.': 'Save the uploaded torrent or metalink meta data in the directory specified by --dir option. The file name consists of SHA-1 hash hex string of meta data plus extension. For torrent, the extension is \'.torrent\'. For metalink, it is \'.meta4\'. If false is given to this option, the downloads added by aria2.addTorrent() or aria2.addMetalink() will not be saved by --save-session option.', - 'Enable SSL/TLS': 'Enable SSL/TLS', - 'RPC transport will be encrypted by SSL/TLS. The RPC clients must use https scheme to access the server. For WebSocket client, use wss scheme. Use --rpc-certificate and --rpc-private-key options to specify the server certificate and private key.': 'RPC transport will be encrypted by SSL/TLS. The RPC clients must use https scheme to access the server. For WebSocket client, use wss scheme. Use --rpc-certificate and --rpc-private-key options to specify the server certificate and private key.', 'Type is illegal!': 'Type is illegal!', 'none': 'None', 'http': 'Http', @@ -129,7 +100,313 @@ 'info': 'Info', 'notice': 'Notice', 'warn': 'Warn', - 'error': 'Error' + 'error': 'Error', + 'options.dir.name': 'Download Path', + 'options.dir.description': '', + 'options.log.name': 'Log File', + 'options.log.description': 'The file name of the log file. If - is specified, log is written to stdout. If empty string("") is specified, or this option is omitted, no log is written to disk at all.', + 'options.max-concurrent-downloads.name': 'Max Concurrent Downloads', + 'options.max-concurrent-downloads.description': '', + 'options.check-integrity.name': 'Check Integrity', + 'options.check-integrity.description': 'Check file integrity by validating piece hashes or a hash of entire file. This option has effect only in BitTorrent, Metalink downloads with checksums or HTTP(S)/FTP downloads with --checksum option.', + 'options.continue.name': 'Resume Download', + 'options.continue.description': 'Continue downloading a partially downloaded file. Use this option to resume a download started by a web browser or another program which downloads files sequentially from the beginning. Currently this option is only applicable to HTTP(S)/FTP downloads.', + 'options.all-proxy.name': 'Proxy Server', + 'options.all-proxy.description': 'Use a proxy server for all protocols. To override a previously defined proxy, use "". You also can override this setting and specify a proxy server for a particular protocol using --http-proxy, --https-proxy and --ftp-proxy options. This affects all downloads. The format of PROXY is [http://][USER:PASSWORD@]HOST[:PORT].', + 'options.all-proxy-user.name': 'Proxy User Name', + 'options.all-proxy-user.description': '', + 'options.all-proxy-passwd.name': 'Proxy Password', + 'options.all-proxy-passwd.description': '', + 'options.connect-timeout.name': 'Connect Timeout', + 'options.connect-timeout.description': 'Set the connect timeout in seconds to establish connection to HTTP/FTP/proxy server. After the connection is established, this option makes no effect and --timeout option is used instead.', + 'options.dry-run.name': 'Dry Run', + 'options.dry-run.description': 'If true is given, aria2 just checks whether the remote file is available and doesn\'t download data. This option has effect on HTTP/FTP download. BitTorrent downloads are canceled if true is specified.', + 'options.lowest-speed-limit.name': 'Lowest Speed Limit', + 'options.lowest-speed-limit.description': 'Close connection if download speed is lower than or equal to this value(bytes per sec). 0 means aria2 does not have a lowest speed limit. You can append K or M (1K = 1024, 1M = 1024K). This option does not affect BitTorrent downloads.', + 'options.max-connection-per-server.name': 'Max Connection Per Server', + 'options.max-connection-per-server.description': '', + 'options.max-file-not-found.name': 'Max File Not Found Try Times', + 'options.max-file-not-found.description': '', + 'options.max-tries.name': 'Max Try Times', + 'options.max-tries.description': 'Set number of tries. 0 means unlimited.', + 'options.min-split-size.name': 'Min Split Size', + 'options.min-split-size.description': 'aria2 does not split less than 2*SIZE byte range. For example, let\'s consider downloading 20MiB file. If SIZE is 10M, aria2 can split file into 2 range [0-10MiB) and [10MiB-20MiB) and download it using 2 sources(if --split >= 2, of course). If SIZE is 15M, since 2*15M > 20MiB, aria2 does not split file and download it using 1 source. You can append K or M (1K = 1024, 1M = 1024K). Possible Values: 1M-1024M.', + 'options.netrc-path.name': '.netrc Path', + 'options.netrc-path.description': '', + 'options.no-netrc.name': 'Disable netrc', + 'options.no-netrc.description': '', + 'options.no-proxy.name': 'No Proxy List', + 'options.no-proxy.description': 'Specify a comma separated list of host names, domains and network addresses with or without a subnet mask where no proxy should be used.', + 'options.proxy-method.name': 'Proxy Method', + 'options.proxy-method.description': 'Set the method to use in proxy request. METHOD is either get or tunnel. HTTPS downloads always use tunnel regardless of this option.', + 'options.remote-time.name': 'Remote File Timestamp', + 'options.remote-time.description': 'Retrieve timestamp of the remote file from the remote HTTP/FTP server and if it is available, apply it to the local file.', + 'options.reuse-uri.name': 'Reuse Uri', + 'options.reuse-uri.description': 'Reuse already used URIs if no unused URIs are left.', + 'options.retry-wait.name': 'Retry Wait', + 'options.retry-wait.description': 'Set the seconds to wait between retries. When SEC > 0, aria2 will retry downloads when the HTTP server returns a 503 response. ', + 'options.server-stat-of.name': 'Server Stat Output', + 'options.server-stat-of.description': 'Specify the file name to which performance profile of the servers is saved. You can load saved data using --server-stat-if option.', + 'options.server-stat-timeout.name': 'Server Stat Timeout', + 'options.server-stat-timeout.description': 'Specifies timeout in seconds to invalidate performance profile of the servers since the last contact to them.', + 'options.split.name': 'Split Count', + 'options.split.description': 'Download a file using N connections. If more than N URIs are given, first N URIs are used and remaining URIs are used for backup. If less than N URIs are given, those URIs are used more than once so that N connections total are made simultaneously. The number of connections to the same host is restricted by the --max-connection-per-server option. See also the --min-split-size option.', + 'options.stream-piece-selector.name': 'Piece Selection Algorithm', + 'options.stream-piece-selector.description': 'Specify piece selection algorithm used in HTTP/FTP download. Piece means fixed length segment which is downloaded in parallel in segmented download. If default is given, aria2 selects piece so that it reduces the number of establishing connection. This is reasonable default behavior because establishing connection is an expensive operation. If inorder is given, aria2 selects piece which has minimum index. Index=0 means first of the file. This will be useful to view movie while downloading it. --enable-http-pipelining option may be useful to reduce re-connection overhead. Please note that aria2 honors --min-split-size option, so it will be necessary to specify a reasonable value to --min-split-size option. If random is given, aria2 selects piece randomly. Like inorder, --min-split-size option is honored. If geom is given, at the beginning aria2 selects piece which has minimum index like inorder, but it exponentially increasingly keeps space from previously selected piece. This will reduce the number of establishing connection and at the same time it will download the beginning part of the file first. This will be useful to view movie while downloading it.', + 'options.timeout.name': 'Timeout', + 'options.timeout.description': '', + 'options.uri-selector.name': 'URI Selection Algorithm', + 'options.uri-selector.description': 'Specify URI selection algorithm. The possible values are inorder, feedback and adaptive. If inorder is given, URI is tried in the order appeared in the URI list. If feedback is given, aria2 uses download speed observed in the previous downloads and choose fastest server in the URI list. This also effectively skips dead mirrors. The observed download speed is a part of performance profile of servers mentioned in --server-stat-of and --server-stat-if options. If adaptive is given, selects one of the best mirrors for the first and reserved connections. For supplementary ones, it returns mirrors which has not been tested yet, and if each of them has already been tested, returns mirrors which has to be tested again. Otherwise, it doesn\'t select anymore mirrors. Like feedback, it uses a performance profile of servers.', + 'options.check-certificate.name': 'Check Certificate', + 'options.check-certificate.description': '', + 'options.http-accept-gzip.name': 'Accept GZip', + 'options.http-accept-gzip.description': 'Send Accept: deflate, gzip request header and inflate response if remote server responds with Content-Encoding: gzip or Content-Encoding: deflate.', + 'options.http-auth-challenge.name': 'HTTP Auth Challenge', + 'options.http-auth-challenge.description': 'Send HTTP authorization header only when it is requested by the server. If false is set, then authorization header is always sent to the server. There is an exception: if user name and password are embedded in URI, authorization header is always sent to the server regardless of this option.', + 'options.http-no-cache.name': 'No Cache', + 'options.http-no-cache.description': 'Send Cache-Control: no-cache and Pragma: no-cache header to avoid cached content. If false is given, these headers are not sent and you can add Cache-Control header with a directive you like using --header option.', + 'options.http-user.name': 'HTTP Default User Name', + 'options.http-user.description': '', + 'options.http-passwd.name': 'HTTP Default Password', + 'options.http-passwd.description': '', + 'options.http-proxy.name': 'HTTP Proxy Server', + 'options.http-proxy.description': '', + 'options.http-proxy-user.name': 'HTTP Proxy User Name', + 'options.http-proxy-user.description': '', + 'options.http-proxy-passwd.name': 'HTTP Proxy Password', + 'options.http-proxy-passwd.description': '', + 'options.https-proxy.name': 'HTTPS Proxy Server', + 'options.https-proxy.description': '', + 'options.https-proxy-user.name': 'HTTPS Proxy User Name', + 'options.https-proxy-user.description': '', + 'options.https-proxy-passwd.name': 'HTTPS Proxy Password', + 'options.https-proxy-passwd.description': '', + 'options.referer.name': 'Referer', + 'options.referer.description': 'Set an http referrer (Referer). This affects all http/https downloads. If * is given, the download URI is also used as the referrer. This may be useful when used together with the --parameterized-uri option.', + 'options.enable-http-keep-alive.name': 'Enable Persistent Connection', + 'options.enable-http-keep-alive.description': 'Enable HTTP/1.1 persistent connection.', + 'options.enable-http-pipelining.name': 'Enable HTTP Pipelining', + 'options.enable-http-pipelining.description': 'Enable HTTP/1.1 pipelining.', + 'options.header.name': 'Custom Header', + 'options.header.description': 'Append HEADER to HTTP request header.', + 'options.save-cookies.name': 'Cookies Path', + 'options.save-cookies.description': 'Save Cookies to FILE in Mozilla/Firefox(1.x/2.x)/ Netscape format. If FILE already exists, it is overwritten. Session Cookies are also saved and their expiry values are treated as 0.', + 'options.use-head.name': 'Use HEAD Method', + 'options.use-head.description': 'Use HEAD method for the first request to the HTTP server.', + 'options.user-agent.name': 'Custom User Agent', + 'options.user-agent.description': '', + 'options.ftp-user.name': 'FTP Default User Name', + 'options.ftp-user.description': '', + 'options.ftp-passwd.name': 'FTP Default Password', + 'options.ftp-passwd.description': 'If user name is embedded but password is missing in URI, aria2 tries to resolve password using .netrc. If password is found in .netrc, then use it as password. If not, use the password specified in this option.', + 'options.ftp-pasv.name': 'Passive Mode', + 'options.ftp-pasv.description': 'Use the passive mode in FTP. If false is given, the active mode will be used. This option is ignored for SFTP transfer.', + 'options.ftp-proxy.name': 'FTP Proxy Server', + 'options.ftp-proxy.description': '', + 'options.ftp-proxy-user.name': 'FTP Proxy User Name', + 'options.ftp-proxy-user.description': '', + 'options.ftp-proxy-passwd.name': 'FTP Proxy Password', + 'options.ftp-proxy-passwd.description': '', + 'options.ftp-type.name': 'Transfer Type', + 'options.ftp-type.description': '', + 'options.ftp-reuse-connection.name': 'Reuse Connection', + 'options.ftp-reuse-connection.description': '', + 'options.ssh-host-key-md.name': 'SSH Public Key Checksum', + 'options.ssh-host-key-md.description': 'Set checksum for SSH host public key. TYPE is hash type. The supported hash type is sha-1 or md5. DIGEST is hex digest. For example: sha-1=b030503d4de4539dc7885e6f0f5e256704edf4c3. This option can be used to validate server\'s public key when SFTP is used. If this option is not set, which is default, no validation takes place.', + 'options.bt-detach-seed-only.name': '', + 'options.bt-detach-seed-only.description': '', + 'options.bt-enable-hook-after-hash-check.name': '', + 'options.bt-enable-hook-after-hash-check.description': '', + 'options.bt-enable-lpd.name': '', + 'options.bt-enable-lpd.description': '', + 'options.bt-exclude-tracker.name': '', + 'options.bt-exclude-tracker.description': '', + 'options.bt-external-ip.name': '', + 'options.bt-external-ip.description': '', + 'options.bt-force-encryption.name': '', + 'options.bt-force-encryption.description': '', + 'options.bt-hash-check-seed.name': '', + 'options.bt-hash-check-seed.description': '', + 'options.bt-max-open-files.name': '', + 'options.bt-max-open-files.description': '', + 'options.bt-max-peers.name': '', + 'options.bt-max-peers.description': '', + 'options.bt-metadata-only.name': '', + 'options.bt-metadata-only.description': '', + 'options.bt-min-crypto-level.name': '', + 'options.bt-min-crypto-level.description': '', + 'options.bt-prioritize-piece.name': '', + 'options.bt-prioritize-piece.description': '', + 'options.bt-remove-unselected-file.name': '', + 'options.bt-remove-unselected-file.description': '', + 'options.bt-require-crypto.name': '', + 'options.bt-require-crypto.description': '', + 'options.bt-request-peer-speed-limit.name': '', + 'options.bt-request-peer-speed-limit.description': '', + 'options.bt-save-metadata.name': '', + 'options.bt-save-metadata.description': '', + 'options.bt-seed-unverified.name': '', + 'options.bt-seed-unverified.description': '', + 'options.bt-stop-timeout.name': '', + 'options.bt-stop-timeout.description': '', + 'options.bt-tracker.name': '', + 'options.bt-tracker.description': '', + 'options.bt-tracker-connect-timeout.name': '', + 'options.bt-tracker-connect-timeout.description': '', + 'options.bt-tracker-interval.name': '', + 'options.bt-tracker-interval.description': '', + 'options.bt-tracker-timeout.name': '', + 'options.bt-tracker-timeout.description': '', + 'options.dht-file-path.name': '', + 'options.dht-file-path.description': '', + 'options.dht-file-path6.name': '', + 'options.dht-file-path6.description': '', + 'options.dht-listen-port.name': '', + 'options.dht-listen-port.description': '', + 'options.dht-message-timeout.name': '', + 'options.dht-message-timeout.description': '', + 'options.enable-dht.name': '', + 'options.enable-dht.description': '', + 'options.enable-dht6.name': '', + 'options.enable-dht6.description': '', + 'options.enable-peer-exchange.name': '', + 'options.enable-peer-exchange.description': '', + 'options.follow-torrent.name': '', + 'options.follow-torrent.description': '', + 'options.listen-port.name': '', + 'options.listen-port.description': '', + 'options.max-overall-upload-limit.name': '', + 'options.max-overall-upload-limit.description': '', + 'options.max-upload-limit.name': '', + 'options.max-upload-limit.description': '', + 'options.peer-id-prefix.name': '', + 'options.peer-id-prefix.description': '', + 'options.seed-ratio.name': '', + 'options.seed-ratio.description': '', + 'options.seed-time.name': '', + 'options.seed-time.description': '', + 'options.follow-metalink.name': '', + 'options.follow-metalink.description': '', + 'options.metalink-base-uri.name': '', + 'options.metalink-base-uri.description': '', + 'options.metalink-language.name': '', + 'options.metalink-language.description': '', + 'options.metalink-location.name': '', + 'options.metalink-location.description': '', + 'options.metalink-os.name': '', + 'options.metalink-os.description': '', + 'options.metalink-version.name': '', + 'options.metalink-version.description': '', + 'options.metalink-preferred-protocol.name': '', + 'options.metalink-preferred-protocol.description': '', + 'options.metalink-enable-unique-protocol.name': '', + 'options.metalink-enable-unique-protocol.description': '', + 'options.enable-rpc.name': 'Enable JSON-RPC/XML-RPC Server', + 'options.enable-rpc.description': '', + 'options.pause-metadata.name': 'Pause After Metadata Downloaded', + 'options.pause-metadata.description': 'Pause downloads created as a result of metadata download. There are 3 types of metadata downloads in aria2: (1) downloading .torrent file. (2) downloading torrent metadata using magnet link. (3) downloading metalink file. These metadata downloads will generate downloads using their metadata. This option pauses these subsequent downloads. This option is effective only when --enable-rpc=true is given.', + 'options.rpc-allow-origin-all.name': 'Allow All Origin Request', + 'options.rpc-allow-origin-all.description': 'Add Access-Control-Allow-Origin header field with value * to the RPC response.', + 'options.rpc-listen-all.name': 'Listen on All Network Interfaces', + 'options.rpc-listen-all.description': 'Listen incoming JSON-RPC/XML-RPC requests on all network interfaces. If false is given, listen only on local loopback interface.', + 'options.rpc-listen-port.name': 'Listen Port', + 'options.rpc-listen-port.description': '', + 'options.rpc-max-request-size.name': 'Max Request Size', + 'options.rpc-max-request-size.description': 'Set max size of JSON-RPC/XML-RPC request. If aria2 detects the request is more than SIZE bytes, it drops connection.', + 'options.rpc-save-upload-metadata.name': 'Save Upload Metadata', + 'options.rpc-save-upload-metadata.description': 'Save the uploaded torrent or metalink meta data in the directory specified by --dir option. The file name consists of SHA-1 hash hex string of meta data plus extension. For torrent, the extension is \'.torrent\'. For metalink, it is \'.meta4\'. If false is given to this option, the downloads added by aria2.addTorrent() or aria2.addMetalink() will not be saved by --save-session option.', + 'options.rpc-secure.name': 'Enable SSL/TLS', + 'options.rpc-secure.description': 'RPC transport will be encrypted by SSL/TLS. The RPC clients must use https scheme to access the server. For WebSocket client, use wss scheme. Use --rpc-certificate and --rpc-private-key options to specify the server certificate and private key.', + 'options.allow-overwrite.name': '', + 'options.allow-overwrite.description': '', + 'options.allow-piece-length-change.name': '', + 'options.allow-piece-length-change.description': '', + 'options.always-resume.name': '', + 'options.always-resume.description': '', + 'options.async-dns.name': '', + 'options.async-dns.description': '', + 'options.auto-file-renaming.name': '', + 'options.auto-file-renaming.description': '', + 'options.auto-save-interval.name': '', + 'options.auto-save-interval.description': '', + 'options.conditional-get.name': '', + 'options.conditional-get.description': '', + 'options.conf-path.name': '', + 'options.conf-path.description': '', + 'options.console-log-level.name': '', + 'options.console-log-level.description': '', + 'options.daemon.name': '', + 'options.daemon.description': '', + 'options.deferred-input.name': '', + 'options.deferred-input.description': '', + 'options.disable-ipv6.name': '', + 'options.disable-ipv6.description': '', + 'options.disk-cache.name': '', + 'options.disk-cache.description': '', + 'options.download-result.name': '', + 'options.download-result.description': '', + 'options.dscp.name': '', + 'options.dscp.description': '', + 'options.rlimit-nofile.name': '', + 'options.rlimit-nofile.description': '', + 'options.enable-color.name': '', + 'options.enable-color.description': '', + 'options.enable-mmap.name': '', + 'options.enable-mmap.description': '', + 'options.event-poll.name': '', + 'options.event-poll.description': '', + 'options.file-allocation.name': '', + 'options.file-allocation.description': '', + 'options.force-save.name': '', + 'options.force-save.description': '', + 'options.hash-check-only.name': '', + 'options.hash-check-only.description': '', + 'options.human-readable.name': '', + 'options.human-readable.description': '', + 'options.max-download-result.name': '', + 'options.max-download-result.description': '', + 'options.max-mmap-limit.name': '', + 'options.max-mmap-limit.description': '', + 'options.max-resume-failure-tries.name': '', + 'options.max-resume-failure-tries.description': '', + 'options.min-tls-version.name': '', + 'options.min-tls-version.description': '', + 'options.log-level.name': '', + 'options.log-level.description': '', + 'options.piece-length.name': '', + 'options.piece-length.description': '', + 'options.optimize-concurrent-downloads.name': '', + 'options.optimize-concurrent-downloads.description': '', + 'options.show-console-readout.name': '', + 'options.show-console-readout.description': '', + 'options.summary-interval.name': '', + 'options.summary-interval.description': '', + 'options.max-overall-download-limit.name': '', + 'options.max-overall-download-limit.description': '', + 'options.max-download-limit.name': '', + 'options.max-download-limit.description': '', + 'options.no-conf.name': '', + 'options.no-conf.description': '', + 'options.no-file-allocation-limit.name': '', + 'options.no-file-allocation-limit.description': '', + 'options.parameterized-uri.name': '', + 'options.parameterized-uri.description': '', + 'options.quiet.name': '', + 'options.quiet.description': '', + 'options.realtime-chunk-checksum.name': '', + 'options.realtime-chunk-checksum.description': '', + 'options.remove-control-file.name': '', + 'options.remove-control-file.description': '', + 'options.save-session.name': '', + 'options.save-session.description': '', + 'options.save-session-interval.name': '', + 'options.save-session-interval.description': '', + 'options.socket-recv-buffer-size.name': '', + 'options.socket-recv-buffer-size.description': '', + 'options.stop.name': '', + 'options.stop.description': '', + 'options.truncate-console-readout.name': '', + 'options.truncate-console-readout.description': '' }); }]) })(); diff --git a/app/scripts/core/router.js b/app/scripts/core/router.js index c7d7306..7726715 100644 --- a/app/scripts/core/router.js +++ b/app/scripts/core/router.js @@ -39,10 +39,6 @@ templateUrl: 'views/settings-aria2.html', controller: 'Aria2SettingsController' }) - .when('/settings/aria2/bt-metalink', { - templateUrl: 'views/settings-aria2.html', - controller: 'Aria2SettingsController' - }) .when('/settings/aria2/bt', { templateUrl: 'views/settings-aria2.html', controller: 'Aria2SettingsController' diff --git a/app/scripts/core/utils.js b/app/scripts/core/utils.js index 9722b9f..a5cc08b 100644 --- a/app/scripts/core/utils.js +++ b/app/scripts/core/utils.js @@ -1,7 +1,7 @@ (function () { 'use strict'; - angular.module('ariaNg').factory('utils', ['$location', '$timeout', '$base64', 'SweetAlert', 'translateFilter', 'ariaNgConstants', function ($location, $timeout, $base64, SweetAlert, translateFilter, ariaNgConstants) { + angular.module('ariaNg').factory('utils', ['$location', '$timeout', '$base64', 'SweetAlert', 'translateFilter', 'ariaNgConstants', 'aria2AllOptions', function ($location, $timeout, $base64, SweetAlert, translateFilter, ariaNgConstants, aria2AllOptions) { var calculateDownloadRemainTime = function (remainBytes, downloadSpeed) { if (downloadSpeed == 0) { return 0; @@ -42,6 +42,30 @@ return true; }, + copyObjectTo: function (from, to) { + if (!to) { + return from; + } + + for (var name in from) { + if (!from.hasOwnProperty(name)) { + continue; + } + + var fromValue = from[name]; + var toValue = to[name]; + + if (angular.isObject(fromValue) || angular.isArray(fromValue)) { + to[name] = this.copyObjectTo(from[name], to[name]); + } else { + if (fromValue != toValue) { + to[name] = fromValue; + } + } + } + + return to; + }, getFileNameFromPath: function (path) { if (!path) { return path; @@ -55,6 +79,47 @@ return path.substring(index + 1); }, + isUrlMatchUrl2: function (url, url2) { + if (url === url2) { + return true; + } + + var index = url2.indexOf(url); + + if (index !== 0) { + return false; + } + + var lastPart = url2.substring(url.length); + + if (lastPart.indexOf('/') == 0) { + return true; + } + + return false; + }, + getOptions: function (keys) { + var options = []; + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var option = aria2AllOptions[key]; + + if (!option) { + continue; + } + + option = angular.extend({ + key: key, + nameKey: 'options.' + key + '.name', + descriptionKey: 'options.' + key + '.description' + }, option); + + options.push(option); + } + + return options; + }, getTaskName: function (task) { var taskName = ""; @@ -105,49 +170,6 @@ return task; }, - copyObjectTo: function (from, to) { - if (!to) { - return from; - } - - for (var name in from) { - if (!from.hasOwnProperty(name)) { - continue; - } - - var fromValue = from[name]; - var toValue = to[name]; - - if (angular.isObject(fromValue) || angular.isArray(fromValue)) { - to[name] = this.copyObjectTo(from[name], to[name]); - } else { - if (fromValue != toValue) { - to[name] = fromValue; - } - } - } - - return to; - }, - isUrlMatchUrl2: function (url, url2) { - if (url === url2) { - return true; - } - - var index = url2.indexOf(url); - - if (index !== 0) { - return false; - } - - var lastPart = url2.substring(url.length); - - if (lastPart.indexOf('/') == 0) { - return true; - } - - return false; - }, parseOrderType: function (value) { var values = value.split(':'); diff --git a/app/styles/aria-ng.css b/app/styles/aria-ng.css index dc54ca7..4c2929a 100644 --- a/app/styles/aria-ng.css +++ b/app/styles/aria-ng.css @@ -283,6 +283,10 @@ td { background-color: #fff; } +.skin-aria-ng .content-wrapper .form-control[type='text'] { + padding-left: 14px; +} + @media screen and (max-width: 767px) { .skin-aria-ng .content-wrapper .content { margin-top: 5px; diff --git a/app/views/settings-aria2.html b/app/views/settings-aria2.html index 25550f2..19e45b7 100644 --- a/app/views/settings-aria2.html +++ b/app/views/settings-aria2.html @@ -2,11 +2,11 @@
    - + + title="{{option.descriptionKey | translate}}" + ng-if="(option.descriptionKey | translate) != ''">