mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2026-04-04 14:36:18 +00:00
update peer last handshake colors
This commit is contained in:
@@ -291,13 +291,15 @@
|
||||
const handshakeAge = Date.now() / 1000 - parseInt(latestHandshake);
|
||||
|
||||
if (latestHandshake === '0') {
|
||||
calloutDiv.classList.add('callout-danger');
|
||||
// never connected — neutral, no class
|
||||
} else if (handshakeAge < 600) {
|
||||
calloutDiv.classList.add('callout-success');
|
||||
} else if (handshakeAge < 1800) {
|
||||
calloutDiv.classList.add('callout-info');
|
||||
} else if (handshakeAge < 21600) {
|
||||
calloutDiv.classList.add('callout-warning');
|
||||
} else {
|
||||
calloutDiv.classList.add('callout-danger');
|
||||
}
|
||||
calloutDiv.style.transition = 'all 5s';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user