diff options
author | Xingwang Liao <kuoruan@gmail.com> | 2019-03-29 17:09:37 +0800 |
---|---|---|
committer | Xingwang Liao <kuoruan@gmail.com> | 2019-07-01 14:28:54 +0800 |
commit | f90de782a758ad1c702e2ae9403e415d8592eac5 (patch) | |
tree | 0412c837b306840342f9aff8f85b3c33c2c9cb14 /applications/luci-app-aria2/luasrc/view/aria2/log_template.htm | |
parent | 9a979e6db5de1c268dfd35099e58187439919df9 (diff) |
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 <kuoruan@gmail.com>
Diffstat (limited to 'applications/luci-app-aria2/luasrc/view/aria2/log_template.htm')
-rw-r--r-- | applications/luci-app-aria2/luasrc/view/aria2/log_template.htm | 55 |
1 files changed, 55 insertions, 0 deletions
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 <kuoruan@gmail.com> + 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%> + +<script type="text/javascript" src="<%=resource%>/cbi.js"></script> +<script type="text/javascript">//<![CDATA[ + XHR.poll(10, '<%=url("admin/services/aria2/log/read")%>', null, + function(x, data) { + var logElm = document.getElementById('log_text'); + if (logElm) { + logElm.innerHTML = data + ? String.format( + '<pre>%s%s%s%s</pre>', + '<span class="description"><%:Last 50 lines of log file:%></span><br/><br/>', + data.log || '<%:No log data.%>', + '<br/><br/><span class="description"><%:Last 50 lines of syslog:%></span><br/><br/>', + data.syslog || '<%:No log data.%>' + ) + : '<strong><%:Failed to load log data.%></strong>'; + } + } + ); +//]]></script> +<div class="cbi-map"> + <h2 name="content"><%:Aria2%> - <%:Log Data%></h2> + <fieldset class="cbi-section"> + <div id="log_text"> + <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> + <%:Collecting data...%> + </div> + <div style="text-align:right"><small><%:Refresh every 10 seconds.%></small></div> + </fieldset> +</div> + +<%+footer%> |