DomainList.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <page-list
  3. :list="list"
  4. :columns="columns"
  5. :single-actions="singleActions"
  6. :group-actions="groupActions"
  7. :export-data-options="exportDataOptions"
  8. :hiddenExportKeys="['description']"
  9. :showPage="false" />
  10. </template>
  11. <script>
  12. import WindowsMixin from '@/mixins/windows'
  13. import ListMixin from '@/mixins/list'
  14. // import { getNameFilter } from '@/utils/common/tableFilter'
  15. import { getNameDescriptionTableColumn, getStatusTableColumn } from '@/utils/common/tableColumn'
  16. export default {
  17. name: 'DomainListForWebAppSidepage',
  18. mixins: [WindowsMixin, ListMixin],
  19. props: {
  20. resId: String,
  21. data: {
  22. type: Object,
  23. required: true,
  24. },
  25. },
  26. data () {
  27. return {
  28. list: this.$list.createList(this, {
  29. id: 'WebAppDomainList',
  30. resource: `webapps/${this.data.id}/custom-domains`,
  31. getParams: {
  32. },
  33. // filterOptions: {
  34. // name: getNameFilter(),
  35. // },
  36. }),
  37. columns: [
  38. getNameDescriptionTableColumn({
  39. onManager: this.onManager,
  40. hideField: true,
  41. title: this.$t('table.title.name'),
  42. showDesc: false,
  43. slotCallback: row => {
  44. return (
  45. <span>{ row.name }</span>
  46. )
  47. },
  48. }),
  49. getStatusTableColumn({ statusModule: 'webappDomains' }),
  50. {
  51. field: 'ssl_state',
  52. title: this.$t('network.binding_type'),
  53. formatter: ({ row }) => {
  54. return row.ssl_state === 'SniEnabled' ? 'SNI SSL' : '-'
  55. },
  56. },
  57. ],
  58. singleActions: [],
  59. groupActions: [],
  60. }
  61. },
  62. computed: {
  63. exportDataOptions () {
  64. return {
  65. downloadType: 'local',
  66. title: this.$t('network.custom_domain'),
  67. items: [
  68. { field: 'id', label: 'ID' },
  69. ...this.columns,
  70. ],
  71. }
  72. },
  73. },
  74. created () {
  75. this.list.fetchData()
  76. },
  77. methods: {
  78. },
  79. }
  80. </script>