chore: update style

This commit is contained in:
JustSong 2023-08-12 10:48:53 +08:00
parent 985895de97
commit 93b616fe3f
5 changed files with 23 additions and 21 deletions

View File

@ -109,10 +109,10 @@ func AddToken(c *gin.Context) {
}) })
return return
} }
if len(token.Name) == 0 || len(token.Name) > 20 { if len(token.Name) == 0 || len(token.Name) > 30 {
c.JSON(http.StatusOK, gin.H{ c.JSON(http.StatusOK, gin.H{
"success": false, "success": false,
"message": "令牌名称度必须在1-20之间", "message": "令牌名称长",
}) })
return return
} }
@ -171,10 +171,10 @@ func UpdateToken(c *gin.Context) {
}) })
return return
} }
if len(token.Name) == 0 || len(token.Name) > 20 { if len(token.Name) == 0 || len(token.Name) > 30 {
c.JSON(http.StatusOK, gin.H{ c.JSON(http.StatusOK, gin.H{
"success": false, "success": false,
"message": "令牌名称度必须在1-20之间", "message": "令牌名称长",
}) })
return return
} }

View File

@ -40,7 +40,7 @@
"一次兑换码批量生成的个数不能大于 100": "The number of redemption codes generated in a batch cannot be greater than 100", "一次兑换码批量生成的个数不能大于 100": "The number of redemption codes generated in a batch cannot be greater than 100",
"通过令牌「%s」使用模型 %s 消耗 %s模型倍率 %.2f,分组倍率 %.2f": "Using model %s with token %s consumes %s (model rate %.2f, group rate %.2f)", "通过令牌「%s」使用模型 %s 消耗 %s模型倍率 %.2f,分组倍率 %.2f": "Using model %s with token %s consumes %s (model rate %.2f, group rate %.2f)",
"当前分组负载已饱和,请稍后再试,或升级账户以提升服务质量。": "The current group load is saturated, please try again later, or upgrade your account to improve service quality.", "当前分组负载已饱和,请稍后再试,或升级账户以提升服务质量。": "The current group load is saturated, please try again later, or upgrade your account to improve service quality.",
"令牌名称长度必须在1-20之间": "The length of the token name must be between 1-20", "令牌名称过长": "Token name is too long",
"令牌已过期,无法启用,请先修改令牌过期时间,或者设置为永不过期": "The token has expired and cannot be enabled. Please modify the expiration time of the token, or set it to never expire.", "令牌已过期,无法启用,请先修改令牌过期时间,或者设置为永不过期": "The token has expired and cannot be enabled. Please modify the expiration time of the token, or set it to never expire.",
"令牌可用额度已用尽,无法启用,请先修改令牌剩余额度,或者设置为无限额度": "The available quota of the token has been used up and cannot be enabled. Please modify the remaining quota of the token, or set it to unlimited quota", "令牌可用额度已用尽,无法启用,请先修改令牌剩余额度,或者设置为无限额度": "The available quota of the token has been used up and cannot be enabled. Please modify the remaining quota of the token, or set it to unlimited quota",
"管理员关闭了密码登录": "The administrator has turned off password login", "管理员关闭了密码登录": "The administrator has turned off password login",
@ -229,7 +229,7 @@
"已是最新版本": "Is the latest version", "已是最新版本": "Is the latest version",
"检查更新": "Check for updates", "检查更新": "Check for updates",
"公告": "Announcement", "公告": "Announcement",
"在此输入新的公告内容": "Enter new announcement content here", "在此输入新的公告内容,支持 Markdown & HTML 代码": "Enter the new announcement content here, supports Markdown & HTML code",
"保存公告": "Save Announcement", "保存公告": "Save Announcement",
"个性化设置": "Personalization Settings", "个性化设置": "Personalization Settings",
"系统名称": "System Name", "系统名称": "System Name",
@ -518,5 +518,6 @@
",图片演示。": "related image demo.", ",图片演示。": "related image demo.",
"令牌创建成功,请在列表页面点击复制获取令牌!": "Token created successfully, please click copy on the list page to get the token!", "令牌创建成功,请在列表页面点击复制获取令牌!": "Token created successfully, please click copy on the list page to get the token!",
"代理": "Proxy", "代理": "Proxy",
"此项可选,用于通过代理站来进行 API 调用请输入代理站地址格式为https://domain.com": "This is optional, used to make API calls through the proxy site, please enter the proxy site address, the format is: https://domain.com" "此项可选,用于通过代理站来进行 API 调用请输入代理站地址格式为https://domain.com": "This is optional, used to make API calls through the proxy site, please enter the proxy site address, the format is: https://domain.com",
"取消密码登录将导致所有未绑定其他登录方式的用户(包括管理员)无法通过密码登录,确认取消?": "Canceling password login will cause all users (including administrators) who have not bound other login methods to be unable to log in via password, confirm cancel?"
} }

View File

@ -112,7 +112,7 @@ const OtherSetting = () => {
<Form.Group widths='equal'> <Form.Group widths='equal'>
<Form.TextArea <Form.TextArea
label='公告' label='公告'
placeholder='在此输入新的公告内容' placeholder='在此输入新的公告内容,支持 Markdown & HTML 代码'
value={inputs.Notice} value={inputs.Notice}
name='Notice' name='Notice'
onChange={handleInputChange} onChange={handleInputChange}

View File

@ -33,7 +33,7 @@ const SystemSetting = () => {
let [loading, setLoading] = useState(false); let [loading, setLoading] = useState(false);
const [EmailDomainWhitelist, setEmailDomainWhitelist] = useState([]); const [EmailDomainWhitelist, setEmailDomainWhitelist] = useState([]);
const [restrictedDomainInput, setRestrictedDomainInput] = useState(''); const [restrictedDomainInput, setRestrictedDomainInput] = useState('');
const [showModal, setShowModal] = useState(false); const [showPasswordWarningModal, setShowPasswordWarningModal] = useState(false);
const getOptions = async () => { const getOptions = async () => {
const res = await API.get('/api/option/'); const res = await API.get('/api/option/');
@ -97,8 +97,9 @@ const SystemSetting = () => {
const handleInputChange = async (e, { name, value }) => { const handleInputChange = async (e, { name, value }) => {
if (name === 'PasswordLoginEnabled' && inputs[name] === 'true') { if (name === 'PasswordLoginEnabled' && inputs[name] === 'true') {
setShowModal(true); // block disabling password login
return; // 早些返回,暂时不更新状态 setShowPasswordWarningModal(true);
return;
} }
if ( if (
name === 'Notice' || name === 'Notice' ||
@ -249,23 +250,23 @@ const SystemSetting = () => {
onChange={handleInputChange} onChange={handleInputChange}
/> />
{ {
showModal && showPasswordWarningModal &&
<Modal <Modal
open={showModal} open={showPasswordWarningModal}
onClose={() => setShowModal(false)} onClose={() => setShowPasswordWarningModal(false)}
size={'tiny'} size={'tiny'}
style={{ maxWidth: '450px' }} style={{ maxWidth: '450px' }}
> >
<Modal.Header>提示</Modal.Header> <Modal.Header>警告</Modal.Header>
<Modal.Content> <Modal.Content>
<p>取消密码登录将导致未绑定其他登录方式的用户含Root管理员无法通过密码登录,确认取消?</p> <p>取消密码登录将导致所有未绑定其他登录方式的用户包括管理员无法通过密码登录确认取消</p>
</Modal.Content> </Modal.Content>
<Modal.Actions> <Modal.Actions>
<Button onClick={() => setShowModal(false)}>取消</Button> <Button onClick={() => setShowPasswordWarningModal(false)}>取消</Button>
<Button <Button
primary color='yellow'
onClick={async () => { onClick={async () => {
setShowModal(false); setShowPasswordWarningModal(false);
await updateOption('PasswordLoginEnabled', 'false'); await updateOption('PasswordLoginEnabled', 'false');
}} }}
> >

View File

@ -386,8 +386,8 @@ const EditChannel = () => {
</Form.Field> </Form.Field>
) )
} }
<Button type={isEdit ? 'button' : 'submit'} positive onClick={submit}>提交</Button>
<Button onClick={handleCancel}>取消</Button> <Button onClick={handleCancel}>取消</Button>
<Button type={isEdit ? 'button' : 'submit'} positive onClick={submit}>提交</Button>
</Form> </Form>
</Segment> </Segment>
</> </>