Merge commit from fork

fix: harden token search with pagination, rate limiting and input validation
This commit is contained in:
Calcium-Ion
2026-02-06 17:54:40 +08:00
committed by GitHub
11 changed files with 282 additions and 20 deletions

View File

@@ -56,6 +56,7 @@ export default function GeneralSettings(props) {
DefaultCollapseSidebar: false,
DemoSiteEnabled: false,
SelfUseModeEnabled: false,
'token_setting.max_user_tokens': 1000,
});
const refForm = useRef();
const [inputsRow, setInputsRow] = useState(inputs);
@@ -287,6 +288,19 @@ export default function GeneralSettings(props) {
/>
</Col>
</Row>
<Row gutter={16}>
<Col xs={24} sm={12} md={8} lg={8} xl={8}>
<Form.InputNumber
label={t('用户最大令牌数量')}
field={'token_setting.max_user_tokens'}
step={1}
min={1}
extraText={t('每个用户最多可创建的令牌数量,默认 1000设置过大可能会影响性能')}
placeholder={'1000'}
onChange={handleFieldChange('token_setting.max_user_tokens')}
/>
</Col>
</Row>
<Row>
<Button size='default' onClick={onSubmit}>
{t('保存通用设置')}