diff --git a/README.md b/README.md index 65e13619f..1c2a60559 100644 --- a/README.md +++ b/README.md @@ -46,12 +46,4 @@ server { ## License & Copyright -Copyright (c) 2014-2021 飞致云 FIT2CLOUD, All rights reserved. - -Licensed under The GNU General Public License version 2 (GPLv2) (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - -https://github.com/jumpserver/lina/blob/dev/LICENSE - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - +Be consistent with [jumpserver](https://github.com/jumpserver/jumpserver) diff --git a/src/components/AccountListTable/UpdateSecretInfo.vue b/src/components/AccountListTable/UpdateSecretInfo.vue index b05ac51ab..6e52ed4a7 100644 --- a/src/components/AccountListTable/UpdateSecretInfo.vue +++ b/src/components/AccountListTable/UpdateSecretInfo.vue @@ -21,6 +21,9 @@ + + + @@ -42,7 +45,8 @@ export default { return { authInfo: { password: '', - private_key: '' + private_key: '', + passphrase: '' } } }, @@ -54,6 +58,7 @@ export default { } if (this.authInfo.private_key !== '') { data.private_key = this.authInfo.private_key + data.passphrase = this.authInfo.passphrase } this.$axios.patch( `/api/v1/assets/accounts/${this.account.id}/`, diff --git a/src/components/AutoDataForm/utils.js b/src/components/AutoDataForm/utils.js index b8b467487..b8dbfeb09 100644 --- a/src/components/AutoDataForm/utils.js +++ b/src/components/AutoDataForm/utils.js @@ -18,6 +18,9 @@ export class FormFieldGenerator { }) } break + case 'multiple choice': + field.el.choices = fieldRemoteMeta['choices'] + break case 'datetime': type = 'date-picker' field.el = { diff --git a/src/components/DataActions/index.vue b/src/components/DataActions/index.vue index c09fda5fa..1d88919d6 100644 --- a/src/components/DataActions/index.vue +++ b/src/components/DataActions/index.vue @@ -15,7 +15,7 @@ @@ -12,6 +12,11 @@ import { mapGetters } from 'vuex' export default { name: 'Footer', + data() { + return { + curYear: this.$moment().year() || '' + } + }, computed: { ...mapGetters([ 'sidebar', diff --git a/src/router/accounts.js b/src/router/accounts.js index 436b0501b..2c02d371c 100644 --- a/src/router/accounts.js +++ b/src/router/accounts.js @@ -161,5 +161,54 @@ export default [ hidden: true } ] + }, + { + path: 'backup', + component: empty, + redirect: '', + meta: { title: i18n.t('xpack.AccountBackupPlan.AccountBackupPlan') }, + children: [ + { + path: '', + component: () => import('@/views/accounts/AccountBackupPlan/index.vue'), + name: 'AccountBackupPlanIndex', + meta: { title: i18n.t('xpack.AccountBackupPlan.AccountBackupPlan'), activeMenu: '/accounts/backup' } + }, + { + path: '', + component: () => import('@/views/accounts/AccountBackupPlan/AccountBackupPlanList.vue'), + name: 'AccountBackupPlanList', + meta: { title: i18n.t('xpack.AccountBackupPlan.AccountBackupPlan'), activeMenu: '/accounts/backup' }, + hidden: true + }, + { + path: 'create', + component: () => import('@/views/accounts/AccountBackupPlan/AccountBackupPlanCreateUpdate.vue'), + name: 'AccountBackupPlanCreate', + meta: { title: i18n.t('xpack.AccountBackupPlan.AccountBackupPlanCreate'), activeMenu: '/accounts/backup', action: 'create' }, + hidden: true + }, + { + path: ':id/update', + component: () => import('@/views/accounts/AccountBackupPlan/AccountBackupPlanCreateUpdate.vue'), + name: 'AccountBackupPlanUpdate', + meta: { title: i18n.t('xpack.AccountBackupPlan.AccountBackupPlanUpdate'), activeMenu: '/accounts/backup', action: 'update' }, + hidden: true + }, + { + path: ':id', + component: () => import('@/views/accounts/AccountBackupPlan/AccountBackupPlanDetail/index.vue'), + name: 'AccountBackupPlanDetail', + meta: { title: i18n.t('xpack.AccountBackupPlan.AccountBackupPlan'), activeMenu: '/accounts/backup' }, + hidden: true + }, + { + path: 'plan-execution/:id', + component: () => import('@/views/accounts/AccountBackupPlan/AccountBackupPlanDetail/AccountBackupPlanExecution/AccountBackupPlanExecutionDetail/index.vue'), + name: 'AccountBackupPlanExecutionDetail', + meta: { title: i18n.t('xpack.AccountBackupPlan.ExecutionDetail'), activeMenu: '/accounts/backup' }, + hidden: true + } + ] } ] diff --git a/src/views/accounts/AccountBackupPlan/AccountBackupPlanCreateUpdate.vue b/src/views/accounts/AccountBackupPlan/AccountBackupPlanCreateUpdate.vue new file mode 100644 index 000000000..66c30893b --- /dev/null +++ b/src/views/accounts/AccountBackupPlan/AccountBackupPlanCreateUpdate.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/src/views/accounts/AccountBackupPlan/AccountBackupPlanDetail/AccountBackupPlanExecution/AccountBackupPlanExecutionDetail/AccountBackupPlanExecutionInfo.vue b/src/views/accounts/AccountBackupPlan/AccountBackupPlanDetail/AccountBackupPlanExecution/AccountBackupPlanExecutionDetail/AccountBackupPlanExecutionInfo.vue new file mode 100644 index 000000000..467e99d23 --- /dev/null +++ b/src/views/accounts/AccountBackupPlan/AccountBackupPlanDetail/AccountBackupPlanExecution/AccountBackupPlanExecutionDetail/AccountBackupPlanExecutionInfo.vue @@ -0,0 +1,60 @@ + + + + + diff --git a/src/views/accounts/AccountBackupPlan/AccountBackupPlanDetail/AccountBackupPlanExecution/AccountBackupPlanExecutionDetail/index.vue b/src/views/accounts/AccountBackupPlan/AccountBackupPlanDetail/AccountBackupPlanExecution/AccountBackupPlanExecutionDetail/index.vue new file mode 100644 index 000000000..64e715fcd --- /dev/null +++ b/src/views/accounts/AccountBackupPlan/AccountBackupPlanDetail/AccountBackupPlanExecution/AccountBackupPlanExecutionDetail/index.vue @@ -0,0 +1,49 @@ + + + + + diff --git a/src/views/accounts/AccountBackupPlan/AccountBackupPlanDetail/AccountBackupPlanExecution/AccountBackupPlanExecutionList.vue b/src/views/accounts/AccountBackupPlan/AccountBackupPlanDetail/AccountBackupPlanExecution/AccountBackupPlanExecutionList.vue new file mode 100644 index 000000000..ba00c372f --- /dev/null +++ b/src/views/accounts/AccountBackupPlan/AccountBackupPlanDetail/AccountBackupPlanExecution/AccountBackupPlanExecutionList.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/src/views/accounts/AccountBackupPlan/AccountBackupPlanDetail/AccountBackupPlanInfo.vue b/src/views/accounts/AccountBackupPlan/AccountBackupPlanDetail/AccountBackupPlanInfo.vue new file mode 100644 index 000000000..d219dfcc0 --- /dev/null +++ b/src/views/accounts/AccountBackupPlan/AccountBackupPlanDetail/AccountBackupPlanInfo.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/src/views/accounts/AccountBackupPlan/AccountBackupPlanDetail/index.vue b/src/views/accounts/AccountBackupPlan/AccountBackupPlanDetail/index.vue new file mode 100644 index 000000000..8de584869 --- /dev/null +++ b/src/views/accounts/AccountBackupPlan/AccountBackupPlanDetail/index.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/src/views/accounts/AccountBackupPlan/AccountBackupPlanList.vue b/src/views/accounts/AccountBackupPlan/AccountBackupPlanList.vue new file mode 100644 index 000000000..ee202a41f --- /dev/null +++ b/src/views/accounts/AccountBackupPlan/AccountBackupPlanList.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/src/views/accounts/AccountBackupPlan/components/FormTypeField.vue b/src/views/accounts/AccountBackupPlan/components/FormTypeField.vue new file mode 100644 index 000000000..aa7c62573 --- /dev/null +++ b/src/views/accounts/AccountBackupPlan/components/FormTypeField.vue @@ -0,0 +1,92 @@ + + + + + diff --git a/src/views/accounts/AccountBackupPlan/fields.js b/src/views/accounts/AccountBackupPlan/fields.js new file mode 100644 index 000000000..33c513a37 --- /dev/null +++ b/src/views/accounts/AccountBackupPlan/fields.js @@ -0,0 +1,57 @@ +import i18n from '@/i18n/i18n' +import { CronTab } from '@/components' + +var validatorInterval = (rule, value, callback) => { + if (parseInt(value) < 1) { + return callback(new Error(i18n.t('xpack.ChangeAuthPlan.validatorMessage.EnsureThisValueIsGreaterThanOrEqualTo1'))) + } + callback() +} + +function getFields() { + const recipients = { + el: { + value: [], + ajax: { + url: '/api/v1/users/users/?fields_size=mini', + transformOption: (item) => { + return { label: item.name + '(' + item.username + ')', value: item.id } + } + } + } + } + + const is_periodic = { + type: 'switch' + } + + const crontab = { + type: 'cronTab', + component: CronTab, + label: i18n.t('xpack.RegularlyPerform'), + hidden: (formValue) => { + return formValue.is_periodic === false + }, + helpText: i18n.t('xpack.HelpText.CrontabOfCreateUpdatePage') + } + + const interval = { + label: i18n.t('xpack.CyclePerform'), + hidden: (formValue) => { + return formValue.is_periodic === false + }, + helpText: i18n.t('xpack.HelpText.IntervalOfCreateUpdatePage'), + rules: [ + { validator: validatorInterval } + ] + } + + return { + is_periodic: is_periodic, + crontab: crontab, + interval: interval, + recipients: recipients + } +} + +export default getFields diff --git a/src/views/accounts/AccountBackupPlan/index.vue b/src/views/accounts/AccountBackupPlan/index.vue new file mode 100644 index 000000000..760969229 --- /dev/null +++ b/src/views/accounts/AccountBackupPlan/index.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanCreateUpdate.vue b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanCreateUpdate.vue index 521654f9b..1cb752d65 100644 --- a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanCreateUpdate.vue +++ b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanCreateUpdate.vue @@ -19,7 +19,7 @@ export default { [this.$t('common.Basic'), ['name']], [this.$t('xpack.Asset'), ['username', 'assets', 'nodes']], [this.$t('xpack.ChangeAuthPlan.PasswordStrategy'), ['is_password', 'password_strategy', 'password', 'password_rules']], - [this.$t('xpack.ChangeAuthPlan.SecretKeyStrategy'), ['is_ssh_key', 'ssh_key_strategy', 'private_key']], + [this.$t('xpack.ChangeAuthPlan.SecretKeyStrategy'), ['is_ssh_key', 'ssh_key_strategy', 'private_key', 'passphrase']], [this.$t('xpack.Timer'), ['is_periodic', 'crontab', 'interval']], [this.$t('common.Other'), ['recipients', 'comment']] ], @@ -38,6 +38,7 @@ export default { username: fields.username, assets: fields.assets, password: fields.password, + passphrase: fields.passphrase, password_rules: fields.asset_password_rules, private_key: fields.private_key, nodes: fields.nodes, diff --git a/src/views/accounts/ChangeAuthPlan/fields.js b/src/views/accounts/ChangeAuthPlan/fields.js index e33110ec5..acebb09f9 100644 --- a/src/views/accounts/ChangeAuthPlan/fields.js +++ b/src/views/accounts/ChangeAuthPlan/fields.js @@ -1,6 +1,6 @@ import i18n from '@/i18n/i18n' -import { AssetSelect, CronTab } from '@/components' -import Select2 from '@/components/FormFields/Select2' +import { AssetSelect, CronTab, UploadKey } from '@/components' +import { Select2 } from '@/components/FormFields/Select2' import { Required } from '@/components/DataForm/rules' var validatorInterval = (rule, value, callback) => { @@ -103,6 +103,12 @@ function getFields() { ] } + const passphrase = { + hidden: (formValue) => { + return formValue.is_ssh_key === false + } + } + const asset_password_rules = { type: 'group', items: generatePasswordRulesItemsFields('asset') @@ -114,11 +120,7 @@ function getFields() { } const private_key = { - el: { - type: 'textarea', - placeholder: '-----BEGIN OPENSSH PRIVATE KEY-----', - autosize: { minRows: 3 } - }, + component: UploadKey, hidden: (formValue) => { return formValue.is_ssh_key === false }, @@ -128,6 +130,8 @@ function getFields() { } const recipients = { + label: i18n.t('xpack.ChangeAuthPlan.Addressee'), + helpText: i18n.t('xpack.ChangeAuthPlan.OnlyMailSend'), el: { value: [], ajax: { @@ -153,10 +157,12 @@ function getFields() { } const is_password = { + label: i18n.t('xpack.ChangeAuthPlan.ChangePassword'), type: 'switch' } const is_ssh_key = { + label: i18n.t('xpack.ChangeAuthPlan.ModifySSHKey'), type: 'switch' } @@ -225,6 +231,7 @@ function getFields() { password_strategy: password_strategy, ssh_key_strategy: ssh_key_strategy, private_key: private_key, + passphrase: passphrase, asset_password_rules: asset_password_rules, database_password_rules: database_password_rules, nodes: nodes, diff --git a/src/views/applications/DatabaseApp/DatabaseAppList.vue b/src/views/applications/DatabaseApp/DatabaseAppList.vue index ac3cf04f3..9750da02e 100644 --- a/src/views/applications/DatabaseApp/DatabaseAppList.vue +++ b/src/views/applications/DatabaseApp/DatabaseAppList.vue @@ -11,6 +11,41 @@ export default { }, data() { const vm = this + const appType = [ + { + name: 'mysql', + title: 'MySQL', + has: true, + group: this.$t('assets.RDBProtocol') + }, + { + name: 'postgresql', + title: 'PostgreSQL', + has: this.$store.getters.hasValidLicense + }, + { + name: 'mariadb', + title: 'MariaDB', + type: 'primary', + has: this.$store.getters.hasValidLicense + }, + { + name: 'oracle', + title: 'Oracle', + has: this.$store.getters.hasValidLicense + }, + { + name: 'sqlserver', + title: 'SQLServer', + has: this.$store.getters.hasValidLicense + }, + { + name: 'redis', + title: 'Redis', + has: true, + group: this.$t('assets.NoSQLProtocol') + } + ] return { tableConfig: { url: '/api/v1/applications/applications/?category=db', @@ -24,8 +59,7 @@ export default { }, columnsMeta: { type_display: { - label: this.$t('applications.type'), - width: '120px' + label: this.$t('applications.type') }, 'attrs.host': { label: this.$t('applications.host'), @@ -69,43 +103,37 @@ export default { hasBulkDelete: true, createRoute: 'DatabaseAppCreate', searchConfig: { - exclude: ['category', 'type'] + exclude: ['category', 'type'], + options: [ + { + value: 'type', + label: this.$t('applications.type'), + children: this.getAppType(appType) + } + ] }, moreCreates: { callback: (item) => { vm.$router.push({ name: 'DatabaseAppCreate', query: { type: item.name.toLowerCase() }}) }, - dropdown: [ - { - name: 'MySQL', - title: 'MySQL', - has: true - }, - { - name: 'PostgreSQL', - title: 'PostgreSQL', - has: this.$store.getters.hasValidLicense - }, - { - name: 'MariaDB', - title: 'MariaDB', - type: 'primary', - has: this.$store.getters.hasValidLicense - }, - { - name: 'Oracle', - title: 'Oracle', - has: this.$store.getters.hasValidLicense - }, - { - name: 'SQLServer', - title: 'SQLServer', - has: this.$store.getters.hasValidLicense - } - ] + dropdown: appType } } } + }, + methods: { + getAppType(arr) { + const searchAppType = [] + if (arr.length < 1) return searchAppType + arr.forEach((i) => { + const option = { + value: i.name, + label: i.title + } + searchAppType.push(option) + }) + return searchAppType + } } } diff --git a/src/views/applications/KubernetesApp/KubernetesAppList.vue b/src/views/applications/KubernetesApp/KubernetesAppList.vue index 628ba7ded..b572a77d3 100644 --- a/src/views/applications/KubernetesApp/KubernetesAppList.vue +++ b/src/views/applications/KubernetesApp/KubernetesAppList.vue @@ -15,12 +15,12 @@ export default { tableConfig: { url: '/api/v1/applications/applications/?category=cloud', columns: [ - 'name', 'type', 'attrs.cluster', + 'name', 'type_display', 'attrs.cluster', 'created_by', 'date_created', 'date_updated', 'comment', 'org_name', 'actions' ], columnsShow: { min: ['name', 'actions'], - default: ['name', 'type', 'attrs.cluster', 'comment', 'actions'] + default: ['name', 'type_display', 'attrs.cluster', 'comment', 'actions'] }, columnsMeta: { 'attrs.cluster': { @@ -29,8 +29,8 @@ export default { comment: { width: '340px' }, - type: { - width: '140px' + type_display: { + label: this.$t('applications.type') }, actions: { prop: 'actions', diff --git a/src/views/applications/RemoteApp/RemoteAppList.vue b/src/views/applications/RemoteApp/RemoteAppList.vue index ede2da147..9d3733c25 100644 --- a/src/views/applications/RemoteApp/RemoteAppList.vue +++ b/src/views/applications/RemoteApp/RemoteAppList.vue @@ -17,17 +17,16 @@ export default { tableConfig: { url: '/api/v1/applications/applications/?category=remote_app', columns: [ - 'name', 'type', 'attrs.asset', + 'name', 'type_display', 'attrs.asset', 'created_by', 'date_created', 'date_updated', 'comment', 'org_name', 'actions' ], columnsShow: { min: ['name', 'actions'], - default: ['name', 'type', 'attrs.asset', 'comment', 'actions'] + default: ['name', 'type_display', 'attrs.asset', 'comment', 'actions'] }, columnsMeta: { - type: { - displayKey: 'get_type_display', - width: '140px' + type_display: { + label: this.$t('applications.type') }, 'attrs.asset': { label: this.$t('assets.Assets'), @@ -67,7 +66,14 @@ export default { hasImport: false, // createRoute: 'RemoteAppCreate', searchConfig: { - exclude: ['category', 'type'] + exclude: ['category', 'type'], + options: [ + { + value: 'type', + label: this.$t('applications.type'), + children: this.getCreateAppType() + } + ] }, moreCreates: { dropdown: this.getCreateAppType(), @@ -85,6 +91,8 @@ export default { const item = { ...REMOTE_APP_TYPE_META_MAP[value] } item.can = true item.has = true + item.value = item.name + item.label = item.title extraMoreActions.push(item) } return extraMoreActions diff --git a/src/views/assets/Asset/AssetList.vue b/src/views/assets/Asset/AssetList.vue index f49772b42..999339f19 100644 --- a/src/views/assets/Asset/AssetList.vue +++ b/src/views/assets/Asset/AssetList.vue @@ -88,7 +88,7 @@ export default { 'protocols', 'platform', 'hardware_info', 'model', 'cpu_model', 'cpu_cores', 'cpu_count', 'cpu_vcpus', 'disk_info', 'disk_total', 'memory', 'os', 'os_arch', - 'os_version', 'number', 'vendor', 'sn', + 'os_version', 'number', 'vendor', 'sn', 'is_active', 'connectivity', 'labels_display', 'created_by', 'date_created', 'comment', 'org_name', 'actions' ], diff --git a/src/views/assets/Domain/DomainDetail/GatewayCreateUpdate.vue b/src/views/assets/Domain/DomainDetail/GatewayCreateUpdate.vue index 0cb3f5d02..ede129f7a 100644 --- a/src/views/assets/Domain/DomainDetail/GatewayCreateUpdate.vue +++ b/src/views/assets/Domain/DomainDetail/GatewayCreateUpdate.vue @@ -20,7 +20,7 @@ export default { }, fields: [ [this.$t('common.Basic'), ['name', 'ip', 'port', 'protocol', 'domain']], - [this.$t('assets.Auth'), ['username', 'password', 'private_key']], + [this.$t('assets.Auth'), ['username', 'password', 'private_key', 'passphrase']], [this.$t('common.Other'), ['is_active', 'comment']] ], fieldsMeta: { diff --git a/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/database.vue b/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/database.vue index b63947a76..c86f9b612 100644 --- a/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/database.vue +++ b/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/database.vue @@ -25,8 +25,8 @@ export default { auto_push: false }, fields: [ - [this.$t('common.Basic'), ['name', 'login_mode', 'username', 'priority', 'protocol']], - [this.$t('common.Auth'), ['password']], + [this.$t('common.Basic'), ['name', 'username', 'priority', 'protocol']], + [this.$t('common.Auth'), ['login_mode', 'password']], [this.$t('common.Command filter'), ['cmd_filters']], [this.$t('common.Other'), ['comment']] ], diff --git a/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/index.vue b/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/index.vue index 985a407cd..9fb5d5bc3 100644 --- a/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/index.vue +++ b/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/index.vue @@ -47,6 +47,7 @@ export default { case 'postgresql': case 'mariadb': case 'sqlserver': + case 'redis': return Database case 'k8s': return K8S diff --git a/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/ssh.vue b/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/ssh.vue index 6ae281d49..aa0c978be 100644 --- a/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/ssh.vue +++ b/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/ssh.vue @@ -31,7 +31,7 @@ export default { }, fields: [ [this.$t('common.Basic'), ['name', 'protocol', 'username', 'username_same_with_user']], - [this.$t('common.Auth'), ['login_mode', 'auto_generate_key', 'password', 'private_key']], + [this.$t('common.Auth'), ['login_mode', 'auto_generate_key', 'password', 'private_key', 'passphrase']], [this.$t('assets.AutoPush'), ['auto_push', 'sudo', 'shell', 'home', 'system_groups']], [this.$t('common.Command filter'), ['cmd_filters']], [this.$t('assets.UserSwitch'), ['su_enabled', 'su_from']], @@ -41,6 +41,7 @@ export default { login_mode: fields.login_mode, username: fields.username, private_key: fields.private_key, + passphrase: fields.passphrase, username_same_with_user: fields.username_same_with_user, auto_generate_key: fields.auto_generate_key, protocol: fields.protocol, diff --git a/src/views/assets/SystemUser/SystemUserCreateUpdate/fields.js b/src/views/assets/SystemUser/SystemUserCreateUpdate/fields.js index fbf5cb0b8..3abaac907 100644 --- a/src/views/assets/SystemUser/SystemUserCreateUpdate/fields.js +++ b/src/views/assets/SystemUser/SystemUserCreateUpdate/fields.js @@ -31,6 +31,8 @@ function getFields() { this.fieldsMeta.username.rules[0].required = false } else if (form.username_same_with_user) { this.fieldsMeta.username.rules[0].required = false + } else if (form.protocol === 'redis') { + this.fieldsMeta.username.rules[0].required = false } else { this.fieldsMeta.username.rules[0].required = true } @@ -152,7 +154,6 @@ function getFields() { } const password = { - helpText: this.$t('assets.PasswordHelpMessage'), component: UpdateToken, hidden: form => { if (form.login_mode !== 'auto' || form.auto_generate_key) { @@ -164,6 +165,16 @@ function getFields() { } } + const passphrase = { + component: UpdateToken, + hidden: (form) => { + if (form.login_mode !== 'auto') { + return true + } + return form.auto_generate_key === true + } + } + const system_groups = { label: this.$t('assets.LinuxUserAffiliateGroup'), hidden: (item) => !item.auto_push || item.username_same_with_user, @@ -184,6 +195,7 @@ function getFields() { auto_push: auto_push, update_password: update_password, password: password, + passphrase: passphrase, system_groups: system_groups, type: type } diff --git a/src/views/assets/SystemUser/SystemUserList/CommonUserList.vue b/src/views/assets/SystemUser/SystemUserList/CommonUserList.vue index 8fd7a8acd..252d51639 100644 --- a/src/views/assets/SystemUser/SystemUserList/CommonUserList.vue +++ b/src/views/assets/SystemUser/SystemUserList/CommonUserList.vue @@ -105,7 +105,7 @@ export default { title: 'MySQL', type: 'primary', has: true, - group: this.$t('assets.DatabaseProtocol') + group: this.$t('assets.RDBProtocol') }, { name: 'PostgreSQL', @@ -131,6 +131,13 @@ export default { type: 'primary', has: this.$store.getters.hasValidLicense }, + { + name: 'Redis', + title: 'Redis', + type: 'primary', + has: true, + group: this.$t('assets.NoSQLProtocol') + }, { name: 'K8S', title: 'K8S', diff --git a/src/views/perms/ApplicationPermission/ApplicationPermissionCreateUpdate.vue b/src/views/perms/ApplicationPermission/ApplicationPermissionCreateUpdate.vue index 20c071b2b..fae819744 100644 --- a/src/views/perms/ApplicationPermission/ApplicationPermissionCreateUpdate.vue +++ b/src/views/perms/ApplicationPermission/ApplicationPermissionCreateUpdate.vue @@ -11,6 +11,7 @@ + + diff --git a/yarn.lock b/yarn.lock index 586cba155..43a279e32 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10793,6 +10793,13 @@ vue-jest@^3.0.4: tsconfig "^7.0.0" vue-template-es2015-compiler "^1.6.0" +vue-json-editor@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/vue-json-editor/-/vue-json-editor-1.4.3.tgz#004c9037ac91f16dd8fc558c9914e5f33a41d71c" + integrity sha512-st9HdXBgCnyEmmfWrZQiKzp4KuYXzmYVUNDn5h6Fa18MrrGS1amnyUFyv7hQFsNBDW27B7BKkdGOqszYT1srAg== + dependencies: + vue "^2.2.6" + vue-loader@^15.7.0: version "15.9.1" resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.9.1.tgz#bd2ab8f3d281e51d7b81d15390a58424d142243e" @@ -10850,6 +10857,11 @@ vue@2.6.11: resolved "https://registry.npm.taobao.org/vue/download/vue-2.6.11.tgz?cache=0&sync_timestamp=1587135947786&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue%2Fdownload%2Fvue-2.6.11.tgz#76594d877d4b12234406e84e35275c6d514125c5" integrity sha1-dllNh31LEiNEBuhONSdcbVFBJcU= +vue@^2.2.6: + version "2.6.14" + resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.14.tgz#e51aa5250250d569a3fbad3a8a5a687d6036e235" + integrity sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ== + vuejs-logger@^1.5.4: version "1.5.4" resolved "https://registry.npm.taobao.org/vuejs-logger/download/vuejs-logger-1.5.4.tgz#c8bb12ed29ca90b8087144a44ad852d9bd170c6e"