From cf32c18f2595ed158b961d5ea3d7a1488bfb850a Mon Sep 17 00:00:00 2001 From: rovast Date: Wed, 25 May 2022 17:00:29 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20add=20key=20pem=20content=20view?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/pem-dialog.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/pem-dialog.vue b/src/components/pem-dialog.vue index 1c0825d..582947a 100644 --- a/src/components/pem-dialog.vue +++ b/src/components/pem-dialog.vue @@ -13,7 +13,7 @@ -
{{ item === 'CA PEM' ? data.ca_pem : data.cert_pem }}
+
{{ getPemContent(item)  }}
@@ -43,7 +43,7 @@ export default { return { dialog: false, tab: null, - items: ['CA PEM', 'CERT PEM'] + items: ['CA PEM', 'CERT PEM', 'KEY PEM'] } }, methods: { @@ -52,6 +52,15 @@ export default { }, onError() { this.$message.error('Failed to copy texts') + }, + getPemContent(type) { + const map = { + 'CA PEM': this.data.ca_pem, + 'CERT PEM': this.data.cert_pem, + 'KEY PEM': this.data.key_pem + } + + return map[type] || `Unknown pem type: ${type}` } } }