mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-15 14:24:39 +00:00
perf: 优化has valid license 写法
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
|
||||
<script>
|
||||
import { GenericListPage } from '@/layout/components'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -67,59 +66,35 @@ export default {
|
||||
hasMoreActions: false,
|
||||
createRoute: 'DatabaseAppCreate',
|
||||
moreCreates: {
|
||||
callback: (item) => {
|
||||
vm.$router.push({ name: 'DatabaseAppCreate', query: { type: item.name.toLowerCase() }})
|
||||
},
|
||||
dropdown: [
|
||||
{
|
||||
name: 'MySQL',
|
||||
title: 'MySQL',
|
||||
type: 'primary',
|
||||
has: true,
|
||||
callback: this.createMysql.bind(this)
|
||||
has: true
|
||||
},
|
||||
{
|
||||
name: 'PostgreSQL',
|
||||
title: 'PostgreSQL',
|
||||
type: 'primary',
|
||||
has: this.hasLicence,
|
||||
callback: this.createPostgreSQL.bind(this)
|
||||
has: this.$store.getters.hasValidLicense
|
||||
},
|
||||
{
|
||||
name: 'MariaDB',
|
||||
title: 'MariaDB',
|
||||
type: 'primary',
|
||||
has: this.hasLicence,
|
||||
callback: this.createMariaDB.bind(this)
|
||||
has: this.$store.getters.hasValidLicense
|
||||
},
|
||||
{
|
||||
name: 'Oracle',
|
||||
title: 'Oracle',
|
||||
type: 'primary',
|
||||
has: this.hasLicence,
|
||||
callback: this.createOracle.bind(this)
|
||||
has: this.$store.getters.hasValidLicense
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['publicSettings', 'currentOrg', 'hasValidLicense'])
|
||||
},
|
||||
methods: {
|
||||
createMysql() {
|
||||
this.$router.push({ name: 'DatabaseAppCreate', query: { type: 'mysql' }})
|
||||
},
|
||||
createPostgreSQL() {
|
||||
this.$router.push({ name: 'DatabaseAppCreate', query: { type: 'postgresql' }})
|
||||
},
|
||||
createMariaDB() {
|
||||
this.$router.push({ name: 'DatabaseAppCreate', query: { type: 'mariadb' }})
|
||||
},
|
||||
createOracle() {
|
||||
this.$router.push({ name: 'DatabaseAppCreate', query: { type: 'oracle' }})
|
||||
},
|
||||
hasLicense() {
|
||||
return this.hasLicence
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
<script>
|
||||
import { GenericListPage } from '@/layout/components'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -98,25 +97,25 @@ export default {
|
||||
name: 'PostgreSQL',
|
||||
title: 'PostgreSQL',
|
||||
type: 'primary',
|
||||
has: this.hasLicence
|
||||
has: this.$store.getters.hasValidLicense
|
||||
},
|
||||
{
|
||||
name: 'MariaDB',
|
||||
title: 'MariaDB',
|
||||
type: 'primary',
|
||||
has: this.hasLicence
|
||||
has: this.$store.getters.hasValidLicense
|
||||
},
|
||||
{
|
||||
name: 'Oracle',
|
||||
title: 'Oracle',
|
||||
type: 'primary',
|
||||
has: this.hasLicence
|
||||
has: this.$store.getters.hasValidLicense
|
||||
},
|
||||
{
|
||||
name: 'K8S',
|
||||
title: 'K8S',
|
||||
type: 'primary',
|
||||
has: this.hasLicence,
|
||||
has: this.$store.getters.hasValidLicense,
|
||||
group: this.$t('assets.OtherProtocol')
|
||||
}
|
||||
]
|
||||
@@ -124,14 +123,6 @@ export default {
|
||||
},
|
||||
helpMessage: this.$t('assets.SystemUserListHelpMessage')
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['publicSettings', 'currentOrg', 'hasValidLicense'])
|
||||
},
|
||||
methods: {
|
||||
hasLicence() {
|
||||
return this.hasValidLicense
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user