Skip to content

Commit

Permalink
Merge pull request #25 from ztalab/dev
Browse files Browse the repository at this point in the history
🎨 add key pem content view
  • Loading branch information
rovast authored May 25, 2022
2 parents 0122ab9 + cf32c18 commit e901c84
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/components/pem-dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<v-card-text style="height: 350px;">
<v-tabs-items v-model="tab">
<v-tab-item v-for="item in items" :key="item">
<pre class="text-caption">{{ item === 'CA PEM' ? data.ca_pem : data.cert_pem }}</pre>
<pre class="text-caption">{{ getPemContent(item) }}</pre>
</v-tab-item>
</v-tabs-items>
</v-card-text>
Expand Down Expand Up @@ -43,7 +43,7 @@ export default {
return {
dialog: false,
tab: null,
items: ['CA PEM', 'CERT PEM']
items: ['CA PEM', 'CERT PEM', 'KEY PEM']
}
},
methods: {
Expand All @@ -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}`
}
}
}
Expand Down

0 comments on commit e901c84

Please sign in to comment.