fix: 样式修复

This commit is contained in:
tbphp
2025-05-05 23:56:15 +08:00
parent 87188cd7d4
commit 3d243c3ee2
2 changed files with 13 additions and 13 deletions

View File

@@ -34,7 +34,7 @@ const RateLimitSetting = () => {
newInputs[item.key] = item.value; newInputs[item.key] = item.value;
} }
}); });
setInputs(newInputs); setInputs(newInputs);
} else { } else {
showError(message); showError(message);
@@ -44,28 +44,28 @@ const RateLimitSetting = () => {
try { try {
setLoading(true); setLoading(true);
await getOptions(); await getOptions();
// showSuccess('刷新成功'); // showSuccess('刷新成功');
} catch (error) { } catch (error) {
showError('刷新失败'); showError('刷新失败');
} finally { } finally {
setLoading(false); setLoading(false);
} }
} }
useEffect(() => { useEffect(() => {
onRefresh(); onRefresh();
}, []); }, []);
return ( return (
<> <>
<Spin spinning={loading} size='large'> <Spin spinning={loading} size='large'>
{/* AI请求速率限制 */} {/* AI请求速率限制 */}
<Card style={{ marginTop: '10px' }}> <Card style={{ marginTop: '10px' }}>
<RequestRateLimit options={inputs} refresh={onRefresh} /> <RequestRateLimit options={inputs} refresh={onRefresh} />
</Card> </Card>
</Spin> </Spin>
</> </>
); );
}; };
export default RateLimitSetting; export default RateLimitSetting;

View File

@@ -23,7 +23,7 @@ export default function RequestRateLimit(props) {
}); });
const refForm = useRef(); const refForm = useRef();
const [inputsRow, setInputsRow] = useState(inputs); const [inputsRow, setInputsRow] = useState(inputs);
function onSubmit() { function onSubmit() {
const updateArray = compareObjects(inputs, inputsRow); const updateArray = compareObjects(inputs, inputsRow);
if (!updateArray.length) return showWarning(t('你似乎并没有修改什么')); if (!updateArray.length) return showWarning(t('你似乎并没有修改什么'));
@@ -65,7 +65,7 @@ export default function RequestRateLimit(props) {
setLoading(false); setLoading(false);
}); });
} }
useEffect(() => { useEffect(() => {
const currentInputs = {}; const currentInputs = {};
for (let key in props.options) { for (let key in props.options) {
@@ -75,9 +75,9 @@ export default function RequestRateLimit(props) {
} }
setInputs(currentInputs); setInputs(currentInputs);
setInputsRow(structuredClone(currentInputs)); setInputsRow(structuredClone(currentInputs));
refForm.current.setValues(currentInputs); refForm.current.setValues(currentInputs);
}, [props.options]); }, [props.options]);
return ( return (
<> <>
<Spin spinning={loading}> <Spin spinning={loading}>
@@ -201,4 +201,4 @@ export default function RequestRateLimit(props) {
</Spin> </Spin>
</> </>
); );
} }