mirror of
https://github.com/jumpserver/lina.git
synced 2025-07-16 08:17:45 +00:00
perf: 优化创建storage,使用新的通用组件
perf: 优化工单创建使用新的组件
This commit is contained in:
parent
324db2fdae
commit
6fc8a43e34
@ -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,
|
||||
|
@ -93,8 +93,6 @@ export default {
|
||||
hasCreate: false,
|
||||
hasMoreActions: false,
|
||||
hasBulkDelete: false,
|
||||
// createRoute: 'RemoteAppCreate',
|
||||
moreActionsTitle: this.$t('common.Create'),
|
||||
moreActionsType: 'primary',
|
||||
moreCreates: {
|
||||
callback: (option) => {
|
||||
|
@ -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',
|
||||
|
@ -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' }})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -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) => {
|
||||
|
@ -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) => {
|
||||
|
@ -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' })
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user