diff --git a/src/components/AutoDataTable/index.vue b/src/components/AutoDataTable/index.vue
index 17358990e..85c6a05f4 100644
--- a/src/components/AutoDataTable/index.vue
+++ b/src/components/AutoDataTable/index.vue
@@ -64,7 +64,6 @@ export default {
}
},
computed: {
-
},
watch: {
config: {
@@ -211,7 +210,7 @@ export default {
},
generateTotalColumns() {
const config = _.cloneDeep(this.config)
- const columns = []
+ let columns = []
for (let col of config.columns) {
if (typeof col === 'object') {
columns.push(col)
@@ -220,6 +219,15 @@ export default {
columns.push(col)
}
}
+ columns = columns.filter(item => {
+ let has = item.has
+ if (has === undefined) {
+ has = true
+ } else if (typeof has === 'function') {
+ has = has()
+ }
+ return has
+ })
// 第一次初始化时记录 totalColumns
this.totalColumns = columns
config.columns = columns
diff --git a/src/views/applications/RemoteApp/RemoteAppList.vue b/src/views/applications/RemoteApp/RemoteAppList.vue
index 9d3733c25..4d2466a96 100644
--- a/src/views/applications/RemoteApp/RemoteAppList.vue
+++ b/src/views/applications/RemoteApp/RemoteAppList.vue
@@ -33,7 +33,12 @@ export default {
showOverflowTooltip: true,
formatter: function(row, column, cellValue, index) {
const route = { to: { name: 'AssetDetail', params: { id: cellValue }}}
- return { row.attrs.asset_info.hostname }
+ const hostname = row.attrs['asset_info'].hostname
+ if (vm.$hasPerm('assets.view_asset')) {
+ return { hostname }
+ } else {
+ return hostname
+ }
}
},
actions: {
diff --git a/src/views/applications/const.js b/src/views/applications/const.js
new file mode 100644
index 000000000..a1ad65145
--- /dev/null
+++ b/src/views/applications/const.js
@@ -0,0 +1,161 @@
+import i18n from '@/i18n/i18n'
+import store from '@/store'
+export const CHROME = 'chrome'
+export const MYSQL_WORKBENCH = 'mysql_workbench'
+export const VMWARE_CLIENT = 'vmware_client'
+export const CUSTOM = 'custom'
+export const REMOTEAPP_CATEGORY = 'remote_app'
+
+function hasLicence() {
+ return store.getters.hasValidLicense
+}
+
+export const REMOTE_APP = [
+ {
+ name: CHROME,
+ title: i18n.t(`applications.applicationsType.${CHROME}`),
+ type: 'primary',
+ group: i18n.t('applications.RemoteApp'),
+ category: REMOTEAPP_CATEGORY,
+ has: hasLicence
+ },
+ {
+ name: MYSQL_WORKBENCH,
+ title: i18n.t(`applications.applicationsType.${MYSQL_WORKBENCH}`),
+ type: 'primary',
+ category: REMOTEAPP_CATEGORY,
+ has: hasLicence
+ },
+ {
+ name: VMWARE_CLIENT,
+ title: i18n.t(`applications.applicationsType.${VMWARE_CLIENT}`),
+ type: 'primary',
+ category: REMOTEAPP_CATEGORY,
+ has: hasLicence
+ },
+ {
+ name: CUSTOM,
+ title: i18n.t(`applications.applicationsType.${CUSTOM}`),
+ type: 'primary',
+ category: REMOTEAPP_CATEGORY,
+ has: hasLicence
+ }
+]
+
+export const MYSQL = 'mysql'
+export const ORACLE = 'oracle'
+export const POSTGRESQL = 'postgresql'
+export const MARIADB = 'mariadb'
+export const DATABASE_CATEGORY = 'db'
+export const SQLSERVER = 'sqlserver'
+export const REDIS = 'redis'
+export const MONGODB = 'mongodb'
+
+export const DATABASE = [
+ {
+ name: MYSQL,
+ title: i18n.t(`applications.applicationsType.${MYSQL}`),
+ type: 'primary',
+ category: DATABASE_CATEGORY,
+ has: true,
+ group: i18n.t('applications.RDBProtocol')
+ },
+ {
+ name: MARIADB,
+ title: i18n.t(`applications.applicationsType.${MARIADB}`),
+ type: 'primary',
+ category: DATABASE_CATEGORY,
+ has: true
+ },
+ {
+ name: ORACLE,
+ title: i18n.t(`applications.applicationsType.${ORACLE}`),
+ type: 'primary',
+ category: DATABASE_CATEGORY,
+ has: hasLicence
+ },
+ {
+ name: POSTGRESQL,
+ title: i18n.t(`applications.applicationsType.${POSTGRESQL}`),
+ type: 'primary',
+ category: DATABASE_CATEGORY,
+ has: hasLicence
+ },
+ {
+ name: SQLSERVER,
+ title: i18n.t(`applications.applicationsType.${SQLSERVER}`),
+ type: 'primary',
+ category: DATABASE_CATEGORY,
+ has: hasLicence
+ },
+ {
+ name: REDIS,
+ title: i18n.t(`applications.applicationsType.${REDIS}`),
+ type: 'primary',
+ category: DATABASE_CATEGORY,
+ has: true,
+ group: i18n.t('applications.NoSQLProtocol')
+ },
+ {
+ name: MONGODB,
+ title: i18n.t(`applications.applicationsType.${MONGODB}`),
+ type: 'primary',
+ category: DATABASE_CATEGORY
+ }
+]
+
+export const AppPlanDatabase = [
+ {
+ name: MYSQL,
+ title: i18n.t(`applications.applicationsType.${MYSQL}`),
+ type: 'primary',
+ category: DATABASE_CATEGORY,
+ has: true,
+ group: i18n.t('applications.RDBProtocol')
+ },
+ {
+ name: ORACLE,
+ title: i18n.t(`applications.applicationsType.${ORACLE}`),
+ type: 'primary',
+ category: DATABASE_CATEGORY,
+ has: hasLicence
+ },
+ {
+ name: POSTGRESQL,
+ title: i18n.t(`applications.applicationsType.${POSTGRESQL}`),
+ type: 'primary',
+ category: DATABASE_CATEGORY,
+ has: hasLicence
+ },
+ {
+ name: MARIADB,
+ title: i18n.t(`applications.applicationsType.${MARIADB}`),
+ type: 'primary',
+ category: DATABASE_CATEGORY
+ },
+ {
+ name: SQLSERVER,
+ title: i18n.t(`applications.applicationsType.${SQLSERVER}`),
+ type: 'primary',
+ category: DATABASE_CATEGORY,
+ has: hasLicence
+ }
+]
+
+export const KUBERNETES = 'k8s'
+export const CLOUD_CATEGORY = 'cloud'
+
+export const CLOUD = [
+ {
+ name: KUBERNETES,
+ title: i18n.t(`applications.applicationsType.${KUBERNETES}`),
+ group: i18n.t('applications.Cloud'),
+ type: 'primary',
+ category: CLOUD_CATEGORY,
+ has: true
+ }
+]
+
+export const ApplicationTypes = [
+ ...REMOTE_APP, ...DATABASE, ...CLOUD
+]
diff --git a/src/views/assets/SystemUser/SystemUserList/CommonUserList.vue b/src/views/assets/SystemUser/SystemUserList/CommonUserList.vue
index ddc8cd1dd..4461835d1 100644
--- a/src/views/assets/SystemUser/SystemUserList/CommonUserList.vue
+++ b/src/views/assets/SystemUser/SystemUserList/CommonUserList.vue
@@ -9,6 +9,8 @@