fix: 面板设置输入增加校验及提示信息 (#1193)

This commit is contained in:
ssongliu 2023-05-30 15:46:58 +08:00 committed by GitHub
parent 7a66e71215
commit 34ac685e65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 9 deletions

View file

@ -1000,9 +1000,10 @@ const message = {
allowIPsHelper:
'After setting the authorized IP address, only the IP address in the setting can access the 1Panel service',
allowIPsWarnning:
'After setting the authorized IP address, only the IP address in the setting can access the 1Panel service. Do you want to continue?',
'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: 'e.g. 172.16.10.111',
allowIPEgs:
'If multiple ip authorizations exist, newlines need to be displayed. For example, \n172.16.10.111 \n172.16.10.111',
mfa: 'MFA',
mfaAlert:
'MFA password is generated based on the current time. Please ensure that the server time is synchronized.',

View file

@ -1016,7 +1016,7 @@ const message = {
allowIPsHelper: '设置授权 IP 仅有设置中的 IP 可以访问 1Panel 服务',
allowIPsWarnning: '设置授权 IP 仅有设置中的 IP 可以访问 1Panel 服务是否继续',
allowIPsHelper1: '授权 IP 为空时则取消授权 IP',
allowIPEgs: '172.16.10.111',
allowIPEgs: '当存在多个授权 IP 需要换行显示 \n172.16.10.111 \n172.16.10.111',
mfa: '两步验证',
mfaAlert: '两步验证密码是基于当前时间生成请确保服务器时间已同步',
mfaHelper: '开启后会验证手机应用验证码',

View file

@ -10,12 +10,12 @@
<el-option :label="$t('commons.status.success')" value="Success"></el-option>
<el-option :label="$t('commons.status.failed')" value="Failed"></el-option>
</el-select>
<el-button type="success" plain style="margin-left: 25px">
<el-tag type="success" size="large" style="margin-left: 15px">
{{ $t('commons.status.success') }} {{ successfulCount }}
</el-button>
<el-button type="danger" plain style="margin-left: 5px">
</el-tag>
<el-tag type="danger" size="large" style="margin-left: 5px">
{{ $t('commons.status.failed') }} {{ faliedCount }}
</el-button>
</el-tag>
</el-col>
<el-col :xs="24" :sm="8" :md="8" :lg="8" :xl="8">
<TableSetting @search="search()" />

View file

@ -7,7 +7,7 @@
<el-form ref="formRef" label-position="top" :model="form" @submit.prevent v-loading="loading">
<el-row type="flex" justify="center">
<el-col :span="22">
<el-form-item :label="$t('setting.syncSite')" prop="ntpSite" :rules="Rules.requiredInput">
<el-form-item :label="$t('setting.syncSite')" prop="ntpSite" :rules="Rules.domain">
<el-input v-model="form.ntpSite" />
<el-button type="primary" link class="tagClass" @click="form.ntpSite = 'pool.ntp.org'">
{{ $t('website.default') }}

View file

@ -14,6 +14,7 @@
:autosize="{ minRows: 8, maxRows: 10 }"
v-model="allowIPs"
/>
<span class="input-help">{{ $t('setting.allowIPsHelper1') }}</span>
</el-form-item>
</el-col>
</el-row>
@ -57,7 +58,7 @@ const onSavePort = async () => {
let ips = allowIPs.value.split('\n');
for (const ip of ips) {
if (ip) {
if (checkIp(ip)) {
if (checkIp(ip) || ip === '0.0.0.0') {
MsgError(i18n.global.t('firewall.addressFormatError'));
return false;
}