mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-05 01:33:56 +08:00
update 2026-07-16 04:54:23
This commit is contained in:
1 parent
6bc60cfbf2
commit
151daa8c75
42 files changed
+645
-689
No files matched your search
@@ -635,11 +635,15 @@ table td, .table .td {
|
||||
if (cacheData && cacheData.savetime && (now - cacheData.timestamp) < cacheData.savetime) {
|
||||
const a = ping_value[i].firstElementChild;
|
||||
let color = "red";
|
||||
if (cacheData.value < 100)
|
||||
color = "green";
|
||||
else if (cacheData.value < 200)
|
||||
color = "#fb9a05";
|
||||
a.innerText = cacheData.value + " ms";
|
||||
if (cacheData.value >= 0) {
|
||||
a.innerText = cacheData.value + " ms";
|
||||
if (cacheData.value < 100)
|
||||
color = "green";
|
||||
else if (cacheData.value < 200)
|
||||
color = "#fb9a05";
|
||||
} else {
|
||||
a.innerText = "<%:Timeout%>";
|
||||
}
|
||||
a.style.color = color;
|
||||
a.onclick = function () {
|
||||
ping_node(cbi_id, this, auto_detection_time);
|
||||
@@ -679,15 +683,23 @@ table td, .table .td {
|
||||
const cache_data = {
|
||||
dom_id: strs[i],
|
||||
timestamp: Date.now(),
|
||||
savetime: 60 * 1000,
|
||||
savetime: 150 * 1000,
|
||||
value: ping
|
||||
};
|
||||
text = result.ping + " ms";
|
||||
localStorage.setItem(auto_detection_time + ":" + dom.address + ":" + dom.port, JSON.stringify(cache_data));
|
||||
text = result.ping + " ms";
|
||||
if (ping < 100)
|
||||
color = "green";
|
||||
else if (ping < 200)
|
||||
color = "#fb9a05";
|
||||
} else {
|
||||
const cache_data = {
|
||||
dom_id: strs[i],
|
||||
timestamp: Date.now(),
|
||||
savetime: 60 * 1000,
|
||||
value: -1
|
||||
};
|
||||
localStorage.setItem(auto_detection_time + ":" + dom.address + ":" + dom.port, JSON.stringify(cache_data));
|
||||
}
|
||||
a.innerText = text;
|
||||
a.style.color = color;
|
||||
@@ -1101,6 +1113,15 @@ table td, .table .td {
|
||||
onChange("auto_detection_time", auto_detection_time);
|
||||
});
|
||||
});
|
||||
|
||||
const links = document.querySelectorAll('a');
|
||||
links.forEach(link => {
|
||||
link.addEventListener('click', (e) => {
|
||||
if (link.getAttribute('target') !== '_blank') {
|
||||
ajaxAbortAll();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
Reference in new issue
Block a user