index.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <vxe-grid :data="data.conditions || []" :columns="columns" resizable />
  3. </template>
  4. <script>
  5. export default {
  6. name: 'K8SStatusSidepage',
  7. props: {
  8. data: {
  9. type: Object,
  10. required: true,
  11. },
  12. },
  13. data () {
  14. return {
  15. columns: [
  16. {
  17. field: 'type',
  18. title: 'Type',
  19. minWidth: 100,
  20. showOverflow: 'ellipsis',
  21. },
  22. {
  23. field: 'status',
  24. title: 'Status',
  25. width: 75,
  26. },
  27. {
  28. field: 'lastTransitionTime',
  29. title: 'LastTransitionTime',
  30. minWidth: 100,
  31. showOverflow: 'ellipsis',
  32. formatter: ({ cellValue }) => {
  33. return this.$moment(cellValue).format(this.$t('k8s.text_37'))
  34. },
  35. },
  36. {
  37. field: 'reason',
  38. title: 'Reason',
  39. minWidth: 70,
  40. showOverflow: 'ellipsis',
  41. },
  42. {
  43. field: 'message',
  44. title: 'Message',
  45. minWidth: 70,
  46. showOverflow: 'ellipsis',
  47. },
  48. ],
  49. }
  50. },
  51. }
  52. </script>