diff --git a/src/router/perms.js b/src/router/perms.js index 799546400..e021537e6 100644 --- a/src/router/perms.js +++ b/src/router/perms.js @@ -35,7 +35,7 @@ const ApplicationPermissionRoutes = [ { path: 'app-permissions', component: empty, - meta: { title: i18n.t('route.ApplicationPermission'), licenseRequired: true }, + meta: { title: i18n.t('route.ApplicationPermission') }, redirect: '', children: [ { diff --git a/src/views/applications/DatabaseApp/DatabaseAppList.vue b/src/views/applications/DatabaseApp/DatabaseAppList.vue index fbe19a4a3..8fc06d44e 100644 --- a/src/views/applications/DatabaseApp/DatabaseAppList.vue +++ b/src/views/applications/DatabaseApp/DatabaseAppList.vue @@ -62,28 +62,28 @@ export default { name: 'MySQL', title: 'MySQL', type: 'primary', - can: true, + has: true, callback: this.createMysql.bind(this) }, { name: 'PostgreSQL', title: 'PostgreSQL', type: 'primary', - can: this.isValidateLicense, + has: this.isValidateLicense, callback: this.createPostgreSQL.bind(this) }, { name: 'MariaDB', title: 'MariaDB', type: 'primary', - can: this.isValidateLicense, + has: this.isValidateLicense, callback: this.createMariaDB.bind(this) }, { name: 'Oracle', title: 'Oracle', type: 'primary', - can: this.isValidateLicense, + has: this.isValidateLicense, callback: this.createOracle.bind(this) } ] @@ -91,13 +91,7 @@ export default { } }, computed: { - ...mapGetters(['publicSettings', 'currentOrg']), - isValidateLicense() { - if (this.publicSettings.XPACK_ENABLED) { - return this.publicSettings.XPACK_LICENSE_IS_VALID - } - return true - } + ...mapGetters(['publicSettings', 'currentOrg']) }, methods: { createMysql() { @@ -111,6 +105,12 @@ export default { }, createOracle() { this.$router.push({ name: 'DatabaseAppCreate', query: { type: 'oracle' }}) + }, + isValidateLicense() { + if (this.publicSettings.XPACK_ENABLED) { + return this.publicSettings.XPACK_LICENSE_IS_VALID + } + return false } } } diff --git a/src/views/perms/const.js b/src/views/perms/const.js index bd7f81747..37acec667 100644 --- a/src/views/perms/const.js +++ b/src/views/perms/const.js @@ -11,7 +11,7 @@ function isValidateLicense() { if (store.getters.publicSettings.XPACK_ENABLED) { return store.getters.publicSettings.XPACK_LICENSE_IS_VALID } - return true + return false } export const REMOTE_APP = [ @@ -19,28 +19,28 @@ export const REMOTE_APP = [ name: CHROME, title: i18n.t(`applications.applicationsType.${CHROME}`), type: 'primary', - can: isValidateLicense, + has: isValidateLicense, callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: CHROME, category: REMOTEAPP_CATEGORY }}) } }, { name: MYSQL_WORKBENCH, title: i18n.t(`applications.applicationsType.${MYSQL_WORKBENCH}`), type: 'primary', - can: isValidateLicense, + has: isValidateLicense, callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: MYSQL_WORKBENCH, category: REMOTEAPP_CATEGORY }}) } }, { name: VMWARE_CLIENT, title: i18n.t(`applications.applicationsType.${VMWARE_CLIENT}`), type: 'primary', - can: isValidateLicense, + has: isValidateLicense, callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: VMWARE_CLIENT, category: REMOTEAPP_CATEGORY }}) } }, { name: CUSTOM, title: i18n.t(`applications.applicationsType.${CUSTOM}`), type: 'primary', - can: isValidateLicense, + has: isValidateLicense, callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: CUSTOM, category: REMOTEAPP_CATEGORY }}) } } ] @@ -56,29 +56,29 @@ export const DATABASE = [ name: MYSQL, title: i18n.t(`applications.applicationsType.${MYSQL}`), type: 'primary', - can: true, - divided: true, + has: true, + divided: isValidateLicense, callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: MYSQL, category: DATABASE_CATEGORY }}) } }, { name: ORACLE, title: i18n.t(`applications.applicationsType.${ORACLE}`), type: 'primary', - can: isValidateLicense, + has: isValidateLicense, callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: ORACLE, category: DATABASE_CATEGORY }}) } }, { name: POSTGRESQL, title: i18n.t(`applications.applicationsType.${POSTGRESQL}`), type: 'primary', - can: isValidateLicense, + has: isValidateLicense, callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: POSTGRESQL, category: DATABASE_CATEGORY }}) } }, { name: MARIADB, title: i18n.t(`applications.applicationsType.${MARIADB}`), type: 'primary', - can: isValidateLicense, + has: isValidateLicense, callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: MARIADB, category: DATABASE_CATEGORY }}) } } ] @@ -92,7 +92,7 @@ export const CLOUD = [ title: i18n.t(`applications.applicationsType.${KUBERNETES}`), divided: true, type: 'primary', - can: true, + has: true, callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: KUBERNETES, category: CLOUD_CATEGORY }}) } } ] diff --git a/src/views/settings/License.vue b/src/views/settings/License.vue index 8d59853f1..ec0881bcd 100644 --- a/src/views/settings/License.vue +++ b/src/views/settings/License.vue @@ -83,7 +83,7 @@ export default { if (this.publicSettings.XPACK_ENABLED) { return this.publicSettings.XPACK_LICENSE_IS_VALID } - return true + return false }, cardTitle() { return ''