luci: optimize node list page load

This commit is contained in:
lwb1978 2025-03-07 23:23:16 +08:00 committed by xiaorouji
parent 1de410fc94
commit 6c7d34d860

View File

@ -313,6 +313,7 @@ table td, .table .td {
}
/* 自动Ping */
function pingAllNodes() {
if (auto_detection_time == "icmp" || auto_detection_time == "tcping") {
var nodes = [];
const ping_value = document.getElementsByClassName(auto_detection_time == "tcping" ? 'tcping_value' : 'ping_value');
@ -391,6 +392,7 @@ table td, .table .td {
thread()
}
}
}
var edit_btn = document.getElementById("cbi-passwall2-nodes").getElementsByClassName("cbi-button cbi-button-edit");
for (var i = 0; i < edit_btn.length; i++) {
@ -445,6 +447,14 @@ table td, .table .td {
}
document.getElementById("div_node_count").innerHTML = "<div style='margin-top:5px'>" + str + "</div>";
}
//UI渲染完成后再自动Ping
window.onload = function () {
setTimeout(function () {
pingAllNodes();
}, 800);
};
//]]>
</script>