|
@@ -25,6 +25,7 @@ const SystemSetting = () => {
|
|
|
TurnstileSecretKey: '',
|
|
TurnstileSecretKey: '',
|
|
|
RegisterEnabled: '',
|
|
RegisterEnabled: '',
|
|
|
QuotaForNewUser: 0,
|
|
QuotaForNewUser: 0,
|
|
|
|
|
+ BytesNumber2Quota: 0.8,
|
|
|
TopUpLink: ''
|
|
TopUpLink: ''
|
|
|
});
|
|
});
|
|
|
let originInputs = {};
|
|
let originInputs = {};
|
|
@@ -90,6 +91,7 @@ const SystemSetting = () => {
|
|
|
name === 'TurnstileSiteKey' ||
|
|
name === 'TurnstileSiteKey' ||
|
|
|
name === 'TurnstileSecretKey' ||
|
|
name === 'TurnstileSecretKey' ||
|
|
|
name === 'QuotaForNewUser' ||
|
|
name === 'QuotaForNewUser' ||
|
|
|
|
|
+ name === 'BytesNumber2Quota' ||
|
|
|
name === 'TopUpLink'
|
|
name === 'TopUpLink'
|
|
|
) {
|
|
) {
|
|
|
setInputs((inputs) => ({ ...inputs, [name]: value }));
|
|
setInputs((inputs) => ({ ...inputs, [name]: value }));
|
|
@@ -107,6 +109,9 @@ const SystemSetting = () => {
|
|
|
if (originInputs['QuotaForNewUser'] !== inputs.QuotaForNewUser) {
|
|
if (originInputs['QuotaForNewUser'] !== inputs.QuotaForNewUser) {
|
|
|
await updateOption('QuotaForNewUser', inputs.QuotaForNewUser);
|
|
await updateOption('QuotaForNewUser', inputs.QuotaForNewUser);
|
|
|
}
|
|
}
|
|
|
|
|
+ if (originInputs['BytesNumber2Quota'] !== inputs.BytesNumber2Quota) {
|
|
|
|
|
+ await updateOption('BytesNumber2Quota', inputs.BytesNumber2Quota);
|
|
|
|
|
+ }
|
|
|
if (originInputs['TopUpLink'] !== inputs.TopUpLink) {
|
|
if (originInputs['TopUpLink'] !== inputs.TopUpLink) {
|
|
|
await updateOption('TopUpLink', inputs.TopUpLink);
|
|
await updateOption('TopUpLink', inputs.TopUpLink);
|
|
|
}
|
|
}
|
|
@@ -255,6 +260,17 @@ const SystemSetting = () => {
|
|
|
min='0'
|
|
min='0'
|
|
|
placeholder='例如:100'
|
|
placeholder='例如:100'
|
|
|
/>
|
|
/>
|
|
|
|
|
+ <Form.Input
|
|
|
|
|
+ label='Stream 模式下估算 token 时所使用的倍率'
|
|
|
|
|
+ name='BytesNumber2Quota'
|
|
|
|
|
+ onChange={handleInputChange}
|
|
|
|
|
+ autoComplete='off'
|
|
|
|
|
+ value={inputs.BytesNumber2Quota}
|
|
|
|
|
+ type='number'
|
|
|
|
|
+ step='0.01'
|
|
|
|
|
+ min='0'
|
|
|
|
|
+ placeholder='例如:0.8'
|
|
|
|
|
+ />
|
|
|
<Form.Input
|
|
<Form.Input
|
|
|
label='充值链接'
|
|
label='充值链接'
|
|
|
name='TopUpLink'
|
|
name='TopUpLink'
|