EnvironmentsList.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. </template>
  9. <script>
  10. import WindowsMixin from '@/mixins/windows'
  11. import ListMixin from '@/mixins/list'
  12. import { getNameFilter } from '@/utils/common/tableFilter'
  13. import { getNameDescriptionTableColumn } from '@/utils/common/tableColumn'
  14. export default {
  15. name: 'EnvironmentsListForWebAppSidepage',
  16. mixins: [WindowsMixin, ListMixin],
  17. props: {
  18. resId: String,
  19. data: {
  20. type: Object,
  21. required: true,
  22. },
  23. },
  24. data () {
  25. return {
  26. list: this.$list.createList(this, {
  27. id: 'WebAppEnvironmentList',
  28. resource: 'webappenvironments',
  29. getParams: {
  30. app_id: this.data.id,
  31. },
  32. filterOptions: {
  33. name: getNameFilter(),
  34. },
  35. }),
  36. exportDataOptions: {
  37. items: [
  38. { label: 'ID', key: 'id' },
  39. { label: this.$t('compute.webapp.env'), key: 'name' },
  40. ],
  41. },
  42. columns: [
  43. getNameDescriptionTableColumn({
  44. onManager: this.onManager,
  45. hideField: true,
  46. title: this.$t('compute.webapp.env'),
  47. slotCallback: row => {
  48. return (
  49. <span>{ row.name }</span>
  50. )
  51. },
  52. }),
  53. ],
  54. singleActions: [],
  55. groupActions: [],
  56. }
  57. },
  58. created () {
  59. this.list.fetchData()
  60. },
  61. methods: {
  62. },
  63. }
  64. </script>