luci-proto-yggdrasil: update yggdrasil.js for 0.5.7+ version
authorIvan Chashkin <[email protected]>
Fri, 21 Feb 2025 19:20:54 +0000 (22:20 +0300)
committerPaul Donald <[email protected]>
Tue, 25 Feb 2025 20:01:24 +0000 (14:01 -0600)
rename latency_ms and add new protocols to validate functions
https://yggdrasil-network.github.io/configurationref.html

Signed-off-by: Ivan Chashkin <[email protected]>
protocols/luci-proto-yggdrasil/htdocs/luci-static/resources/protocol/yggdrasil.js

index 3766bb1b48598e8c17c703df43c8baf651e91d65..4cfa62583f62febe5cb14b447f5c74c24e99ffa6 100644 (file)
@@ -33,13 +33,13 @@ function validateYggdrasilListenUri(section_id,value) {
        if (value.length == 0) {
                return true;
        };
-       if (!value.match(/^(tls|tcp|unix|quic):\/\//))
+       if (!value.match(/^(tls|tcp|quic|unix|ws):\/\//))
                return _('Unsupported URI scheme in %s').format(value);
        return true;
 };
 
 function validateYggdrasilPeerUri(section_id,value) {
-       if (!value.match(/^(tls|tcp|unix|quic|socks|sockstls):\/\//))
+       if (!value.match(/^(tls|tcp|quic|socks|sockstls|unix|ws|wss):\/\//))
                return _('URI scheme %s not supported').format(value);
        return true;
 };
@@ -98,7 +98,7 @@ function updateActivePeers(ifname) {
 
                                cell = row.insertCell(-1)
                                cell.className = "td"
-                               cell.textContent = '%.2f ms'.format(peer.latency_ms / 10**6);
+                               cell.textContent = '%.2f ms'.format(peer.latency / 10**6);
 
                                cell = row.insertCell(-1)
                                cell.className = "td"