mirror of
https://github.com/bolucat/Archive.git
synced 2025-12-24 13:28:37 +08:00
Update On Wed Nov 12 19:37:33 CET 2025
This commit is contained in:
@@ -134,10 +134,10 @@ local api = require "luci.passwall2.api"
|
||||
setTimeout(function () {
|
||||
if (confirm("<%: Are you sure you want to restore the client to default settings?%>")) {
|
||||
var xhr1 = new XMLHttpRequest();
|
||||
xhr1.open("GET",'<%= api.url("clear_log") %>', true);
|
||||
xhr1.open("GET",'<%= api.url("clear_log") %>', false);
|
||||
xhr1.send();
|
||||
var xhr2 = new XMLHttpRequest();
|
||||
xhr2.open("GET",'<%= api.url("reset_config") %>', true);
|
||||
xhr2.open("GET",'<%= api.url("reset_config") %>', false);
|
||||
xhr2.send();
|
||||
window.location.href = '<%= api.url("log") %>'
|
||||
}
|
||||
|
||||
@@ -659,6 +659,21 @@ table td, .table .td {
|
||||
cbi_t_switch("passwall2.nodes", default_group)
|
||||
}
|
||||
|
||||
//clear expire data
|
||||
if (localStorage && localStorage.length > 0) {
|
||||
const now = Date.now();
|
||||
for (let i = 0; i < localStorage.length; i++) {
|
||||
let key = localStorage.key(i);
|
||||
if (key && (key.startsWith("icmp") || key.startsWith("tcping"))) {
|
||||
let value_str = localStorage.getItem(key);
|
||||
const value = JSON.parse(value_str);
|
||||
if (!(value && value.savetime && (now - value.timestamp) < value.savetime)) {
|
||||
localStorage.removeItem(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get_now_use_node();
|
||||
|
||||
pingAllNodes();
|
||||
|
||||
Reference in New Issue
Block a user