diff --git a/src/components/ActionsGroup/index.vue b/src/components/ActionsGroup/index.vue index 793df3be2..fc74c95e4 100644 --- a/src/components/ActionsGroup/index.vue +++ b/src/components/ActionsGroup/index.vue @@ -1,40 +1,15 @@ diff --git a/src/components/DataActions/index.vue b/src/components/DataActions/index.vue new file mode 100644 index 000000000..bcb7eae45 --- /dev/null +++ b/src/components/DataActions/index.vue @@ -0,0 +1,153 @@ + + + + + diff --git a/src/components/ListTable/TableAction/LeftSide.vue b/src/components/ListTable/TableAction/LeftSide.vue index aecf5b623..187c43d98 100644 --- a/src/components/ListTable/TableAction/LeftSide.vue +++ b/src/components/ListTable/TableAction/LeftSide.vue @@ -1,9 +1,14 @@ - - diff --git a/src/components/ListTable/formatters/index.js b/src/components/ListTable/formatters/index.js index 04de99acf..cdd835644 100644 --- a/src/components/ListTable/formatters/index.js +++ b/src/components/ListTable/formatters/index.js @@ -2,7 +2,6 @@ import DetailFormatter from './DetailFormatter' import DisplayFormatter from './DisplayFormatter' import BooleanFormatter from './ChoicesFormatter' import ActionsFormatter from './ActionsFormatter' -import CustomActionsFormatter from './CustomActionsFormatter' import DeleteActionFormatter from './DeleteActionFormatter' import DateFormatter from './DateFormatter' import SystemUserFormatter from './GrantedSystemUsersShowFormatter' @@ -15,7 +14,6 @@ export default { DisplayFormatter, BooleanFormatter, ActionsFormatter, - CustomActionsFormatter, DeleteActionFormatter, DateFormatter, SystemUserFormatter, @@ -29,7 +27,6 @@ export { DisplayFormatter, BooleanFormatter, ActionsFormatter, - CustomActionsFormatter, DeleteActionFormatter, DateFormatter, SystemUserFormatter, diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index edeb3fd21..d59ac95ca 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -2,6 +2,9 @@ "": "", "applications": { "": "", + "RemoteApp": "远程应用", + "Database": "数据库", + "Cloud": "云", "applicationsType": { "chrome": "Chrome", "mysql_workbench": "MySQL Workbench", @@ -170,7 +173,10 @@ "HomeHelpMessage": "默认家目录 /home/系统用户名: /home/username", "Home": "家目录", "LinuxUserAffiliateGroup": "用户附属组", - "ipDomain": "IP(域名)" + "ipDomain": "IP(域名)", + "HostProtocol": "主机协议", + "DatabaseProtocol": "数据库协议", + "OtherProtocol": "其它协议" }, "audits": { diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 9ae5d9637..772587479 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -2,6 +2,9 @@ "": "", "applications": { "": "", + "RemoteApp": "Remote app", + "Database": "Database", + "Cloud": "Cloud", "applicationsType": { "chrome": "Chrome", "mysql_workbench": "MySQL Workbench", @@ -170,7 +173,10 @@ "HomeHelpMessage": "Default home directory: /home/system username", "Home": "Home", "LinuxUserAffiliateGroup": "Linux user affiliate group", - "ipDomain": "IP(Domain)" + "ipDomain": "IP(Domain)", + "HostProtocol": "Host Protocol", + "DatabaseProtocol": "Database Protocol", + "Other Protocol": "Database Protocol" }, "audits": { "Hosts": "Host", diff --git a/src/views/applications/DatabaseApp/DatabaseAppList.vue b/src/views/applications/DatabaseApp/DatabaseAppList.vue index 896ec234a..fb79ca6ca 100644 --- a/src/views/applications/DatabaseApp/DatabaseAppList.vue +++ b/src/views/applications/DatabaseApp/DatabaseAppList.vue @@ -62,38 +62,38 @@ export default { hasImport: false, hasBulkDelete: false, createRoute: 'DatabaseAppCreate', - moreActionsTitle: this.$t('common.Create'), - moreActionsType: 'primary', - extraMoreActions: [ - { - name: 'MySQL', - title: 'MySQL', - type: 'primary', - has: true, - callback: this.createMysql.bind(this) - }, - { - name: 'PostgreSQL', - title: 'PostgreSQL', - type: 'primary', - has: this.isValidateLicense, - callback: this.createPostgreSQL.bind(this) - }, - { - name: 'MariaDB', - title: 'MariaDB', - type: 'primary', - has: this.isValidateLicense, - callback: this.createMariaDB.bind(this) - }, - { - name: 'Oracle', - title: 'Oracle', - type: 'primary', - has: this.isValidateLicense, - callback: this.createOracle.bind(this) - } - ] + moreCreates: { + dropdown: [ + { + name: 'MySQL', + title: 'MySQL', + type: 'primary', + has: true, + callback: this.createMysql.bind(this) + }, + { + name: 'PostgreSQL', + title: 'PostgreSQL', + type: 'primary', + has: this.isValidateLicense, + callback: this.createPostgreSQL.bind(this) + }, + { + name: 'MariaDB', + title: 'MariaDB', + type: 'primary', + has: this.isValidateLicense, + callback: this.createMariaDB.bind(this) + }, + { + name: 'Oracle', + title: 'Oracle', + type: 'primary', + has: this.isValidateLicense, + callback: this.createOracle.bind(this) + } + ] + } } } }, diff --git a/src/views/applications/RemoteApp/RemoteAppList.vue b/src/views/applications/RemoteApp/RemoteAppList.vue index e7c737b0c..3904b6bbb 100644 --- a/src/views/applications/RemoteApp/RemoteAppList.vue +++ b/src/views/applications/RemoteApp/RemoteAppList.vue @@ -64,25 +64,26 @@ export default { hasExport: false, hasImport: false, // createRoute: 'RemoteAppCreate', - moreActionsTitle: this.$t('common.Create'), - moreActionsType: 'primary', - extraMoreActions: this.genExtraMoreActions() + moreCreates: { + dropdown: this.getCreateAppType(), + callback: (app) => { + console.log('App: ', app) + vm.$router.push({ name: 'RemoteAppCreate', query: { type: app.name }}) + } + } } } }, methods: { - onCallback(type) { - this.$router.push({ name: 'RemoteAppCreate', query: { type: type }}) - }, - genExtraMoreActions() { + getCreateAppType() { const extraMoreActions = [] for (const value of ALL_TYPES) { const item = { ...REMOTE_APP_TYPE_META_MAP[value] } - item.type = 'primary' item.can = true - item.callback = this.onCallback.bind(this, value) + item.has = true extraMoreActions.push(item) } + console.log('core', extraMoreActions) return extraMoreActions } } diff --git a/src/views/assets/SystemUser/SystemUserCreate/database.vue b/src/views/assets/SystemUser/SystemUserCreate/database.vue new file mode 100644 index 000000000..423a14672 --- /dev/null +++ b/src/views/assets/SystemUser/SystemUserCreate/database.vue @@ -0,0 +1,154 @@ + + + + + diff --git a/src/views/assets/SystemUser/SystemUserCreate/k8s.vue b/src/views/assets/SystemUser/SystemUserCreate/k8s.vue new file mode 100644 index 000000000..f1dcc4fd1 --- /dev/null +++ b/src/views/assets/SystemUser/SystemUserCreate/k8s.vue @@ -0,0 +1,63 @@ + + + + + diff --git a/src/views/assets/SystemUser/SystemUserCreate/rdp.vue b/src/views/assets/SystemUser/SystemUserCreate/rdp.vue new file mode 100644 index 000000000..93644ccd1 --- /dev/null +++ b/src/views/assets/SystemUser/SystemUserCreate/rdp.vue @@ -0,0 +1,145 @@ + + + + + diff --git a/src/views/assets/SystemUser/SystemUserCreate/ssh.vue b/src/views/assets/SystemUser/SystemUserCreate/ssh.vue new file mode 100644 index 000000000..b1d366e5b --- /dev/null +++ b/src/views/assets/SystemUser/SystemUserCreate/ssh.vue @@ -0,0 +1,250 @@ + + + + + diff --git a/src/views/assets/SystemUser/SystemUserCreate/vncAndTelnet.vue b/src/views/assets/SystemUser/SystemUserCreate/vncAndTelnet.vue new file mode 100644 index 000000000..dd408f830 --- /dev/null +++ b/src/views/assets/SystemUser/SystemUserCreate/vncAndTelnet.vue @@ -0,0 +1,123 @@ + + + + + diff --git a/src/views/assets/SystemUser/SystemUserCreateUpdate.vue b/src/views/assets/SystemUser/SystemUserCreateUpdate.vue index c39b5bb89..12ef40a77 100644 --- a/src/views/assets/SystemUser/SystemUserCreateUpdate.vue +++ b/src/views/assets/SystemUser/SystemUserCreateUpdate.vue @@ -1,245 +1,47 @@ diff --git a/src/views/perms/ApplicationPermission/ApplicationPermissionList.vue b/src/views/perms/ApplicationPermission/ApplicationPermissionList.vue index 4c5520e6a..c0f406038 100644 --- a/src/views/perms/ApplicationPermission/ApplicationPermissionList.vue +++ b/src/views/perms/ApplicationPermission/ApplicationPermissionList.vue @@ -12,6 +12,7 @@ export default { GenericListPage }, data() { + const vm = this return { title: this.$t('route.ApplicationPermission'), tableConfig: { @@ -98,12 +99,16 @@ export default { // createRoute: 'RemoteAppCreate', moreActionsTitle: this.$t('common.Create'), moreActionsType: 'primary', - extraMoreActions: ApplicationTypes + moreCreates: { + callback: (option) => { + vm.$router.push({ name: 'SystemUserCreate', query: { protocol: option.type }}) + }, + dropdown: ApplicationTypes + } } } }, methods: { - } } diff --git a/src/views/perms/const.js b/src/views/perms/const.js index 37acec667..acfb95ea0 100644 --- a/src/views/perms/const.js +++ b/src/views/perms/const.js @@ -7,7 +7,7 @@ export const VMWARE_CLIENT = 'vmware_client' export const CUSTOM = 'custom' export const REMOTEAPP_CATEGORY = 'remote_app' -function isValidateLicense() { +function hasValidLicense() { if (store.getters.publicSettings.XPACK_ENABLED) { return store.getters.publicSettings.XPACK_LICENSE_IS_VALID } @@ -19,28 +19,30 @@ export const REMOTE_APP = [ name: CHROME, title: i18n.t(`applications.applicationsType.${CHROME}`), type: 'primary', - has: isValidateLicense, + group: i18n.t('applications.RemoteApp'), + divided: true, + has: hasValidLicense, callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: CHROME, category: REMOTEAPP_CATEGORY }}) } }, { name: MYSQL_WORKBENCH, title: i18n.t(`applications.applicationsType.${MYSQL_WORKBENCH}`), type: 'primary', - has: isValidateLicense, + has: hasValidLicense, 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', - has: isValidateLicense, + has: hasValidLicense, callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: VMWARE_CLIENT, category: REMOTEAPP_CATEGORY }}) } }, { name: CUSTOM, title: i18n.t(`applications.applicationsType.${CUSTOM}`), type: 'primary', - has: isValidateLicense, + has: hasValidLicense, callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: CUSTOM, category: REMOTEAPP_CATEGORY }}) } } ] @@ -57,28 +59,29 @@ export const DATABASE = [ title: i18n.t(`applications.applicationsType.${MYSQL}`), type: 'primary', has: true, - divided: isValidateLicense, + group: i18n.t('applications.Database'), + divided: true, callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: MYSQL, category: DATABASE_CATEGORY }}) } }, { name: ORACLE, title: i18n.t(`applications.applicationsType.${ORACLE}`), type: 'primary', - has: isValidateLicense, + has: hasValidLicense, callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: ORACLE, category: DATABASE_CATEGORY }}) } }, { name: POSTGRESQL, title: i18n.t(`applications.applicationsType.${POSTGRESQL}`), type: 'primary', - has: isValidateLicense, + has: hasValidLicense, callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: POSTGRESQL, category: DATABASE_CATEGORY }}) } }, { name: MARIADB, title: i18n.t(`applications.applicationsType.${MARIADB}`), type: 'primary', - has: isValidateLicense, + has: hasValidLicense, callback: function() { router.push({ name: 'ApplicationPermissionCreate', query: { type: MARIADB, category: DATABASE_CATEGORY }}) } } ] @@ -90,6 +93,7 @@ export const CLOUD = [ { name: KUBERNETES, title: i18n.t(`applications.applicationsType.${KUBERNETES}`), + group: i18n.t('applications.Cloud'), divided: true, type: 'primary', has: true,