diff --git a/nezha-fronted/src/assets/css/font/iconfont.css b/nezha-fronted/src/assets/css/font/iconfont.css index 0f58266e9..0060aced5 100644 --- a/nezha-fronted/src/assets/css/font/iconfont.css +++ b/nezha-fronted/src/assets/css/font/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: "nz-icon"; /* Project id 2030432 */ - src: url('iconfont.woff2?t=1628678895024') format('woff2'), - url('iconfont.woff?t=1628678895024') format('woff'), - url('iconfont.ttf?t=1628678895024') format('truetype'); + src: url('iconfont.woff2?t=1628837277704') format('woff2'), + url('iconfont.woff?t=1628837277704') format('woff'), + url('iconfont.ttf?t=1628837277704') format('truetype'); } .nz-icon { @@ -13,6 +13,10 @@ -moz-osx-font-smoothing: grayscale; } +.nz-icon-reset:before { + content: "\e618"; +} + .nz-icon-yanzhengma:before { content: "\e736"; } diff --git a/nezha-fronted/src/assets/css/font/iconfont.ttf b/nezha-fronted/src/assets/css/font/iconfont.ttf index 04609c56c..6baf72767 100644 Binary files a/nezha-fronted/src/assets/css/font/iconfont.ttf and b/nezha-fronted/src/assets/css/font/iconfont.ttf differ diff --git a/nezha-fronted/src/assets/css/font/iconfont.woff b/nezha-fronted/src/assets/css/font/iconfont.woff index 1d4e1ff78..4fd9ea75a 100644 Binary files a/nezha-fronted/src/assets/css/font/iconfont.woff and b/nezha-fronted/src/assets/css/font/iconfont.woff differ diff --git a/nezha-fronted/src/assets/css/font/iconfont.woff2 b/nezha-fronted/src/assets/css/font/iconfont.woff2 index 8c10b8347..03f4aed08 100644 Binary files a/nezha-fronted/src/assets/css/font/iconfont.woff2 and b/nezha-fronted/src/assets/css/font/iconfont.woff2 differ diff --git a/nezha-fronted/src/assets/css/nzIcon.css b/nezha-fronted/src/assets/css/nzIcon.css index bc317d187..5f97a502b 100644 --- a/nezha-fronted/src/assets/css/nzIcon.css +++ b/nezha-fronted/src/assets/css/nzIcon.css @@ -1,8 +1,8 @@ @font-face { font-family: "nz-icon"; /* Project id 2030432 */ - src: url('./font/iconfont.woff2?t=1628678895024') format('woff2'), - url('./font/iconfont.woff?t=1628678895024') format('woff'), - url('./font/iconfont.ttf?t=1628678895024') format('truetype'); + src: url('./font/iconfont.woff2?t=1628837277704') format('woff2'), + url('./font/iconfont.woff?t=1628837277704') format('woff'), + url('./font/iconfont.ttf?t=1628837277704') format('truetype'); } .nz-icon { @@ -13,6 +13,10 @@ -moz-osx-font-smoothing: grayscale; } +.nz-icon-reset:before { + content: "\e618"; +} + .nz-icon-yanzhengma:before { content: "\e736"; } diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index 473f0b1e8..820a70855 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -574,6 +574,7 @@ const cn = { confirmOvertime: '确定关闭吗?', // Are you sure you want to delete? killTerm: '确认关闭 terminal 吗?', resetPrompt: '确认重置吗?', + resetMfa: '确认重置2FA吗?', confirmBatchDelete: '确定删除这{0}条数据吗?', assetConfirmDelete: '关联的Endpoint和告警将会被删除,确认删除吗?', zoomStatusPrompt: '您的浏览器目前处于缩放状态,页面可能会出现错位,建议100%大小。', @@ -725,7 +726,8 @@ const cn = { disable: '关闭', enableMfa: '开启', forceEnable: '强制开启', - mfaTitle: 'Two-Factor Authentication' + mfaTitle: 'Two-Factor Authentication', + resetMfa: '重置2FA' }, roles: { roles: '角色', diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 1961c9fb3..05a380f4f 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -582,6 +582,7 @@ const en = { confirmOvertime: "Are you sure it's off?", killTerm: 'Are you sure you want to kill terminal?', resetPrompt: 'Are you sure to reset?', + resetMfa: 'Are you sure to reset 2FA?', confirmBatchDelete: 'Are you sure to delete these {0} pieces of data', assetConfirmDelete: 'Related endpoints and alerts will be removed, are you sure you want to delete this asset?', // Related endpoints and alerts will be removed, are you sure you want to delete this asset? zoomStatusPrompt: 'Your browser is currently in zoom state, the page may appear dislocation, the proposed 100% size.', @@ -734,7 +735,8 @@ const en = { disable: 'Disable', enableMfa: 'Enable', forceEnable: 'Force enable', - mfaTitle: 'Two-Factor Authentication' + mfaTitle: 'Two-Factor Authentication', + resetMfa: 'Reset 2FA' }, roles: { roles: 'Role', diff --git a/nezha-fronted/src/components/common/table/settings/userTable.vue b/nezha-fronted/src/components/common/table/settings/userTable.vue index 023e0043f..813d2ef10 100644 --- a/nezha-fronted/src/components/common/table/settings/userTable.vue +++ b/nezha-fronted/src/components/common/table/settings/userTable.vue @@ -83,6 +83,7 @@ {{$t('overall.edit')}} {{$t('overall.delete')}} + {{$t('config.user.resetMfa')}} @@ -184,12 +185,16 @@ export default { /deep/ .el-tag.el-tag--mini{ border-radius: 10px; font-size: 12px; + line-height: 12px; + height: 12px; + vertical-align: middle; } .user-name-top{ color: #333; font-weight: 600; font-size: 14px; line-height: 14px; + vertical-align: middle; } .user-name-bottom{ color: #999999; diff --git a/nezha-fronted/src/components/page/config/user.vue b/nezha-fronted/src/components/page/config/user.vue index 33841a213..c12e08c9d 100644 --- a/nezha-fronted/src/components/page/config/user.vue +++ b/nezha-fronted/src/components/page/config/user.vue @@ -25,6 +25,7 @@ :height="mainTableHeight" :table-data="tableData" @del="del" + @reset_mfa="resetMfa" @edit="edit" @orderBy="tableDataSort" @reload="getTableData" @@ -46,7 +47,8 @@ import userBox from '@/components/common/rightBox/administration/userBox' import nzDataList from '@/components/common/table/nzDataList' import dataListMixin from '@/components/common/mixin/dataList' import userTable from '@/components/common/table/settings/userTable' - +import MessageBox from 'element-ui/packages/message-box/src/main' +import i18n from '@/components/common/i18n' export default { name: 'user', components: { @@ -121,6 +123,22 @@ export default { this.rightBox.show = true } }) + }, + resetMfa (row) { + MessageBox.confirm(i18n.t('tip.resetMfa'), { + confirmButtonText: i18n.t('tip.yes'), + cancelButtonText: i18n.t('tip.no'), + type: 'warning' + }).then(() => { + this.$delete('/sys/user/resetMfa', { ids: row.id }).then(res => { + if (res.code == 200) { + this.$message.success(this.$t('tip.resetSuccess')) + this.getTableData() + } else { + this.$message.error(res.msg) + } + }) + }) } } }