fix: make copy buttons work on HTTP panel pages

Read share links from input fields and fall back to execCommand when
Clipboard API is unavailable outside secure contexts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-16 10:17:04 +08:00
parent d339fbd917
commit 9ebab211dd
3 changed files with 57 additions and 10 deletions
+4 -4
View File
@@ -75,15 +75,15 @@
<div class="field">
<label>VLESS + Reality</label>
<div class="copy-row">
<input readonly value="{{ node.links.vless }}">
<button class="btn" data-copy="{{ node.links.vless }}">复制</button>
<input class="copy-input" readonly value="{{ node.links.vless }}">
<button type="button" class="btn copy-btn">复制</button>
</div>
</div>
<div class="field">
<label>Hysteria2</label>
<div class="copy-row">
<input readonly value="{{ node.links.hy2 }}">
<button class="btn" data-copy="{{ node.links.hy2 }}">复制</button>
<input class="copy-input" readonly value="{{ node.links.hy2 }}">
<button type="button" class="btn copy-btn">复制</button>
</div>
</div>
<div class="node-actions">