From b90e1e6d9b5c9811b08b34af26cd9c1be23f8f78 Mon Sep 17 00:00:00 2001 From: jingrow Date: Tue, 29 Jul 2025 21:41:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=81=E9=92=A5=E6=96=87=E6=9C=AC=E6=A1=86?= =?UTF-8?q?=E5=8F=B3=E4=B8=8A=E8=A7=92=E5=A2=9E=E5=8A=A0=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src2/components/JsiteServerOverview.vue | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/dashboard/src2/components/JsiteServerOverview.vue b/dashboard/src2/components/JsiteServerOverview.vue index 2d68324..81a5421 100644 --- a/dashboard/src2/components/JsiteServerOverview.vue +++ b/dashboard/src2/components/JsiteServerOverview.vue @@ -179,8 +179,15 @@
私钥: -
-
{{ $jsiteServer.pg.private_key }}
+
+ +
{{ $jsiteServer.pg.private_key }}
未设置
@@ -201,6 +208,7 @@ import EyeIcon from '~icons/lucide/eye'; import EyeOffIcon from '~icons/lucide/eye-off'; import ClockIcon from '~icons/lucide/clock'; import InfoIcon from '~icons/lucide/info'; +import CopyIcon from '~icons/lucide/copy'; export default { name: 'JsiteServerOverview', @@ -212,6 +220,7 @@ export default { EyeOffIcon, ClockIcon, InfoIcon, + CopyIcon, }, data() { return { @@ -221,6 +230,7 @@ export default { resetPasswordLoading: false, resetKeyPairLoading: false, resetSystemLoading: false, + copySuccess: false, }; }, methods: { @@ -478,6 +488,19 @@ export default { getPasswordRequest.submit(); } }, + copyPrivateKey() { + if (this.$jsiteServer.pg.private_key) { + navigator.clipboard.writeText(this.$jsiteServer.pg.private_key).then(() => { + this.copySuccess = true; + toast.success('私钥已复制到剪贴板'); + setTimeout(() => { + this.copySuccess = false; + }, 2000); + }).catch(() => { + toast.error('复制失败,请手动复制'); + }); + } + }, }, computed: { serverInformation() {