2 Copyright 2017 Dirk Brenken (dev@brenken.org)
3 This is free software, licensed under the Apache License, Version 2.0
8 <script type="text/javascript" src="<%=resource%>/cbi.js"></script>
9 <script type="text/javascript">
11 var stxhr = new XHR();
13 function update_status(data)
15 var domain = data.value;
16 var input = document.getElementById('query_input');
17 var output = document.getElementById('query_output');
22 '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> ' +
23 '<%:Waiting for command to complete...%>'
25 input.parentNode.style.display = 'block';
26 input.style.display = 'inline';
27 stxhr.post('<%=luci.dispatcher.build_url('admin/services/adblock/advanced/result/')%>' + domain, { token: '<%=token%>' },
32 input.style.display = 'none';
33 output.innerHTML = String.format('<pre>%h</pre>', x.responseText);
37 input.style.display = 'none';
38 output.innerHTML = '<span class="error"><%:Invalid domain specified!%></span>';
47 <form method="post" action="<%=REQUEST_URI%>">
49 <fieldset class="cbi-section">
50 <div class="cbi-section-descr"><%:This form allows you to query active block lists for certain domains, e.g. for whitelisting.%></div>
51 <div style="width:33%; float:left;">
52 <input style="margin: 5px 0" type="text" value="www.lede-project.org" name="input" />
53 <input type="button" value="<%:Query%>" class="cbi-button cbi-button-apply" onclick="update_status(this.form.input)" />
55 <br style="clear:both" />
59 <fieldset class="cbi-section" style="display:none">
60 <legend id="query_input"><%:Collecting data...%></legend>
61 <span id="query_output"></span>