|
@@ -28,6 +28,7 @@ const SystemSetting = () => {
|
|
|
RegisterEnabled: '',
|
|
RegisterEnabled: '',
|
|
|
QuotaForNewUser: 0,
|
|
QuotaForNewUser: 0,
|
|
|
QuotaRemindThreshold: 0,
|
|
QuotaRemindThreshold: 0,
|
|
|
|
|
+ PreConsumedQuota: 0,
|
|
|
ModelRatio: '',
|
|
ModelRatio: '',
|
|
|
TopUpLink: '',
|
|
TopUpLink: '',
|
|
|
AutomaticDisableChannelEnabled: '',
|
|
AutomaticDisableChannelEnabled: '',
|
|
@@ -98,6 +99,7 @@ const SystemSetting = () => {
|
|
|
name === 'TurnstileSecretKey' ||
|
|
name === 'TurnstileSecretKey' ||
|
|
|
name === 'QuotaForNewUser' ||
|
|
name === 'QuotaForNewUser' ||
|
|
|
name === 'QuotaRemindThreshold' ||
|
|
name === 'QuotaRemindThreshold' ||
|
|
|
|
|
+ name === 'PreConsumedQuota' ||
|
|
|
name === 'ModelRatio' ||
|
|
name === 'ModelRatio' ||
|
|
|
name === 'TopUpLink'
|
|
name === 'TopUpLink'
|
|
|
) {
|
|
) {
|
|
@@ -119,6 +121,9 @@ const SystemSetting = () => {
|
|
|
if (originInputs['QuotaRemindThreshold'] !== inputs.QuotaRemindThreshold) {
|
|
if (originInputs['QuotaRemindThreshold'] !== inputs.QuotaRemindThreshold) {
|
|
|
await updateOption('QuotaRemindThreshold', inputs.QuotaRemindThreshold);
|
|
await updateOption('QuotaRemindThreshold', inputs.QuotaRemindThreshold);
|
|
|
}
|
|
}
|
|
|
|
|
+ if (originInputs['PreConsumedQuota'] !== inputs.PreConsumedQuota) {
|
|
|
|
|
+ await updateOption('PreConsumedQuota', inputs.PreConsumedQuota);
|
|
|
|
|
+ }
|
|
|
if (originInputs['ModelRatio'] !== inputs.ModelRatio) {
|
|
if (originInputs['ModelRatio'] !== inputs.ModelRatio) {
|
|
|
if (!verifyJSON(inputs.ModelRatio)) {
|
|
if (!verifyJSON(inputs.ModelRatio)) {
|
|
|
showError('模型倍率不是合法的 JSON 字符串');
|
|
showError('模型倍率不是合法的 JSON 字符串');
|
|
@@ -272,7 +277,7 @@ const SystemSetting = () => {
|
|
|
<Header as='h3'>
|
|
<Header as='h3'>
|
|
|
运营设置
|
|
运营设置
|
|
|
</Header>
|
|
</Header>
|
|
|
- <Form.Group widths={3}>
|
|
|
|
|
|
|
+ <Form.Group widths={4}>
|
|
|
<Form.Input
|
|
<Form.Input
|
|
|
label='新用户初始配额'
|
|
label='新用户初始配额'
|
|
|
name='QuotaForNewUser'
|
|
name='QuotaForNewUser'
|
|
@@ -302,6 +307,16 @@ const SystemSetting = () => {
|
|
|
min='0'
|
|
min='0'
|
|
|
placeholder='低于此额度时将发送邮件提醒用户'
|
|
placeholder='低于此额度时将发送邮件提醒用户'
|
|
|
/>
|
|
/>
|
|
|
|
|
+ <Form.Input
|
|
|
|
|
+ label='请求预扣费额度'
|
|
|
|
|
+ name='PreConsumedQuota'
|
|
|
|
|
+ onChange={handleInputChange}
|
|
|
|
|
+ autoComplete='new-password'
|
|
|
|
|
+ value={inputs.PreConsumedQuota}
|
|
|
|
|
+ type='number'
|
|
|
|
|
+ min='0'
|
|
|
|
|
+ placeholder='请求结束后多退少补'
|
|
|
|
|
+ />
|
|
|
</Form.Group>
|
|
</Form.Group>
|
|
|
<Form.Group widths='equal'>
|
|
<Form.Group widths='equal'>
|
|
|
<Form.TextArea
|
|
<Form.TextArea
|