diff --git a/src/main/resources/web/app.js b/src/main/resources/web/app.js index 53ec9ff..a2474fe 100644 --- a/src/main/resources/web/app.js +++ b/src/main/resources/web/app.js @@ -31,6 +31,11 @@ document.addEventListener('alpine:init', () => { localTcpPort: 0, peerTcpPort: 0, peerHostname: null, + // NetCopy version reported by each side's /api/peer/info. Populated + // on successful Connect; null until then. Helpful for "is the peer + // running the same build as me" sanity checks during a release. + localVersion: null, + peerVersion: null, // ---- transfers + ws --------------------------------------------- transfers: [], // [{ id, host, state, protocol, bytesDone, totalBytes, ... }] @@ -96,6 +101,7 @@ document.addEventListener('alpine:init', () => { const info = await r.json(); this.localTcpPort = info.tcpPort || 0; this.hostname = info.hostname || this.hostname; + this.localVersion = info.version || null; this.localOk = true; this.localStatus = 'ok'; this.openWs(); @@ -142,6 +148,7 @@ document.addEventListener('alpine:init', () => { const info = await r.json(); this.peerTcpPort = info.tcpPort || 0; this.peerHostname = info.hostname || null; + this.peerVersion = info.version || null; this.peerOk = true; this.peerStatus = 'ok'; this.openPeerWs(); diff --git a/src/main/resources/web/index.html b/src/main/resources/web/index.html index 5c67d2c..d9c9507 100644 --- a/src/main/resources/web/index.html +++ b/src/main/resources/web/index.html @@ -26,6 +26,13 @@
NetCopy + +
@@ -82,7 +89,18 @@ x-text="$store.app.peerStatus === 'connecting' ? 'connecting…' : $store.app.peerStatus === 'ok' ? 'peer ok' : $store.app.peerStatus === 'error' ? 'error' - : 'no peer'"> + : 'no peer'" + :title="$store.app.peerStatus === 'ok' + ? ('NetCopy v' + ($store.app.peerVersion || '?') + + ' on ' + ($store.app.peerHostname || '?')) + : ''"> + +