fix: 面板设置提示信息修改 (#1249)

This commit is contained in:
ssongliu 2023-06-05 13:47:21 +08:00 committed by GitHub
parent 5e7524e4f8
commit 3a17f4f29f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 7 deletions

View file

@ -121,6 +121,10 @@ func (u *SettingService) Update(key, value string) error {
global.LOG.Errorf("restart system for new time zone failed, err: %v", err)
}
}()
case "BindDomain":
if len(value) != 0 {
_ = global.SESSION.Clean()
}
case "UserName", "Password":
_ = global.SESSION.Clean()
}

View file

@ -996,15 +996,21 @@ const message = {
'The password must contain at least eight characters and contain at least three uppercase letters, lowercase letters, digits, and special characters',
bindDomain: 'Bind domain',
unBindDomain: 'Unbind domain',
unBindDomainHelper:
'The action of unbinding a domain name may cause system insecurity. Do you want to continue?',
bindDomainHelper:
'After the domain binding, only the domain in the setting can be used to access 1Panel service',
bindDomainHelper1: 'If the binding domain is empty, the binding of the domain is cancelled',
bindDomainWarnning:
'If the binding domain is empty, the binding of the domain is cancelled. Do you want to continue?',
bindDomainWarning:
'After domain binding, you will be logged out and can only access 1Panel service through the domain name specified in the settings. Do you want to continue?',
allowIPs: 'Authorized IP',
unAllowIPs: 'Unauthorized IP',
unAllowIPsWarning:
'Authorizing an empty IP will allow all IPs to access the system, which may cause system insecurity. Do you want to continue?',
allowIPsHelper:
'After setting the authorized IP address, only the IP address in the setting can access the 1Panel service',
allowIPsWarnning:
allowIPsWarning:
'After setting the authorized IP address, only the IP address in the setting can access the 1Panel service. Do you want to continue?',
allowIPsHelper1: 'If the authorized IP address is empty, the authorized IP address is canceled',
allowIPEgs:

View file

@ -1015,12 +1015,16 @@ const message = {
complexity: '密码复杂度验证',
complexityHelper: '开启后密码必须满足密码长度大于 8 位且包含字母数字及特殊字符',
bindDomain: '域名绑定',
unBindDomain: '域名解绑',
unBindDomainHelper: '解除域名绑定可能造成系统不安全是否继续',
bindDomainHelper: '设置域名绑定后仅能通过设置中域名访问 1Panel 服务',
bindDomainHelper1: '绑定域名为空时则取消域名绑定',
bindDomainWarnning: '设置域名绑定后仅能通过设置中域名访问 1Panel 服务是否继续',
bindDomainWarning: '设置域名绑定后将退出当前登录仅能通过设置中域名访问 1Panel 服务是否继续',
allowIPs: '授权 IP',
unAllowIPs: '取消授权',
unAllowIPsWarning: '授权 IP 为空将允许所有 IP 访问系统可能造成系统不安全是否继续',
allowIPsHelper: '设置授权 IP 仅有设置中的 IP 可以访问 1Panel 服务',
allowIPsWarnning: '设置授权 IP 仅有设置中的 IP 可以访问 1Panel 服务是否继续',
allowIPsWarning: '设置授权 IP 仅有设置中的 IP 可以访问 1Panel 服务是否继续',
allowIPsHelper1: '授权 IP 为空时则取消授权 IP',
allowIPEgs: '当存在多个授权 IP 需要换行显示 \n172.16.10.111 \n172.16.10.112',
mfa: '两步验证',

View file

@ -65,7 +65,9 @@ const onSave = async () => {
}
}
}
ElMessageBox.confirm(i18n.global.t('setting.allowIPsHelper'), i18n.global.t('setting.allowIPs'), {
let title = allowIPs.value ? i18n.global.t('setting.allowIPs') : i18n.global.t('setting.unAllowIPs');
let allow = allowIPs.value ? i18n.global.t('setting.allowIPsWarning') : i18n.global.t('setting.unAllowIPsWarning');
ElMessageBox.confirm(allow, title, {
confirmButtonText: i18n.global.t('commons.button.confirm'),
cancelButtonText: i18n.global.t('commons.button.cancel'),
type: 'info',

View file

@ -77,7 +77,11 @@ const onSavePort = async (formEl: FormInstance | undefined) => {
if (!formEl) return;
formEl.validate(async (valid) => {
if (!valid) return;
ElMessageBox.confirm(i18n.global.t('setting.bindDomainWarnning'), i18n.global.t('setting.bindDomain'), {
let title = form.bindDomain ? i18n.global.t('setting.bindDomain') : i18n.global.t('setting.unBindDomain');
let helper = form.bindDomain
? i18n.global.t('setting.bindDomainWarning')
: i18n.global.t('setting.unBindDomainHelper');
ElMessageBox.confirm(helper, title, {
confirmButtonText: i18n.global.t('commons.button.confirm'),
cancelButtonText: i18n.global.t('commons.button.cancel'),
type: 'info',