diff --git a/src/components/ListTable/TableAction/LeftSide.vue b/src/components/ListTable/TableAction/LeftSide.vue index 8b22cd8e5..d50957941 100644 --- a/src/components/ListTable/TableAction/LeftSide.vue +++ b/src/components/ListTable/TableAction/LeftSide.vue @@ -63,13 +63,17 @@ export default { moreCreates: { type: Object, default: null + }, + createTitle: { + type: String, + default: () => this.$t('common.Create') } }, data() { const defaultActions = [ { name: 'actionCreate', - title: this.$t('common.Create'), + title: this.createTitle, type: 'primary', has: this.hasCreate && !this.moreCreates, can: this.canCreate, @@ -79,7 +83,7 @@ export default { if (this.moreCreates) { const defaultMoreCreate = { name: 'actionMoreCreate', - title: this.$t('common.Create'), + title: this.createTitle, type: 'primary', has: true, can: this.canCreate, diff --git a/src/views/perms/ApplicationPermission/ApplicationPermissionList.vue b/src/views/perms/ApplicationPermission/ApplicationPermissionList.vue index a97c457c5..972d8fe18 100644 --- a/src/views/perms/ApplicationPermission/ApplicationPermissionList.vue +++ b/src/views/perms/ApplicationPermission/ApplicationPermissionList.vue @@ -93,8 +93,6 @@ export default { hasCreate: false, hasMoreActions: false, hasBulkDelete: false, - // createRoute: 'RemoteAppCreate', - moreActionsTitle: this.$t('common.Create'), moreActionsType: 'primary', moreCreates: { callback: (option) => { diff --git a/src/views/sessions/Storage/CommandStorage.vue b/src/views/sessions/Storage/CommandStorage.vue index f334f640f..0af3e7b24 100644 --- a/src/views/sessions/Storage/CommandStorage.vue +++ b/src/views/sessions/Storage/CommandStorage.vue @@ -22,19 +22,18 @@ export default { hasExport: false, hasImport: false, hasRefresh: false, - hasBulkDelete: false, - hasBulkUpdate: false, - hasCreate: false, - extraMoreActions: [ - { - name: 'Elasticsearch', - title: 'Elasticsearch', - type: 'primary', - callback: this.createEs.bind(this) - } - ], - moreActionsTitle: this.$t('common.Create'), - moreActionsType: 'primary' + hasMoreActions: false, + moreCreates: { + callback: (item) => { + this.$router.push({ name: 'CreateCommandStorage', query: { type: item.name }}) + }, + dropdown: [ + { + name: 'es', + title: 'Elasticsearch' + } + ] + } }, commandTableConfig: { title: 'command', diff --git a/src/views/sessions/Storage/ReplayStorage.vue b/src/views/sessions/Storage/ReplayStorage.vue index 4fda800ae..c6e3fffd8 100644 --- a/src/views/sessions/Storage/ReplayStorage.vue +++ b/src/views/sessions/Storage/ReplayStorage.vue @@ -15,48 +15,34 @@ export default { hasExport: false, hasImport: false, hasRefresh: false, - hasBulkDelete: false, - hasCreate: false, - moreActionsTitle: this.$t('common.Create'), - moreActionsType: 'primary', - extraMoreActions: [ - { - name: 'S3', - title: 'S3', - type: 'primary', - can: true, - callback: this.createS3.bind(this) + hasMoreActions: false, + moreCreates: { + callback: (item) => { + this.$router.push({ name: 'CreateReplayStorage', query: { type: item.name.toLowerCase() }}) }, - { - name: 'Ceph', - title: 'Ceph', - type: 'primary', - can: true, - callback: this.createCeph.bind(this) - }, - { - name: 'Swift', - title: 'Swift', - type: 'primary', - can: true, - callback: this.createSwift.bind(this) - }, - { - name: 'OSS', - title: 'OSS', - type: 'primary', - can: true, - callback: this.createOSS.bind(this) - }, - { - name: 'Azure', - title: 'Azure', - type: 'primary', - can: true, - callback: this.createAzure.bind(this) - } - - ] + dropdown: [ + { + name: 'S3', + title: 'S3' + }, + { + name: 'Ceph', + title: 'Ceph' + }, + { + name: 'swift', + title: 'Swift' + }, + { + name: 'OSS', + title: 'OSS' + }, + { + name: 'Azure', + title: 'Azure' + } + ] + } }, replayTableConfig: { url: '/api/v1/terminal/replay-storages/', @@ -110,21 +96,6 @@ export default { } }, methods: { - createS3() { - this.$router.push({ name: 'CreateReplayStorage', query: { type: 's3' }}) - }, - createCeph() { - this.$router.push({ name: 'CreateReplayStorage', query: { type: 'ceph' }}) - }, - createSwift() { - this.$router.push({ name: 'CreateReplayStorage', query: { type: 'swift' }}) - }, - createOSS() { - this.$router.push({ name: 'CreateReplayStorage', query: { type: 'oss' }}) - }, - createAzure() { - this.$router.push({ name: 'CreateReplayStorage', query: { type: 'azure' }}) - } } } diff --git a/src/views/tickets/RequestApplicationPerm/RequestApplicationPermTicketCreateUpdate.vue b/src/views/tickets/RequestApplicationPerm/RequestApplicationPermTicketCreateUpdate.vue index 47a630f70..a22a1b65c 100644 --- a/src/views/tickets/RequestApplicationPerm/RequestApplicationPermTicketCreateUpdate.vue +++ b/src/views/tickets/RequestApplicationPerm/RequestApplicationPermTicketCreateUpdate.vue @@ -138,7 +138,9 @@ export default { component: Select2, el: { multiple: false, - options: this.$store.state.users.profile.user_all_orgs + options: this.$store.state.users.profile.user_all_orgs.map((item) => { + return { label: item.name, value: item.id } + }) }, on: { changeOptions: ([event], updateForm) => { diff --git a/src/views/tickets/RequestAssetPerm/RequestAssetPermTicketCreateUpdate.vue b/src/views/tickets/RequestAssetPerm/RequestAssetPermTicketCreateUpdate.vue index f909d0131..b2277af51 100644 --- a/src/views/tickets/RequestAssetPerm/RequestAssetPermTicketCreateUpdate.vue +++ b/src/views/tickets/RequestAssetPerm/RequestAssetPermTicketCreateUpdate.vue @@ -42,7 +42,10 @@ export default { } }, meta: { - fields: ['apply_ip_group', 'apply_hostname_group', 'apply_system_user_group', 'apply_actions', 'apply_date_start', 'apply_date_expired'], + fields: [ + 'apply_ip_group', 'apply_hostname_group', 'apply_system_user_group', + 'apply_actions', 'apply_date_start', 'apply_date_expired' + ], fieldsMeta: { apply_actions: { label: this.$t('perms.Actions'), @@ -64,7 +67,9 @@ export default { component: Select2, el: { multiple: false, - options: this.$store.state.users.profile.user_all_orgs + options: this.$store.state.users.profile.user_all_orgs.map((item) => { + return { label: item.name, value: item.id } + }) }, on: { changeOptions: ([event], updateForm) => { diff --git a/src/views/tickets/TicketListTable.vue b/src/views/tickets/TicketListTable.vue index dcbd3d356..10520bb88 100644 --- a/src/views/tickets/TicketListTable.vue +++ b/src/views/tickets/TicketListTable.vue @@ -112,31 +112,26 @@ export default { } } }, - moreActionsTitle: this.$t('common.RequestTickets'), - moreActionsType: 'primary', - extraMoreActions: this.genExtraMoreActions() + createTitle: this.$t('common.RequestTickets'), + hasMoreActions: false, + moreCreates: { + dropdown: [ + { + name: 'RequestAssetPerm', + title: this.$t('tickets.RequestAssetPerm'), + callback: () => this.$router.push({ name: 'RequestAssetPermTicketCreateUpdate' }) + }, + { + name: 'RequestApplicationPerm', + title: this.$t('tickets.RequestApplicationPerm'), + callback: () => this.$router.push({ name: 'RequestApplicationPermTicketCreateUpdate' }) + } + ] + } } } }, methods: { - genExtraMoreActions() { - return [ - { - name: 'RequestAssetPerm', - title: this.$t('tickets.RequestAssetPerm'), - type: 'primary', - can: true, - callback: () => this.$router.push({ name: 'RequestAssetPermTicketCreateUpdate' }) - }, - { - name: 'RequestApplicationPerm', - title: this.$t('tickets.RequestApplicationPerm'), - type: 'primary', - can: true, - callback: () => this.$router.push({ name: 'RequestApplicationPermTicketCreateUpdate' }) - } - ] - } } }