From c8ca9ef7ab499f4a1ed411d465433f49d416ca9b Mon Sep 17 00:00:00 2001 From: Donald Cheng Hong Zou Date: Wed, 30 Mar 2022 00:54:11 -0400 Subject: [PATCH] Minimized some js code --- src/static/js/configuration.js | 79 +++++++++++++++++++++++----------- 1 file changed, 54 insertions(+), 25 deletions(-) diff --git a/src/static/js/configuration.js b/src/static/js/configuration.js index b1835e9..71f5e44 100644 --- a/src/static/js/configuration.js +++ b/src/static/js/configuration.js @@ -303,11 +303,15 @@ let peers = []; let total_s = 0; total_r += peer.cumu_receive; total_s += peer.cumu_sent; + + let spliter = '
'; let peer_name = `
${peer.name === "" ? "Untitled" : peer.name}
-
+
+ +
`; let peer_transfer = `
@@ -318,10 +322,31 @@ let peers = []; ${roundN(peer.total_sent + total_s, 4)} GB

`; - let peer_key = '
PEERCLICK TO COPY
' + peer.id + '
'; - let peer_allowed_ip = '
ALLOWED IP
' + peer.allowed_ip + '
'; - let peer_latest_handshake = '
LATEST HANDSHAKE
' + peer.latest_handshake + '
'; - let peer_endpoint = '
END POINT
' + peer.endpoint + '
'; + let peer_key = + `
+ + PEER + CLICK TO COPY + +
${peer.id}
+
`; + let peer_allowed_ip = ` +
+ + ALLOWED IP + +
${peer.allowed_ip}
+
`; + let peer_latest_handshake = + `
+ LATEST HANDSHAKE +
${peer.latest_handshake}
+
`; + let peer_endpoint = + `
+ END POINT +
${peer.endpoint}
+
`; let peer_control = `

@@ -336,27 +361,31 @@ let peers = []; `; if (peer.private_key !== "") { - peer_control += ''; + peer_control += + ``; } - peer_control += '
'; - let html = '
' + - '
' + - '
' + - '
' + - peer_name + - spliter + - peer_transfer + - peer_key + - peer_allowed_ip + - peer_latest_handshake + - spliter + - peer_endpoint + - spliter + - peer_control + - '
' + - '
' + - '
' + - '
'; + peer_control += ''; + let html = + `
+
+
+
` + + peer_name + + spliter + + peer_transfer + + peer_key + + peer_allowed_ip + + peer_latest_handshake + + spliter + + peer_endpoint + + spliter + + peer_control + + `
`; result += html; }); response.lock_access_peers.forEach(function(peer) {