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() {