diff options
Diffstat (limited to 'src/views/AccessControl/SslCertificates/SslCertificates.vue')
-rw-r--r-- | src/views/AccessControl/SslCertificates/SslCertificates.vue | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/src/views/AccessControl/SslCertificates/SslCertificates.vue b/src/views/AccessControl/SslCertificates/SslCertificates.vue index bce50d72..fe63bd99 100644 --- a/src/views/AccessControl/SslCertificates/SslCertificates.vue +++ b/src/views/AccessControl/SslCertificates/SslCertificates.vue @@ -11,7 +11,7 @@ <template v-else> {{ $t('pageSslCertificates.alert.certificateExpiredMessage', { - certificate: expiredCertificateTypes[0] + certificate: expiredCertificateTypes[0], }) }} </template> @@ -24,7 +24,7 @@ <template v-else> {{ $t('pageSslCertificates.alert.certificateExpiringMessage', { - certificate: expiringCertificateTypes[0] + certificate: expiringCertificateTypes[0], }) }} </template> @@ -61,11 +61,11 @@ :items="tableItems" :empty-text="$t('global.table.emptyMessage')" > - <template v-slot:cell(validFrom)="{ value }"> + <template #cell(validFrom)="{ value }"> {{ value | formatDate }} </template> - <template v-slot:cell(validUntil)="{ value }"> + <template #cell(validUntil)="{ value }"> <status-icon v-if="getDaysUntilExpired(value) < 31" :status="getIconStatus(value)" @@ -73,7 +73,7 @@ {{ value | formatDate }} </template> - <template v-slot:cell(actions)="{ value, item }"> + <template #cell(actions)="{ value, item }"> <table-row-action v-for="(action, index) in value" :key="index" @@ -82,7 +82,7 @@ :enabled="action.enabled" @click:tableAction="onTableRowAction($event, item)" > - <template v-slot:icon> + <template #icon> <icon-replace v-if="action.value === 'replace'" /> <icon-trashcan v-if="action.value === 'delete'" /> </template> @@ -124,39 +124,43 @@ export default { ModalUploadCertificate, PageTitle, StatusIcon, - TableRowAction + TableRowAction, }, mixins: [BVToastMixin, LoadingBarMixin], + beforeRouteLeave(to, from, next) { + this.hideLoader(); + next(); + }, data() { return { modalCertificate: null, fields: [ { key: 'certificate', - label: this.$t('pageSslCertificates.table.certificate') + label: this.$t('pageSslCertificates.table.certificate'), }, { key: 'issuedBy', - label: this.$t('pageSslCertificates.table.issuedBy') + label: this.$t('pageSslCertificates.table.issuedBy'), }, { key: 'issuedTo', - label: this.$t('pageSslCertificates.table.issuedTo') + label: this.$t('pageSslCertificates.table.issuedTo'), }, { key: 'validFrom', - label: this.$t('pageSslCertificates.table.validFrom') + label: this.$t('pageSslCertificates.table.validFrom'), }, { key: 'validUntil', - label: this.$t('pageSslCertificates.table.validUntil') + label: this.$t('pageSslCertificates.table.validUntil'), }, { key: 'actions', label: '', - tdClass: 'text-right text-nowrap' - } - ] + tdClass: 'text-right text-nowrap', + }, + ], }; }, computed: { @@ -164,21 +168,21 @@ export default { return this.$store.getters['sslCertificates/allCertificates']; }, tableItems() { - return this.certificates.map(certificate => { + return this.certificates.map((certificate) => { return { ...certificate, actions: [ { value: 'replace', - title: this.$t('pageSslCertificates.replaceCertificate') + title: this.$t('pageSslCertificates.replaceCertificate'), }, { value: 'delete', title: this.$t('pageSslCertificates.deleteCertificate'), enabled: - certificate.type === 'TrustStore Certificate' ? true : false - } - ] + certificate.type === 'TrustStore Certificate' ? true : false, + }, + ], }; }); }, @@ -205,7 +209,7 @@ export default { } return acc; }, []); - } + }, }, async created() { this.startLoader(); @@ -214,10 +218,6 @@ export default { .dispatch('sslCertificates/getCertificates') .finally(() => this.endLoader()); }, - beforeRouteLeave(to, from, next) { - this.hideLoader(); - next(); - }, methods: { onTableRowAction(event, rowItem) { switch (event) { @@ -240,14 +240,14 @@ export default { .msgBoxConfirm( this.$t('pageSslCertificates.modal.deleteConfirmMessage', { issuedBy: certificate.issuedBy, - certificate: certificate.certificate + certificate: certificate.certificate, }), { title: this.$t('pageSslCertificates.deleteCertificate'), - okTitle: this.$t('global.action.delete') + okTitle: this.$t('global.action.delete'), } ) - .then(deleteConfirmed => { + .then((deleteConfirmed) => { if (deleteConfirmed) this.deleteCertificate(certificate); }); }, @@ -264,7 +264,7 @@ export default { this.startLoader(); this.$store .dispatch('sslCertificates/addNewCertificate', { file, type }) - .then(success => this.successToast(success)) + .then((success) => this.successToast(success)) .catch(({ message }) => this.errorToast(message)) .finally(() => this.endLoader()); }, @@ -272,15 +272,15 @@ export default { this.startLoader(); const reader = new FileReader(); reader.readAsBinaryString(file); - reader.onloadend = event => { + reader.onloadend = (event) => { const certificateString = event.target.result; this.$store .dispatch('sslCertificates/replaceCertificate', { certificateString, type, - location + location, }) - .then(success => this.successToast(success)) + .then((success) => this.successToast(success)) .catch(({ message }) => this.errorToast(message)) .finally(() => this.endLoader()); }; @@ -290,9 +290,9 @@ export default { this.$store .dispatch('sslCertificates/deleteCertificate', { type, - location + location, }) - .then(success => this.successToast(success)) + .then((success) => this.successToast(success)) .catch(({ message }) => this.errorToast(message)) .finally(() => this.endLoader()); }, @@ -312,7 +312,7 @@ export default { } else if (daysUntilExpired < 31) { return 'warning'; } - } - } + }, + }, }; </script> |