List.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 { mapGetters } from 'vuex'
  11. import ColumnsMixin from '../mixins/columns'
  12. import SingleActionsMixin from '../mixins/singleActions'
  13. import ListMixin from '@/mixins/list'
  14. import WindowsMixin from '@/mixins/windows'
  15. import { getDescriptionFilter } from '@/utils/common/tableFilter'
  16. export default {
  17. name: 'SshAgentList',
  18. mixins: [WindowsMixin, ListMixin, ColumnsMixin, SingleActionsMixin],
  19. props: {
  20. id: String,
  21. },
  22. data () {
  23. return {
  24. list: this.$list.createList(this, {
  25. id: this.id,
  26. resource: 'proxy_agents',
  27. getParams: this.getParam,
  28. filterOptions: {
  29. name: {
  30. label: this.$t('network.text_21'),
  31. filter: true,
  32. formatter: val => {
  33. return `name.contains(${val})`
  34. },
  35. },
  36. description: getDescriptionFilter(),
  37. },
  38. }),
  39. exportDataOptions: {
  40. items: [
  41. { label: 'ID', key: 'id' },
  42. { label: this.$t('network.text_21'), key: 'name' },
  43. ],
  44. },
  45. groupActions: [],
  46. }
  47. },
  48. computed: {
  49. ...mapGetters(['isAdminMode', 'isDomainMode', 'isProjectMode', 'userInfo']),
  50. },
  51. created () {
  52. this.initSidePageTab('SshAgent-detail')
  53. this.list.fetchData()
  54. },
  55. methods: {
  56. getParam () {
  57. return {}
  58. },
  59. handleOpenSidepage (row) {
  60. this.sidePageTriggerHandle(this, 'SshAgentSidePage', {
  61. id: row.id,
  62. resource: 'proxy_agents',
  63. getParams: this.getParam,
  64. }, {
  65. list: this.list,
  66. })
  67. },
  68. },
  69. }
  70. </script>