diff --git a/web/default/src/pages/Channel/EditChannel.js b/web/default/src/pages/Channel/EditChannel.js index a0cb757e..906a674d 100644 --- a/web/default/src/pages/Channel/EditChannel.js +++ b/web/default/src/pages/Channel/EditChannel.js @@ -280,8 +280,8 @@ const EditChannel = () => { {inputs.type === 3 && ( <> - 注意,模型部署名称必须和模型名称保持一致,因为 - One API 会把请求体中的 model + 注意,模型部署名称必须和模型名称保持一致 + ,因为 One API 会把请求体中的 model 参数替换为你的部署名称(模型名称中的点会被剔除), { )} - diff --git a/web/default/src/pages/Redemption/EditRedemption.js b/web/default/src/pages/Redemption/EditRedemption.js index 7a33f770..e0801830 100644 --- a/web/default/src/pages/Redemption/EditRedemption.js +++ b/web/default/src/pages/Redemption/EditRedemption.js @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import { Button, Form, Header, Segment } from 'semantic-ui-react'; +import { Button, Form, Card } from 'semantic-ui-react'; import { useParams, useNavigate } from 'react-router-dom'; import { API, downloadTextAsFile, showError, showSuccess } from '../../helpers'; import { renderQuota, renderQuotaWithPrompt } from '../../helpers/render'; @@ -13,7 +13,7 @@ const EditRedemption = () => { const originInputs = { name: '', quota: 100000, - count: 1 + count: 1, }; const [inputs, setInputs] = useState(originInputs); const { name, quota, count } = inputs; @@ -21,7 +21,7 @@ const EditRedemption = () => { const handleCancel = () => { navigate('/redemption'); }; - + const handleInputChange = (e, { name, value }) => { setInputs((inputs) => ({ ...inputs, [name]: value })); }; @@ -49,10 +49,13 @@ const EditRedemption = () => { localInputs.quota = parseInt(localInputs.quota); let res; if (isEdit) { - res = await API.put(`/api/redemption/`, { ...localInputs, id: parseInt(redemptionId) }); + res = await API.put(`/api/redemption/`, { + ...localInputs, + id: parseInt(redemptionId), + }); } else { res = await API.post(`/api/redemption/`, { - ...localInputs + ...localInputs, }); } const { success, message, data } = res.data; @@ -67,61 +70,67 @@ const EditRedemption = () => { showError(message); } if (!isEdit && data) { - let text = ""; + let text = ''; for (let i = 0; i < data.length; i++) { - text += data[i] + "\n"; + text += data[i] + '\n'; } downloadTextAsFile(text, `${inputs.name}.txt`); } }; return ( - <> - -
{isEdit ? '更新兑换码信息' : '创建新的兑换码'}
-
- - - - - - - { - !isEdit && <> - - - - - } - - -
-
- +
+ + + + {isEdit ? '更新兑换码信息' : '创建新的兑换码'} + +
+ + + + + + + {!isEdit && ( + <> + + + + + )} + + +
+
+
+
); }; diff --git a/web/default/src/pages/Token/EditToken.js b/web/default/src/pages/Token/EditToken.js index 2e70a0b8..3e7517f8 100644 --- a/web/default/src/pages/Token/EditToken.js +++ b/web/default/src/pages/Token/EditToken.js @@ -1,5 +1,12 @@ import React, { useEffect, useState } from 'react'; -import { Button, Form, Header, Message, Segment } from 'semantic-ui-react'; +import { + Button, + Form, + Header, + Message, + Segment, + Card, +} from 'semantic-ui-react'; import { useNavigate, useParams } from 'react-router-dom'; import { API, @@ -130,138 +137,142 @@ const EditToken = () => { }; return ( - <> - -
{isEdit ? '更新令牌信息' : '创建新的令牌'}
-
- - - - - { - copy(value).then(); - }} - selection - onChange={handleInputChange} - value={inputs.models} - autoComplete='new-password' - options={modelOptions} - /> - - - - - - - -
+
+ + + + {isEdit ? '更新令牌信息' : '创建新的令牌'} + + + + + + + { + copy(value).then(); + }} + selection + onChange={handleInputChange} + value={inputs.models} + autoComplete='new-password' + options={modelOptions} + /> + + + + + + + +
+ + + + + +
+ + 注意,令牌的额度仅用于限制令牌本身的最大额度使用量,实际的使用受到账户的剩余额度限制。 + + + + - - - - -
- - 注意,令牌的额度仅用于限制令牌本身的最大额度使用量,实际的使用受到账户的剩余额度限制。 - - - - - - - - - - + + + +
); }; diff --git a/web/default/src/pages/User/EditUser.js b/web/default/src/pages/User/EditUser.js index 8ae0e556..f256b68e 100644 --- a/web/default/src/pages/User/EditUser.js +++ b/web/default/src/pages/User/EditUser.js @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import { Button, Form, Header, Segment } from 'semantic-ui-react'; +import { Button, Form, Card } from 'semantic-ui-react'; import { useParams, useNavigate } from 'react-router-dom'; import { API, showError, showSuccess } from '../../helpers'; import { renderQuota, renderQuotaWithPrompt } from '../../helpers/render'; @@ -16,30 +16,40 @@ const EditUser = () => { wechat_id: '', email: '', quota: 0, - group: 'default' + group: 'default', }); const [groupOptions, setGroupOptions] = useState([]); - const { username, display_name, password, github_id, wechat_id, email, quota, group } = - inputs; + const { + username, + display_name, + password, + github_id, + wechat_id, + email, + quota, + group, + } = inputs; const handleInputChange = (e, { name, value }) => { setInputs((inputs) => ({ ...inputs, [name]: value })); }; const fetchGroups = async () => { try { let res = await API.get(`/api/group/`); - setGroupOptions(res.data.data.map((group) => ({ - key: group, - text: group, - value: group, - }))); + setGroupOptions( + res.data.data.map((group) => ({ + key: group, + text: group, + value: group, + })) + ); } catch (error) { showError(error.message); } }; const navigate = useNavigate(); const handleCancel = () => { - navigate("/setting"); - } + navigate('/setting'); + }; const loadUser = async () => { let res = undefined; if (userId) { @@ -83,107 +93,113 @@ const EditUser = () => { }; return ( - <> - -
更新用户信息
-
- - - - - - - - - - { - userId && <> - - - - - - - - } - - - - - - - - - - - -
-
- +
+ + + 更新用户信息 +
+ + + + + + + + + + {userId && ( + <> + + + + + + + + )} + + + + + + + + + + + +
+
+
+
); };