mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Refresh page when anonymize is clicked
This commit is contained in:
parent
3183a1c2f4
commit
360a24b215
1 changed files with 10 additions and 4 deletions
|
@ -36,10 +36,15 @@
|
|||
<script type="text/javascript" src="<%=resource%>/cbi.js?v=git-18.120.38690-2678b12"></script>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var anonymize = false;
|
||||
function getCookieValue(a) {
|
||||
var b = document.cookie.match('(^|;)\\s*' + a + '\\s*=\\s*([^;]+)');
|
||||
return b ? b.pop() : '';
|
||||
}
|
||||
XHR.poll(20, '/cgi-bin/luci/admin/system/openmptcprouter/interfaces_status', null,
|
||||
function(x, mArray)
|
||||
{
|
||||
if (anonymize)
|
||||
anonymize=getCookieValue("anonymize");
|
||||
if (anonymize == "true")
|
||||
{
|
||||
mArray.openmptcprouter.wan_addr=replaceLastNChars(mArray.openmptcprouter.wan_addr,"x",6);
|
||||
mArray.openmptcprouter.wan_addr6=replaceLastNChars(mArray.openmptcprouter.wan_addr6,"x",10);
|
||||
|
@ -449,9 +454,10 @@
|
|||
return colour;
|
||||
}
|
||||
|
||||
function setAnonymize()
|
||||
function setAnonymize(data)
|
||||
{
|
||||
anonymize=true;
|
||||
document.cookie="anonymize=" + data.checked + "; path=/cgi-bin/luci/";
|
||||
location.reload();
|
||||
}
|
||||
|
||||
var replaceLastNChars = function(str, replace, num) {
|
||||
|
@ -472,7 +478,7 @@
|
|||
<div class="cbi-value">
|
||||
<label class="cbi-value-title">Anonymize public IPs (at next refresh)</label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="checkbox" name="anon" class="cbi-input-checkbox" value="1" onclick="setAnonymize()" \>
|
||||
<input type="checkbox" name="anon" class="cbi-input-checkbox" value="1" onclick="setAnonymize(this)" \>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue