diff options
author | Dirk Brenken <dev@brenken.org> | 2017-03-25 21:58:51 +0100 |
---|---|---|
committer | Dirk Brenken <dev@brenken.org> | 2017-03-26 08:49:02 +0200 |
commit | 1bc3833e6876c9e2796fb7ec1ad2711bc12ef85f (patch) | |
tree | a53dc5e0c88ff78b34f82cfe9cf6682982fda678 /applications/luci-app-adblock/luasrc/view | |
parent | 0ec9636be4e82c22b37fa379bd350ef661a8b5ab (diff) |
luci-app-adblock: major update
* multi-tab navigation
Overview/View Logfile/Advanced
Advanced: Edit Blacklist/Whitelist/Configuration
Query domains
* all adblock options are now configurable via LuCI
Signed-off-by: Dirk Brenken <dev@brenken.org>
Diffstat (limited to 'applications/luci-app-adblock/luasrc/view')
4 files changed, 102 insertions, 0 deletions
diff --git a/applications/luci-app-adblock/luasrc/view/adblock/config_css.htm b/applications/luci-app-adblock/luasrc/view/adblock/config_css.htm new file mode 100644 index 0000000000..53493a18fb --- /dev/null +++ b/applications/luci-app-adblock/luasrc/view/adblock/config_css.htm @@ -0,0 +1,10 @@ +<style type="text/css"> + textarea + { + border: 1px solid #cccccc; + padding: 5px; + font-size: 12px; + font-family: monospace; + resize: none; + } +</style> diff --git a/applications/luci-app-adblock/luasrc/view/adblock/logread.htm b/applications/luci-app-adblock/luasrc/view/adblock/logread.htm new file mode 100644 index 0000000000..4a5585fd2c --- /dev/null +++ b/applications/luci-app-adblock/luasrc/view/adblock/logread.htm @@ -0,0 +1,15 @@ +<%# +Copyright 2016 Hannu Nyman +Copyright 2017 Dirk Brenken (dev@brenken.org) +This is free software, licensed under the Apache License, Version 2.0 +-%> + +<%+header%> + +<div class="cbi-map"> + <fieldset class="cbi-section"> + <div class="cbi-section-descr">This form shows the syslog output, pre-filtered for adblock related messages only.</div> + <textarea id="logread_id" style="width: 100%; height: 450px; border: 1px solid #cccccc; padding: 5px; font-size: 12px; font-family: monospace; resize: none;" readonly="readonly" wrap="off" rows="<%=content:cmatch("\n")+2%>"><%=content:pcdata()%></textarea> + </fieldset> +</div> +<%+footer%> diff --git a/applications/luci-app-adblock/luasrc/view/adblock/query.htm b/applications/luci-app-adblock/luasrc/view/adblock/query.htm new file mode 100644 index 0000000000..841a16b492 --- /dev/null +++ b/applications/luci-app-adblock/luasrc/view/adblock/query.htm @@ -0,0 +1,66 @@ +<%# +Copyright 2016 Hannu Nyman +Copyright 2017 Dirk Brenken (dev@brenken.org) +This is free software, licensed under the Apache License, Version 2.0 +-%> + +<%+header%> + +<script type="text/javascript" src="<%=resource%>/cbi.js"></script> +<script type="text/javascript"> +//<![CDATA[ + var stxhr = new XHR(); + + function update_status(data) + { + var domain = data.value; + var input = document.getElementById('query_input'); + var output = document.getElementById('query_output'); + + if (input && output) + { + output.innerHTML = + '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> ' + + '<%:Waiting for command to complete...%>' + ; + input.parentNode.style.display = 'block'; + input.style.display = 'inline'; + stxhr.post('<%=url('admin/services/adblock/advanced/result/')%>' + domain, { token: '<%=token%>' }, + function(x) + { + if (x.responseText) + { + input.style.display = 'none'; + output.innerHTML = String.format('<pre>%h</pre>', x.responseText); + } + else + { + input.style.display = 'none'; + output.innerHTML = '<span class="error"><%:Invalid domain specified!%></span>'; + } + } + ); + } + } +//]]> +</script> + +<form method="post" action="<%=REQUEST_URI%>"> + <div class="cbi-map"> + <fieldset class="cbi-section"> + <div class="cbi-section-descr">This form allows you to query active block lists for certain domains, e.g. for whitelisting.</div> + <div style="width:33%; float:left;"> + <input style="margin: 5px 0" type="text" value="www.lede-project.org" name="input" /> + <input type="button" value="<%:Query%>" class="cbi-button cbi-button-apply" onclick="update_status(this.form.input)" /> + </div> + <br style="clear:both" /> + <br /> + </fieldset> + </div> + <fieldset class="cbi-section" style="display:none"> + <legend id="query_input"><%:Collecting data...%></legend> + <span id="query_output"></span> + </fieldset> +</form> + +<%+footer%> diff --git a/applications/luci-app-adblock/luasrc/view/adblock/runtime.htm b/applications/luci-app-adblock/luasrc/view/adblock/runtime.htm new file mode 100644 index 0000000000..bb55d233f2 --- /dev/null +++ b/applications/luci-app-adblock/luasrc/view/adblock/runtime.htm @@ -0,0 +1,11 @@ +<%# +Copyright 2016 Hannu Nyman +Copyright 2017 Dirk Brenken (dev@brenken.org) +This is free software, licensed under the Apache License, Version 2.0 +-%> + +<%+cbi/valueheader%> + +<input name="runtime" id="runtime" type="text" class="cbi-input-text" style="border: none; box-shadow: none; background-color: #ffffff; color: #0069d6;" value="<%=self:cfgvalue(section)%>" disabled /> + +<%+cbi/valuefooter%> |