From 9184026ca00a71b9c2b1ecdc5330b4b158a0fe5a Mon Sep 17 00:00:00 2001 From: feng626 <1304903146@qq.com> Date: Thu, 18 Nov 2021 22:56:51 +0800 Subject: [PATCH 01/20] =?UTF-8?q?perf:=20ip=E9=BB=91=E7=99=BD=E5=90=8D?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 2 ++ src/i18n/langs/en.json | 2 ++ src/views/settings/Security/AuthLimit.vue | 32 ++++++++++++++++++++--- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 5da1a3d89..5e175899c 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -242,6 +242,8 @@ "ReLogin": "重新登录" }, "common": { + "UserLoginLimit": "用户登录限制", + "IPLoginLimit": "IP登录限制", "Setting": "设置", "ViewMore": "查看更多", "Announcement": "公告", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 023180c58..fce6389a0 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -236,6 +236,8 @@ "ReLogin": "Re-Login" }, "common": { + "UserLoginLimit": "User login limit", + "IPLoginLimit": "IP login limit", "Setting": "Setting", "ViewMore": "View more", "Announcement": "Announcement", diff --git a/src/views/settings/Security/AuthLimit.vue b/src/views/settings/Security/AuthLimit.vue index 79c47d285..7073cd488 100644 --- a/src/views/settings/Security/AuthLimit.vue +++ b/src/views/settings/Security/AuthLimit.vue @@ -43,22 +43,48 @@ export default { }, visible: false, fields: [ - 'SECURITY_LOGIN_LIMIT_COUNT', 'SECURITY_LOGIN_LIMIT_TIME', 'SECURITY_LOGIN_IP_BLACK_LIST', - 'USER_LOGIN_SINGLE_MACHINE_ENABLED', 'ONLY_ALLOW_EXIST_USER_AUTH', - 'ONLY_ALLOW_AUTH_FROM_SOURCE' + [ + this.$t('common.UserLoginLimit'), + [ + 'SECURITY_LOGIN_LIMIT_COUNT', + 'SECURITY_LOGIN_LIMIT_TIME' + ] + ], + [ + this.$t('common.IPLoginLimit'), + [ + 'SECURITY_LOGIN_IP_LIMIT_COUNT', + 'SECURITY_LOGIN_IP_LIMIT_TIME', + 'SECURITY_LOGIN_IP_WHITE_LIST', + 'SECURITY_LOGIN_IP_BLACK_LIST' + ] + ], + [ + this.$t('common.Other'), + [ + 'USER_LOGIN_SINGLE_MACHINE_ENABLED', + 'ONLY_ALLOW_EXIST_USER_AUTH', + 'ONLY_ALLOW_AUTH_FROM_SOURCE' + ] + ] ], successUrl: { name: 'Settings', params: { activeMenu: 'EmailContent' }}, fieldsMeta: { }, afterGetFormValue(validValues) { validValues.SECURITY_LOGIN_IP_BLACK_LIST = validValues.SECURITY_LOGIN_IP_BLACK_LIST.toString() + validValues.SECURITY_LOGIN_IP_WHITE_LIST = validValues.SECURITY_LOGIN_IP_WHITE_LIST.toString() return validValues }, cleanFormValue(value) { const ipBlackList = value.SECURITY_LOGIN_IP_BLACK_LIST + const ipWhiltList = value.SECURITY_LOGIN_IP_WHITE_LIST if (!Array.isArray(ipBlackList)) { value.SECURITY_LOGIN_IP_BLACK_LIST = ipBlackList ? ipBlackList.split(',') : [] } + if (!Array.isArray(ipWhiltList)) { + value.SECURITY_LOGIN_IP_WHITE_LIST = ipWhiltList ? ipWhiltList.split(',') : [] + } return value }, url: '/api/v1/settings/setting/?category=security' From 96c10f698039b72643a845414c9743949711e2df Mon Sep 17 00:00:00 2001 From: Michael Bai Date: Fri, 19 Nov 2021 18:46:48 +0800 Subject: [PATCH 02/20] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 5e175899c..7975e709a 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -243,7 +243,7 @@ }, "common": { "UserLoginLimit": "用户登录限制", - "IPLoginLimit": "IP登录限制", + "IPLoginLimit": "IP 登录限制", "Setting": "设置", "ViewMore": "查看更多", "Announcement": "公告", From 7132c869f74d21192e88ae616604ac497d51fe0b Mon Sep 17 00:00:00 2001 From: fit2cloud--chenqiao <64881607+FIT2CLOUD-chenqiao@users.noreply.github.com> Date: Wed, 24 Nov 2021 11:23:29 +0800 Subject: [PATCH 03/20] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93sqlserver=E7=9A=84=E6=89=98=E7=AE=A1=20(#1194?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 1 + src/i18n/langs/en.json | 1 + src/views/applications/DatabaseApp/DatabaseAppList.vue | 5 +++++ .../SystemUserCreateUpdate/CommonUser/index.vue | 1 + .../assets/SystemUser/SystemUserList/CommonUserList.vue | 6 ++++++ src/views/perms/const.js | 8 ++++++++ src/views/tickets/RequestApplicationPerm/CreateUpdate.vue | 4 ++++ 7 files changed, 26 insertions(+) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 7975e709a..09ed550c2 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -48,6 +48,7 @@ "oracle": "Oracle", "postgresql": "PostgreSQL", "mariadb": "MariaDB", + "sqlserver": "SQLServer", "k8s": "Kubernetes" }, "applicationsCategory": { diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index fce6389a0..f5f5532bf 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -43,6 +43,7 @@ "oracle": "Oracle", "postgresql": "PostgreSQL", "mariadb": "MariaDB", + "sqlserver": "SQLServer", "k8s": "kubernetes" }, "applicationsCategory": { diff --git a/src/views/applications/DatabaseApp/DatabaseAppList.vue b/src/views/applications/DatabaseApp/DatabaseAppList.vue index 446ed5f1d..62802486a 100644 --- a/src/views/applications/DatabaseApp/DatabaseAppList.vue +++ b/src/views/applications/DatabaseApp/DatabaseAppList.vue @@ -93,6 +93,11 @@ export default { name: 'Oracle', title: 'Oracle', has: this.$store.getters.hasValidLicense + }, + { + name: 'SQLServer', + title: 'SQLServer', + has: this.$store.getters.hasValidLicense } ] } diff --git a/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/index.vue b/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/index.vue index 1c685d28a..d951601ed 100644 --- a/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/index.vue +++ b/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/index.vue @@ -44,6 +44,7 @@ export default { case 'oracle': case 'postgresql': case 'mariadb': + case 'sqlserver': return Database case 'k8s': return K8S diff --git a/src/views/assets/SystemUser/SystemUserList/CommonUserList.vue b/src/views/assets/SystemUser/SystemUserList/CommonUserList.vue index 7b7d73ce7..2ae076c30 100644 --- a/src/views/assets/SystemUser/SystemUserList/CommonUserList.vue +++ b/src/views/assets/SystemUser/SystemUserList/CommonUserList.vue @@ -125,6 +125,12 @@ export default { type: 'primary', has: this.$store.getters.hasValidLicense }, + { + name: 'SQLServer', + title: 'SQLServer', + type: 'primary', + has: this.$store.getters.hasValidLicense + }, { name: 'K8S', title: 'K8S', diff --git a/src/views/perms/const.js b/src/views/perms/const.js index e3de5a421..633a54224 100644 --- a/src/views/perms/const.js +++ b/src/views/perms/const.js @@ -47,6 +47,7 @@ export const ORACLE = 'oracle' export const POSTGRESQL = 'postgresql' export const MARIADB = 'mariadb' export const DATABASE_CATEGORY = 'db' +export const SQLSERVER = 'sqlserver' export const DATABASE = [ { @@ -77,6 +78,13 @@ export const DATABASE = [ type: 'primary', category: DATABASE_CATEGORY, has: hasLicence + }, + { + name: SQLSERVER, + title: i18n.t(`applications.applicationsType.${SQLSERVER}`), + type: 'primary', + category: DATABASE_CATEGORY, + has: hasLicence } ] diff --git a/src/views/tickets/RequestApplicationPerm/CreateUpdate.vue b/src/views/tickets/RequestApplicationPerm/CreateUpdate.vue index ff9589629..533d574b6 100644 --- a/src/views/tickets/RequestApplicationPerm/CreateUpdate.vue +++ b/src/views/tickets/RequestApplicationPerm/CreateUpdate.vue @@ -128,6 +128,10 @@ export default { { label: 'MariaDB', value: 'mariadb' + }, + { + label: 'SQLServer', + value: 'sqlserver' } ] }, From 09f91941d51154ead9be8e04aefe09d075d9ebdd Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Wed, 17 Nov 2021 15:37:40 +0800 Subject: [PATCH 04/20] =?UTF-8?q?feat:=20=E4=BA=91=E7=AE=A1=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=94=AF=E6=8C=81OpenStack=E7=A7=81=E6=9C=89=E4=BA=91?= =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 1 + src/i18n/langs/en.json | 1 + src/views/xpack/Cloud/Account/AccountList.vue | 6 +++++- src/views/xpack/Cloud/const.js | 6 ++++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 09ed550c2..100835bb4 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -1294,6 +1294,7 @@ "Qcloud": "腾讯云", "QingyunPrivatecloud": "青云私有云", "HuaweiPrivatecloud": "华为私有云", + "OpenStack": "OpenStack", "GCP": "谷歌云", "AWS_China": "AWS(中国)", "AWS_Int": "AWS(国际)", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index f5f5532bf..f7e2503ae 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -1250,6 +1250,7 @@ "Qcloud": "Tencent Cloud", "QingyunPrivatecloud": "Qingyun Private Cloud", "HuaweiPrivatecloud": "Huawei Private Cloud", + "OpenStack": "OpenStack", "GCP": "Google Cloud Platform", "AWS_China": "AWS(China)", "AWS_Int": "AWS(International)", diff --git a/src/views/xpack/Cloud/Account/AccountList.vue b/src/views/xpack/Cloud/Account/AccountList.vue index 192f0f765..8cb5c6019 100644 --- a/src/views/xpack/Cloud/Account/AccountList.vue +++ b/src/views/xpack/Cloud/Account/AccountList.vue @@ -4,7 +4,7 @@ + + diff --git a/src/components/TableFormatters/index.js b/src/components/TableFormatters/index.js index 178ff07a3..18413ed41 100644 --- a/src/components/TableFormatters/index.js +++ b/src/components/TableFormatters/index.js @@ -10,6 +10,7 @@ import ShowKeyFormatter from '@/components/TableFormatters/ShowKeyFormatter' import DialogDetailFormatter from './DialogDetailFormatter' import EditableInputFormatter from './EditableInputFormatter' import StatusFormatter from './StatusFormatter' +import TagsFormatter from './TagsFormatter' export default { DetailFormatter, @@ -23,7 +24,8 @@ export default { DialogDetailFormatter, ArrayFormatter, EditableInputFormatter, - StatusFormatter + StatusFormatter, + TagsFormatter } export { @@ -38,5 +40,6 @@ export { DialogDetailFormatter, ArrayFormatter, EditableInputFormatter, - StatusFormatter + StatusFormatter, + TagsFormatter } diff --git a/src/views/assets/Asset/AssetList.vue b/src/views/assets/Asset/AssetList.vue index 91897d462..5e07e1771 100644 --- a/src/views/assets/Asset/AssetList.vue +++ b/src/views/assets/Asset/AssetList.vue @@ -51,7 +51,7 @@ + + diff --git a/src/userviews/users/UserProfile/index.vue b/src/userviews/users/UserProfile/index.vue index bc9eb7504..f248cfb18 100644 --- a/src/userviews/users/UserProfile/index.vue +++ b/src/userviews/users/UserProfile/index.vue @@ -11,6 +11,7 @@ import { GenericDetailPage } from '@/layout/components' import ProfileInfo from './ProfileInfo' import ProfileUpdate from './ProfileUpdate' import PasswordUpdate from './PasswordUpdate' +import SecretKeyUpdate from './SecretKeyUpdate' import SSHUpdate from './SSHUpdate' export default { @@ -19,6 +20,7 @@ export default { ProfileInfo, ProfileUpdate, PasswordUpdate, + SecretKeyUpdate, SSHUpdate }, data() { @@ -55,6 +57,10 @@ export default { title: this.$t('users.SSHKeySetting'), name: 'SSHUpdate', disabled: !this.$store.state.users.profile.can_public_key_auth + }, + { + title: this.$t('users.FileEncryptionPassword'), + name: 'SecretKeyUpdate' } ] }, diff --git a/src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/AppChangeAuthPlanCreateUpdate.vue b/src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/AppChangeAuthPlanCreateUpdate.vue index 830302468..91bb468a2 100644 --- a/src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/AppChangeAuthPlanCreateUpdate.vue +++ b/src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/AppChangeAuthPlanCreateUpdate.vue @@ -20,7 +20,7 @@ export default { [this.$t('assets.Applications'), ['category', 'type', 'apps', 'system_users']], [this.$t('xpack.ChangeAuthPlan.PasswordStrategy'), ['password_strategy', 'password', 'password_rules']], [this.$t('xpack.Timer'), ['is_periodic', 'crontab', 'interval']], - [this.$t('common.Other'), ['comment']] + [this.$t('common.Other'), ['recipients', 'comment']] ], initial: { type: this.$route.query.type, @@ -81,7 +81,8 @@ export default { is_periodic: fields.is_periodic, password_strategy: fields.password_strategy, crontab: fields.crontab, - interval: fields.interval + interval: fields.interval, + recipients: fields.recipients }, createSuccessNextRoute: { name: 'ChangeAuthPlanIndex' }, updateSuccessNextRoute: { name: 'ChangeAuthPlanIndex' }, diff --git a/src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/ChangeAuthPlanDetail/AppChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue b/src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/ChangeAuthPlanDetail/AppChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue index 53871540b..c32284179 100644 --- a/src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/ChangeAuthPlanDetail/AppChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue +++ b/src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/ChangeAuthPlanDetail/AppChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue @@ -55,8 +55,12 @@ export default { { key: this.$t('xpack.ChangeAuthPlan.DateStart'), value: toSafeLocalDateStr(this.object.date_start) + }, + { + key: this.$t('xpack.ChangeAuthPlan.MailRecipient'), + value: this.object.recipients ? this.object.recipients.map( + i => `${i[0]}` + `${i[1] ? ': ' + this.$t('xpack.ChangeAuthPlan.ContainAttachment') : ''}`).join(', ') : '' } - ] } } diff --git a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanCreateUpdate.vue b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanCreateUpdate.vue index f84470b49..521654f9b 100644 --- a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanCreateUpdate.vue +++ b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanCreateUpdate.vue @@ -21,7 +21,7 @@ export default { [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.Timer'), ['is_periodic', 'crontab', 'interval']], - [this.$t('common.Other'), ['comment']] + [this.$t('common.Other'), ['recipients', 'comment']] ], initial: { password_strategy: 'custom', @@ -47,7 +47,8 @@ export default { password_strategy: fields.password_strategy, ssh_key_strategy: fields.ssh_key_strategy, crontab: fields.crontab, - interval: fields.interval + interval: fields.interval, + recipients: fields.recipients }, createSuccessNextRoute: { name: 'ChangeAuthPlanIndex' }, updateSuccessNextRoute: { name: 'ChangeAuthPlanIndex' }, diff --git a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue index 036683dfa..f20a9df4d 100644 --- a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue +++ b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue @@ -51,8 +51,12 @@ export default { { key: this.$t('xpack.ChangeAuthPlan.DateStart'), value: toSafeLocalDateStr(this.object.date_start) + }, + { + key: this.$t('xpack.ChangeAuthPlan.MailRecipient'), + value: this.object.recipients ? this.object.recipients.map( + i => `${i[0]}` + `${i[1] ? ': ' + this.$t('xpack.ChangeAuthPlan.ContainAttachment') : ''}`).join(', ') : '' } - ] } } diff --git a/src/views/accounts/ChangeAuthPlan/fields.js b/src/views/accounts/ChangeAuthPlan/fields.js index 549900d7b..e33110ec5 100644 --- a/src/views/accounts/ChangeAuthPlan/fields.js +++ b/src/views/accounts/ChangeAuthPlan/fields.js @@ -127,6 +127,18 @@ 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 nodes = { label: i18n.t('xpack.Node'), el: { @@ -220,7 +232,8 @@ function getFields() { is_periodic: is_periodic, is_ssh_key: is_ssh_key, crontab: crontab, - interval: interval + interval: interval, + recipients: recipients } } From 669bd50bfa0ef2f64ae492fb4f02987beb3ad23e Mon Sep 17 00:00:00 2001 From: halo Date: Sun, 5 Dec 2021 20:08:36 +0800 Subject: [PATCH 14/20] =?UTF-8?q?feat:=20=E7=AB=99=E5=86=85=E4=BF=A1?= =?UTF-8?q?=E4=B8=80=E9=94=AE=E5=B7=B2=E8=AF=BB=E5=B7=B2=E7=BB=8F=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 2 ++ src/i18n/langs/en.json | 2 ++ .../components/NavHeader/SiteMessages.vue | 35 ++++++++++++++++--- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 2c77ffb9f..914fe7da2 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -1216,6 +1216,8 @@ "HasRead": "是否已读", "Sender": "发送人", "MarkAsRead": "标记已读", + "OneClickRead": "一键已读", + "OneClickReadMsg": "你确定要将已加载的信息标记为已读吗?", "NoUnreadMsg": "暂无未读消息", "SiteMessage": "站内信", "SMS": "短信" diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 7ee3c3f81..ab6565590 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -1177,6 +1177,8 @@ "HasRead": "Has read", "Sender": "Sender", "MarkAsRead": "Mark as read", + "OneClickRead": "One Click Read", + "OneClickReadMsg": "Are you sure you want to mark the loaded information as read?", "NoUnreadMsg": "No unread messages", "SiteMessage": "Site messages", "SMS": "SMS" diff --git a/src/layout/components/NavHeader/SiteMessages.vue b/src/layout/components/NavHeader/SiteMessages.vue index d9497a326..a3ed670b0 100644 --- a/src/layout/components/NavHeader/SiteMessages.vue +++ b/src/layout/components/NavHeader/SiteMessages.vue @@ -14,6 +14,12 @@ size="25%" @open="getMessages" > +
+ {{ $t('notifications.SiteMessage') }} + +
{{ formatDate(msg.date_created) }} - @@ -52,7 +58,7 @@ :title="''" :close-on-click-modal="false" :confirm-title="$t('notifications.MarkAsRead')" - @confirm="markAsRead(currentMsg)" + @confirm="markAsRead([currentMsg])" @cancel="cancelRead" >
@@ -120,9 +126,26 @@ export default { return this.$moment(d).fromNow() } }, - markAsRead(msg) { + oneClickRead(msgs) { + this.$confirm(this.$t('notifications.OneClickReadMsg'), this.$t('common.Info'), { + type: 'warning', + confirmButtonClass: 'el-button--danger', + beforeClose: async(action, instance, done) => { + if (action !== 'confirm') return done() + this.markAsRead(msgs) + done() + } + }).catch(() => { + /* 取消*/ + }) + }, + markAsRead(msgs) { const url = `/api/v1/notifications/site-message/mark-as-read/` - this.$axios.patch(url, { ids: [msg.id] }).then(res => { + const msgIds = [] + for (const item of msgs) { + msgIds.push(item.id) + } + this.$axios.patch(url, { ids: msgIds }).then(res => { this.msgDetailVisible = false this.getMessages() }).catch(err => { @@ -178,6 +201,10 @@ export default { margin-bottom: 0; padding-top: 10px; font-size: 16px; + .msg-list-all-read-btn { + font-size: 12px; + float: right; + } } .el-drawer__body { From ee2c15ccd5f9a65c7f59786446ea3052bcb932de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9C=E6=80=80=E7=A3=8A=E2=80=9D?= <2280131253@qq.com> Date: Mon, 8 Nov 2021 16:42:47 +0800 Subject: [PATCH 15/20] =?UTF-8?q?feat:=20=E6=9F=A5=E8=AF=A2=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=BF=9D=E5=AD=98=E5=9C=A8url=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ListTable/index.vue | 2 +- src/components/TagSearch/index.vue | 63 ++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/src/components/ListTable/index.vue b/src/components/ListTable/index.vue index 626e65ec2..e79d69d10 100644 --- a/src/components/ListTable/index.vue +++ b/src/components/ListTable/index.vue @@ -91,7 +91,7 @@ export default { }, search(attrs) { this.$emit('TagSearch', attrs) - return this.dataTable.search(attrs, true) + return this.dataTable?.search(attrs, true) }, filter(attrs) { this.$emit('TagFilter', attrs) diff --git a/src/components/TagSearch/index.vue b/src/components/TagSearch/index.vue index 7f12806a9..6850fe3fc 100644 --- a/src/components/TagSearch/index.vue +++ b/src/components/TagSearch/index.vue @@ -100,6 +100,25 @@ export default { // }, // deep: true // } + options: { + handler(val) { + if (val && val.length > 0) { + const routeFilter = this.checkInTableColumns() + const asFilterTags = _.cloneDeep(this.filterTags) + this.filterTags = { + ...asFilterTags, + ...routeFilter + } + if (Object.keys(routeFilter).length > 0) { + setTimeout(() => { + return this.$emit('tagSearch', this.filterMaps) + }, 490) + } + } + }, + immediate: true, + deep: true + } }, mounted() { setTimeout(() => { @@ -111,6 +130,39 @@ export default { // this.$nextTick(() => this.$emit('tagSearch', this.filterMaps)) }, methods: { + // 判断url中的查询条件 + checkInTableColumns() { + const routeQuery = this.$route?.query + const routeQueryKeys = Object.keys(routeQuery) + const keys = {} + if (routeQueryKeys.length < 1) return keys + if (routeQueryKeys.length > 0) { + for (let i = 0; i < routeQueryKeys.length; i++) { + const key = routeQueryKeys[i] + const valueDecode = decodeURI(routeQuery[key]) + const isSearch = key !== 'search' + for (let k = 0, len = this.options.length; k < len; k++) { + const cur = this.options[k] + if (key === cur.value || !isSearch) { + const curChildren = cur.children || [] + keys[key] = { + key, + label: isSearch ? cur.label : '', + value: valueDecode + } + if (isSearch && curChildren.length > 0) { + curChildren.forEach(item => { + if (valueDecode === item.value) { + keys[key].valueLabel = item.label + } + }) + } + } + } + } + } + return keys + }, getValueLabel(key, value) { for (const field of this.options) { if (field.value !== key) { @@ -143,6 +195,7 @@ export default { this.$nextTick(() => this.$refs.Cascade.handleClear()) }, handleTagClose(evt) { + this.checkUrlFilds(evt) this.$delete(this.filterTags, evt) this.$emit('tagSearch', this.filterMaps) return true @@ -154,6 +207,11 @@ export default { const tag = { key: this.filterKey, label: this.keyLabel, value: this.filterValue, valueLabel: this.valueLabel } this.$set(this.filterTags, this.filterKey, tag) this.$emit('tagSearch', this.filterMaps) + + let newQuery = _.cloneDeep(this.$route.query) + newQuery = { ...newQuery, [this.filterKey]: encodeURI(this.filterValue) } + this.$router.replace({ query: newQuery }) + this.filterKey = '' this.filterValue = '' this.valueLabel = '' @@ -180,6 +238,11 @@ export default { this.filterKey = v.key this.filterValue = v.value this.$refs.SearchInput.focus() + }, + // 删除查询条件时改变url + checkUrlFilds(evt) { + const newQuery = _.omit(this.$route.query, evt) + this.$router.replace({ query: newQuery }) } } } From 0b710326314112b7dc5ee35ddb9e178dd8cf5aa8 Mon Sep 17 00:00:00 2001 From: feng626 <1304903146@qq.com> Date: Wed, 8 Dec 2021 17:26:01 +0800 Subject: [PATCH 16/20] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8A=A0?= =?UTF-8?q?=E5=AF=86=E6=96=87=E4=BB=B6=E8=B7=B3=E8=BD=AC=E5=91=BD=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/userviews/users/UserProfile/SecretKeyUpdate.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/userviews/users/UserProfile/SecretKeyUpdate.vue b/src/userviews/users/UserProfile/SecretKeyUpdate.vue index a6da711f1..513c2b4c0 100644 --- a/src/userviews/users/UserProfile/SecretKeyUpdate.vue +++ b/src/userviews/users/UserProfile/SecretKeyUpdate.vue @@ -1,13 +1,13 @@ @@ -45,15 +45,16 @@ export default { type: 'password' } } - }, - updateSuccessNextRoute: { - path: '/' } } }, methods: { submitMethod() { return 'put' + }, + onPerformSuccess() { + this.$refs.GenericCreateUpdateForm.$refs.form.$refs.dataForm.resetForm('form') + this.$message.success(this.$t('common.updateSuccessMsg')) } } } From 3eff78817b1b6c6e25cd861db52050aae3962141 Mon Sep 17 00:00:00 2001 From: jiangweidong <80373698+fit2cloud-jiangweidong@users.noreply.github.com> Date: Thu, 9 Dec 2021 16:01:46 +0800 Subject: [PATCH 17/20] pr@dev@feat_saml2_auth (#1216) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 支持saml2协议单点登录认证 * fix: 合并遗漏的翻译文件 * fix: 合并遗漏的翻译文件 --- src/i18n/langs/cn.json | 8 +++ src/i18n/langs/en.json | 9 ++- src/views/settings/Auth/CAS.vue | 2 +- src/views/settings/Auth/SAML2.vue | 94 +++++++++++++++++++++++++++++++ src/views/settings/Auth/index.vue | 7 ++- 5 files changed, 117 insertions(+), 3 deletions(-) create mode 100644 src/views/settings/Auth/SAML2.vue diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 914fe7da2..4e9f74cc3 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -246,6 +246,7 @@ "UserLoginLimit": "用户登录限制", "IPLoginLimit": "IP 登录限制", "Setting": "设置", + "Certificate": "证书", "ViewMore": "查看更多", "Announcement": "公告", "Logging": "日志记录", @@ -903,6 +904,13 @@ "authLdapSearchOu": "用户OU", "authLdapServerUri": "LDAP地址", "authLdapUserAttrMap": "用户属性映射", + "authUserAttrMap": "用户属性映射", + "authUserAttrMapHelpText": "映射关系 {idp:sp}", + "SAML2": "SAML2", + "enableSAML2Auth": "开启 SAML2 认证", + "SAML2Auth": "SAML2 认证", + "authSAML2Xml": "IDP metadata XML", + "authSAML2MetadataUrl": "IDP metadata URL", "authCASAttrMap": "用户属性映射", "SignaturesAndTemplates": "Signatures and Templates", "unselectedUser": "没有选择用户", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index ab6565590..e58bfb5ef 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -240,6 +240,7 @@ "UserLoginLimit": "User login limit", "IPLoginLimit": "IP login limit", "Setting": "Setting", + "Certificate": "Certificate", "ViewMore": "View more", "Announcement": "Announcement", "Logging": "Logging", @@ -881,7 +882,13 @@ "authLdapSearchOu": "User OU", "authLdapServerUri": "LDAP server", "authLdapUserAttrMap": "User attr map", - "authCASAttrMap": "User attr map", + "authUserAttrMap": "User attr map", + "authUserAttrMapHelpText": "Mapping relationship { idp_key: sp_key}", + "SAML2": "SAML2", + "enableSAML2Auth": "Enable SAML2 Auth", + "SAML2Auth": "SAML2 Auth", + "authSAML2Xml": "IDP metadata XML", + "authSAML2MetadataUrl": "IDP metadata URL", "unselectedUser": "Unselected user", "auto": "Auto", "basicSetting": "Basic setting", diff --git a/src/views/settings/Auth/CAS.vue b/src/views/settings/Auth/CAS.vue index 93c6efaea..07c4cd260 100644 --- a/src/views/settings/Auth/CAS.vue +++ b/src/views/settings/Auth/CAS.vue @@ -40,7 +40,7 @@ export default { el: { type: 'textarea' }, - label: this.$t('setting.authCASAttrMap'), + label: this.$t('setting.authUserAttrMap'), rules: [JsonRequired] } }, diff --git a/src/views/settings/Auth/SAML2.vue b/src/views/settings/Auth/SAML2.vue new file mode 100644 index 000000000..da2ade674 --- /dev/null +++ b/src/views/settings/Auth/SAML2.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/src/views/settings/Auth/index.vue b/src/views/settings/Auth/index.vue index 0a3ac995f..fafb0c6a1 100644 --- a/src/views/settings/Auth/index.vue +++ b/src/views/settings/Auth/index.vue @@ -14,6 +14,7 @@ import DingTalk from './DingTalk' import FeiShu from './FeiShu' import WeCom from './WeCom' import SSO from './SSO' +import SAML2 from './SAML2' export default { name: 'Auth', @@ -29,7 +30,7 @@ export default { this.$t('setting.AuthMethod'), [ 'AUTH_CAS', 'AUTH_OPENID', 'AUTH_WECOM', 'AUTH_DINGTALK', 'AUTH_FEISHU', - 'AUTH_RADIUS', 'AUTH_SSO' + 'AUTH_RADIUS', 'AUTH_SSO', 'AUTH_SAML2' ] ], [ @@ -62,6 +63,10 @@ export default { AUTH_SSO: { component: SSO }, + AUTH_SAML2: { + component: SAML2, + label: this.$t('setting.SAML2Auth') + }, FORGOT_PASSWORD_URL: { on: { change([value], updateForm) { From 90adcaf8437f64a83a95486bebf4ac8d0fbecdeb Mon Sep 17 00:00:00 2001 From: Michael Bai Date: Thu, 9 Dec 2021 17:19:04 +0800 Subject: [PATCH 18/20] =?UTF-8?q?feat:=20=E5=91=BD=E4=BB=A4=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E6=94=AF=E6=8C=81=E5=A4=9A=E7=BB=B4=E5=BA=A6?= =?UTF-8?q?=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 1 + src/i18n/langs/en.json | 1 + .../CommandFilterCreateUpdate.vue | 60 ++++++++++++++++++- .../CommandFilterDetail/Rules.vue | 2 +- .../CommandFilter/CommandFilterList.vue | 24 +++++++- .../SystemUser/SystemUserDetail/Detail.vue | 1 - 6 files changed, 84 insertions(+), 5 deletions(-) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 4e9f74cc3..c6318947b 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -243,6 +243,7 @@ "ReLogin": "重新登录" }, "common": { + "Correlation": "关联", "UserLoginLimit": "用户登录限制", "IPLoginLimit": "IP 登录限制", "Setting": "设置", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index e58bfb5ef..28522c550 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -237,6 +237,7 @@ "ReLogin": "Re-Login" }, "common": { + "Correlation": "Correlation", "UserLoginLimit": "User login limit", "IPLoginLimit": "IP login limit", "Setting": "Setting", diff --git a/src/views/assets/CommandFilter/CommandFilterCreateUpdate.vue b/src/views/assets/CommandFilter/CommandFilterCreateUpdate.vue index 96916b03c..0b5dda092 100644 --- a/src/views/assets/CommandFilter/CommandFilterCreateUpdate.vue +++ b/src/views/assets/CommandFilter/CommandFilterCreateUpdate.vue @@ -4,6 +4,7 @@ + + diff --git a/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/vncAndTelnet.vue b/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/vnc.vue similarity index 100% rename from src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/vncAndTelnet.vue rename to src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/vnc.vue diff --git a/src/views/assets/SystemUser/SystemUserCreateUpdate/fields.js b/src/views/assets/SystemUser/SystemUserCreateUpdate/fields.js index 78f09cbb0..7443dbc19 100644 --- a/src/views/assets/SystemUser/SystemUserCreateUpdate/fields.js +++ b/src/views/assets/SystemUser/SystemUserCreateUpdate/fields.js @@ -104,6 +104,7 @@ function getFields() { } const cmd_filters = { + label: this.$t('assets.CmdFilter'), component: Select2, el: { multiple: true, From 6d4d82662943dfbf1acb962d2e221d8145953f8e Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 9 Dec 2021 20:43:25 +0800 Subject: [PATCH 20/20] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: 修改词 --- src/i18n/langs/cn.json | 2 ++ src/i18n/langs/en.json | 2 ++ src/views/xpack/Cloud/Account/AccountList.vue | 22 ++++++++++--------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index c6318947b..ae0adb384 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -243,6 +243,8 @@ "ReLogin": "重新登录" }, "common": { + "PrivateCloud": "私有云", + "PublicCloud": "公有云", "Correlation": "关联", "UserLoginLimit": "用户登录限制", "IPLoginLimit": "IP 登录限制", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 28522c550..647ff805d 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -237,6 +237,8 @@ "ReLogin": "Re-Login" }, "common": { + "PrivateCloud": "Private cloud", + "PublicCloud": "Public cloud", "Correlation": "Correlation", "UserLoginLimit": "User login limit", "IPLoginLimit": "IP login limit", diff --git a/src/views/xpack/Cloud/Account/AccountList.vue b/src/views/xpack/Cloud/Account/AccountList.vue index 8cb5c6019..0b47b7f58 100644 --- a/src/views/xpack/Cloud/Account/AccountList.vue +++ b/src/views/xpack/Cloud/Account/AccountList.vue @@ -64,6 +64,7 @@ export default { name: aliyun, title: ACCOUNT_PROVIDER_ATTRS_MAP[aliyun].title, type: 'primary', + group: this.$t('common.PublicCloud'), can: true }, { @@ -72,6 +73,10 @@ export default { type: 'primary', can: true }, + { + name: huaweicloud, + title: ACCOUNT_PROVIDER_ATTRS_MAP[huaweicloud].title + }, { name: aws_china, title: ACCOUNT_PROVIDER_ATTRS_MAP[aws_china].title @@ -80,10 +85,6 @@ export default { name: aws_international, title: ACCOUNT_PROVIDER_ATTRS_MAP[aws_international].title }, - { - name: huaweicloud, - title: ACCOUNT_PROVIDER_ATTRS_MAP[huaweicloud].title - }, { name: azure, title: ACCOUNT_PROVIDER_ATTRS_MAP[azure].title @@ -93,12 +94,13 @@ export default { title: ACCOUNT_PROVIDER_ATTRS_MAP[azure_international].title }, { - name: vmware, - title: ACCOUNT_PROVIDER_ATTRS_MAP[vmware].title + name: gcp, + title: ACCOUNT_PROVIDER_ATTRS_MAP[gcp].title }, { - name: nutanix, - title: ACCOUNT_PROVIDER_ATTRS_MAP[nutanix].title + name: vmware, + group: this.$t('common.PrivateCloud'), + title: ACCOUNT_PROVIDER_ATTRS_MAP[vmware].title }, { name: qingcloud_private, @@ -113,8 +115,8 @@ export default { title: ACCOUNT_PROVIDER_ATTRS_MAP[openstack].title }, { - name: gcp, - title: ACCOUNT_PROVIDER_ATTRS_MAP[gcp].title + name: nutanix, + title: ACCOUNT_PROVIDER_ATTRS_MAP[nutanix].title } ] }