From 362c8c7a572dce21725b47829089e5fa71a312bc Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 7 Aug 2026 18:09:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8A=82=E7=82=B9=E5=88=97=E8=A1=A8=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E6=A8=AA=E5=90=91=E6=BB=9A=E5=8A=A8=EF=BC=8C=E5=85=AC?= =?UTF-8?q?=E9=92=A5=E6=88=AA=E6=96=AD=E6=98=BE=E7=A4=BA+=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/NodeListPanel.vue | 37 ++++++++++++++++- meshmap_frontend/src/style.css | 41 +++++++++++++++++++ meshmap_frontend/src/version.ts | 2 +- 3 files changed, 77 insertions(+), 3 deletions(-) diff --git a/meshmap_frontend/src/components/NodeListPanel.vue b/meshmap_frontend/src/components/NodeListPanel.vue index 45a6a44..c3a9390 100644 --- a/meshmap_frontend/src/components/NodeListPanel.vue +++ b/meshmap_frontend/src/components/NodeListPanel.vue @@ -27,11 +27,33 @@ const canNext = computed(() => props.page < totalPages.value) const menuNode = ref(null) const menuX = ref(0) const menuY = ref(0) +const copiedNodeId = ref(null) function formatTime(value: string): string { return new Date(value).toLocaleString() } +function truncateKey(key: string): string { + if (key.length <= 12) return key + return key.slice(0, 8) + '…' + key.slice(-4) +} + +async function copyPublicKey(node: NodeInfo, event: MouseEvent) { + event.stopPropagation() + if (!node.public_key) return + try { + await navigator.clipboard.writeText(node.public_key) + copiedNodeId.value = node.node_id + setTimeout(() => { + if (copiedNodeId.value === node.node_id) { + copiedNodeId.value = null + } + }, 2000) + } catch { + /* clipboard not available */ + } +} + function closeNodeMenu() { menuNode.value = null } @@ -95,7 +117,7 @@ onBeforeUnmount(() => { 共 {{ total }} 条 -
+
@@ -122,7 +144,18 @@ onBeforeUnmount(() => { - + diff --git a/meshmap_frontend/src/style.css b/meshmap_frontend/src/style.css index 37c67ae..067f701 100644 --- a/meshmap_frontend/src/style.css +++ b/meshmap_frontend/src/style.css @@ -1127,6 +1127,47 @@ h3 { background: var(--color-primary-soft); } +/* === 节点列表:去除横向滚动,内容自适应换行 === */ +.node-list-wrap { + overflow-x: hidden; +} + +.node-list-wrap .node-table th, +.node-list-wrap .node-table td { + white-space: normal; + word-break: break-all; + vertical-align: middle; +} + +.pubkey-cell { + display: inline-flex; + align-items: center; + gap: 6px; +} + +.pubkey-text { + font-family: var(--font-mono); + font-size: 12px; +} + +.copy-btn { + flex-shrink: 0; + padding: 2px 8px; + font-size: 12px; + border: 1px solid var(--color-border); + border-radius: var(--radius-sm); + background: var(--color-surface); + color: var(--color-muted); + cursor: pointer; + transition: all 0.15s ease; +} + +.copy-btn:hover { + background: var(--color-primary-soft); + color: var(--color-primary); + border-color: var(--color-primary); +} + .admin-loading { padding: 24px; color: var(--color-muted); diff --git a/meshmap_frontend/src/version.ts b/meshmap_frontend/src/version.ts index d3b3679..5eb9c8d 100644 --- a/meshmap_frontend/src/version.ts +++ b/meshmap_frontend/src/version.ts @@ -1 +1 @@ -export const FRONTEND_VERSION = '0.1.0' +export const FRONTEND_VERSION = '0.1.1'
{{ node.short_name || '-' }} {{ node.hw_model || '-' }} {{ node.role || '-' }}{{ node.public_key || '-' }} + + {{ truncateKey(node.public_key) }} + + + - + {{ formatTime(node.updated_at) }}