CertInfo.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <script setup lang="ts">
  2. import {CloseCircleOutlined, CheckCircleOutlined} from '@ant-design/icons-vue'
  3. import dayjs from 'dayjs'
  4. const props = defineProps(['cert'])
  5. </script>
  6. <template>
  7. <div class="cert-info" v-if="cert">
  8. <p v-translate="{issuer: cert.issuer_name}">Intermediate Certification Authorities: %{issuer}</p>
  9. <p v-translate="{name: cert.subject_name}">Subject Name: %{name}</p>
  10. <p v-translate="{date: dayjs(cert.not_after).format('YYYY-MM-DD HH:mm:ss').toString()}">
  11. Expiration Date: %{date}</p>
  12. <p v-translate="{date: dayjs(cert.not_before).format('YYYY-MM-DD HH:mm:ss').toString()}">
  13. Not Valid Before: %{date}</p>
  14. <div class="status">
  15. <template v-if="new Date().toISOString() < cert.not_before || new Date().toISOString() > cert.not_after">
  16. <close-circle-outlined style="color: red"/>
  17. <span v-translate>Certificate has expired</span>
  18. </template>
  19. <template v-else>
  20. <check-circle-outlined style="color: green"/>
  21. <span v-translate>Certificate is valid</span>
  22. </template>
  23. </div>
  24. </div>
  25. </template>
  26. <style lang="less" scoped>
  27. h4 {
  28. padding-bottom: 10px;
  29. }
  30. .cert-info {
  31. padding-bottom: 10px;
  32. }
  33. .status {
  34. span {
  35. margin-right: 10px;
  36. }
  37. }
  38. </style>