aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/node-page.js
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-20 01:52:01 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-20 01:52:01 +0200
commit66abba3d08021b1ff538d6266e4b4e590407bde2 (patch)
tree891999648a9654c84e0590b36e0bc95f17d84c98 /packages/meshbay-hub/src/meshbay_hub/static/node-page.js
parent6770ed9cd36fe68610b74826520f8c6effc121f6 (diff)
downloadmeshbay-66abba3d08021b1ff538d6266e4b4e590407bde2.tar.gz
feat(hub): show the node's public key in Node → Overview
It was only the Node ID row's fallback, so it vanished the moment the node announced itself — and was labelled Node ID when it did show. Own row, copy button, and the profile's instructions no longer name the node dashboard removed on 2026-09-01. `.node-key` wraps: 44 base64 characters with no break opportunity pushed a 412px document to 417px, which unpins every sticky element on the page. The width probe now measures the Overview table with a real key in it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/node-page.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/node-page.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/node-page.js b/packages/meshbay-hub/src/meshbay_hub/static/node-page.js
index 2edcbab..0b05dad 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/node-page.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/node-page.js
@@ -216,6 +216,7 @@ export function NodePage({ groups, token, username }) {
const [nodeRoster, setNodeRoster] = useState(null);
const [unlinkBusy, setUnlinkBusy] = useState(false);
const [tab, setTab] = useState('overview');
+ const [keyCopied, setKeyCopied] = useState(false);
const fetchStatus = useCallback(async () => {
setStatus('connecting');
@@ -257,6 +258,16 @@ export function NodePage({ groups, token, username }) {
} catch {}
}, []);
+ const copyNodeKey = useCallback(async () => {
+ const pk = nodeInfo && nodeInfo.pk_node_ed25519;
+ if (!pk) return;
+ try {
+ await navigator.clipboard.writeText(pk);
+ setKeyCopied(true);
+ setTimeout(() => setKeyCopied(false), 2000);
+ } catch { /* clipboard blocked -- the key is on screen to copy by hand */ }
+ }, [nodeInfo]);
+
const addRoot = useCallback(async (groupId) => {
const chosen = await platform.rootPicker.choose();
if (!chosen) return;
@@ -725,7 +736,16 @@ export function NodePage({ groups, token, username }) {
<tbody>
<tr><td>${t('node.overview_version')}</td><td>${nodeInfo.version || '—'}</td></tr>
<tr><td>${t('node.overview_node_id')}</td>
- <td><code>${nodeInfo.endpoint_hint || nodeInfo.pk_node_ed25519 || '—'}</code></td></tr>
+ <td><code>${nodeInfo.endpoint_hint || '—'}</code></td></tr>
+ <tr><td>${t('node.overview_node_key')}</td>
+ <td>
+ <code class="node-key">${nodeInfo.pk_node_ed25519 || '—'}</code>
+ ${nodeInfo.pk_node_ed25519 && html`
+ <button class="btn btn-small btn-secondary" onClick=${copyNodeKey}>
+ ${keyCopied ? t('node.overview_node_key_copied')
+ : t('node.overview_node_key_copy')}
+ </button>`}
+ </td></tr>
<tr><td>${t('node.overview_quic_port')}</td><td>${nodeInfo.quic_port || '—'}</td></tr>
<tr><td>${t('node.overview_hub')}</td><td>${nodeInfo.hub_url || '—'}</td></tr>
</tbody>