From f90de782a758ad1c702e2ae9403e415d8592eac5 Mon Sep 17 00:00:00 2001 From: Xingwang Liao Date: Fri, 29 Mar 2019 17:09:37 +0800 Subject: luci-app-aria2: Refactor, new views and more options This commit contains: * Refactor package code. * Add options for RPC, HTTP/HTTPS and BT. * Improve descriptions for some options. * New views for config files and log files. * Also updated translation for simplified Chinese. Signed-off-by: Xingwang Liao --- .../luasrc/view/aria2/log_template.htm | 55 ++++++++++ .../luasrc/view/aria2/overview_status.htm | 84 --------------- .../luasrc/view/aria2/settings_header.htm | 116 +++++++++++++++++++++ .../luasrc/view/aria2/value_with_btn.htm | 22 ++++ 4 files changed, 193 insertions(+), 84 deletions(-) create mode 100644 applications/luci-app-aria2/luasrc/view/aria2/log_template.htm delete mode 100644 applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm create mode 100644 applications/luci-app-aria2/luasrc/view/aria2/settings_header.htm create mode 100644 applications/luci-app-aria2/luasrc/view/aria2/value_with_btn.htm (limited to 'applications/luci-app-aria2/luasrc/view') diff --git a/applications/luci-app-aria2/luasrc/view/aria2/log_template.htm b/applications/luci-app-aria2/luasrc/view/aria2/log_template.htm new file mode 100644 index 0000000000..ed91168dbc --- /dev/null +++ b/applications/luci-app-aria2/luasrc/view/aria2/log_template.htm @@ -0,0 +1,55 @@ +<%# + Copyright 2017-2019 Xingwang Liao + Licensed to the public under the MIT License. +-%> + +<% css = [[ + + #log_text { + padding: 10px; + text-align: left; + } + #log_text pre { + word-break: break-all; + margin: 0; + } + .description { + background-color: #33ccff; + } + +]] +-%> + +<%+header%> + + + +
+

<%:Aria2%> - <%:Log Data%>

+
+
+ <%:Loading%> + <%:Collecting data...%> +
+
<%:Refresh every 10 seconds.%>
+
+
+ +<%+footer%> diff --git a/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm b/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm deleted file mode 100644 index 9d9ffeeac6..0000000000 --- a/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm +++ /dev/null @@ -1,84 +0,0 @@ - - -
- <%:Aria2 Status%> -

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

-
diff --git a/applications/luci-app-aria2/luasrc/view/aria2/settings_header.htm b/applications/luci-app-aria2/luasrc/view/aria2/settings_header.htm new file mode 100644 index 0000000000..b71690fb69 --- /dev/null +++ b/applications/luci-app-aria2/luasrc/view/aria2/settings_header.htm @@ -0,0 +1,116 @@ +<%# + Copyright 2017-2019 Xingwang Liao + Licensed to the public under the MIT License. +-%> + +<% + local ipkg = require "luci.model.ipkg" + local has_ui = false + + local uilist = { + supported = { + ["ariang"] = "AriaNg", + ["webui-aria2"] = "WebUI-Aria2", + ["yaaw"] = "YAAW" + }, + installed = {} + } + + for k in pairs(uilist.supported) do + if ipkg.installed(k) then + uilist.installed[#uilist.installed + 1] = k + has_ui = true + end + end +%> + +
+

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

+ <% if has_ui then %> +

+ <%:Installed web interface: %> + <%- for _, v in pairs(uilist.installed) do %> + + <%- end %> +

+ <% end %> +

+ + diff --git a/applications/luci-app-aria2/luasrc/view/aria2/value_with_btn.htm b/applications/luci-app-aria2/luasrc/view/aria2/value_with_btn.htm new file mode 100644 index 0000000000..487e107b6d --- /dev/null +++ b/applications/luci-app-aria2/luasrc/view/aria2/value_with_btn.htm @@ -0,0 +1,22 @@ +<%# + Copyright 2017-2019 Xingwang Liao + Licensed to the public under the MIT License. +-%> + +<%+cbi/valueheader%> + /> + <%- if self.btntext then -%> +
><%=self.btntext%>
+ <% end %> +<%+cbi/valuefooter%> -- cgit v1.2.3