From a4c8c206477b1c8d4fb60dcb73d777c9c9183e81 Mon Sep 17 00:00:00 2001 From: Hsing-Wang Liao Date: Mon, 19 Sep 2016 10:20:36 +0800 Subject: luci-app-aria2: fix bugs and add log option * Fix unable save authentication method; * Use luci.dispatcher.build_url(...) to support Chaos Calmer; * Add log file and log level options; * Rename files. Signed-off-by: Hsing-Wang Liao --- .../luci-app-aria2/luasrc/model/cbi/aria2.lua | 21 +++++- .../luasrc/view/aria2/overview_status.htm | 77 ++++++++++++++++++++++ .../luasrc/view/aria2/web_script.htm | 77 ---------------------- 3 files changed, 95 insertions(+), 80 deletions(-) create mode 100644 applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm delete mode 100644 applications/luci-app-aria2/luasrc/view/aria2/web_script.htm (limited to 'applications/luci-app-aria2/luasrc') diff --git a/applications/luci-app-aria2/luasrc/model/cbi/aria2.lua b/applications/luci-app-aria2/luasrc/model/cbi/aria2.lua index 780aea33de..f713ad5beb 100644 --- a/applications/luci-app-aria2/luasrc/model/cbi/aria2.lua +++ b/applications/luci-app-aria2/luasrc/model/cbi/aria2.lua @@ -80,19 +80,32 @@ o.rmempty = false o = s:taboption("general", Value, "rpc_passwd", translate("RPC password")) o:depends("rpc_auth_method", "user_pass") o.password = true -o.rmempty = false +o.rmempty = true o = s:taboption("general", Value, "rpc_secret", translate("RPC Token"), "
" .. cfgbtn) o:depends("rpc_auth_method", "token") -o.rmempty = false +o.rmempty = true o = s:taboption("file", Value, "config_dir", translate("Config file directory")) o.placeholder = "/var/etc/aria2" +o = s:taboption("file", Flag, "enable_log", translate("Enable log"), translate("Log file is in the config file dir.")) +o.enabled = "true" +o.disabled = "false" + +o = s:taboption("file", ListValue, "log_level", translate("Log level")) +o:depends("enable_log", "true") +o:value("debug", translate("Debug")) +o:value("info", translate("Info")) +o:value("notice", translate("Notice")) +o:value("warn", translate("Warn")) +o:value("error", translate("Error")) + o = s:taboption("file", Value, "dir", translate("Default download directory")) o.rmempty = false -s:taboption("file", Value, "disk_cache", translate("Disk cache"), translate("in bytes, You can append K or M.")) +o = s:taboption("file", Value, "disk_cache", translate("Disk cache"), translate("in bytes, You can append K or M.")) +o.rmempty = true o = s:taboption("file", ListValue, "file_allocation", translate("Preallocation"), translate("\"Falloc\" is not available in all cases.")) o:value("none", translate("Off")) @@ -101,6 +114,7 @@ o:value("trunc", translate("Trunc")) o:value("falloc", translate("Falloc")) overall_speed_limit = s:taboption("task", Flag, "overall_speed_limit", translate("Overall speed limit enabled")) +overall_speed_limit.rmempty = true o = s:taboption("task", Value, "max_overall_download_limit", translate("Overall download limit"), translate("in bytes/sec, You can append K or M.")) o:depends("overall_speed_limit", "1") @@ -109,6 +123,7 @@ o = s:taboption("task", Value, "max_overall_upload_limit", translate("Overall up o:depends("overall_speed_limit", "1") task_speed_limit = s:taboption("task", Flag, "task_speed_limit", translate("Per task speed limit enabled")) +task_speed_limit.rmempty = true o = s:taboption("task", Value, "max_download_limit", translate("Per task download limit"), translate("in bytes/sec, You can append K or M.")) o:depends("task_speed_limit", "1") diff --git a/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm b/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm new file mode 100644 index 0000000000..b14cca228f --- /dev/null +++ b/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm @@ -0,0 +1,77 @@ + + +
+ <%:Aria2 Status%> +

+ <%:Collecting data...%> +

+
diff --git a/applications/luci-app-aria2/luasrc/view/aria2/web_script.htm b/applications/luci-app-aria2/luasrc/view/aria2/web_script.htm deleted file mode 100644 index 933c6af702..0000000000 --- a/applications/luci-app-aria2/luasrc/view/aria2/web_script.htm +++ /dev/null @@ -1,77 +0,0 @@ - - -
- <%:Aria2 Status%> -

- <%:Collecting data...%> -

-
-- cgit v1.2.3