添加已使用渠道已使用额度
This commit is contained in:
parent
0facecce69
commit
d88ad0e8d7
@ -341,6 +341,14 @@ const ChannelsTable = () => {
|
||||
>
|
||||
余额
|
||||
</Table.HeaderCell>
|
||||
<Table.HeaderCell
|
||||
style={{ cursor: 'pointer' }}
|
||||
onClick={() => {
|
||||
sortChannel('used_quota');
|
||||
}}
|
||||
>
|
||||
已使用量
|
||||
</Table.HeaderCell>
|
||||
<Table.HeaderCell>操作</Table.HeaderCell>
|
||||
</Table.Row>
|
||||
</Table.Header>
|
||||
@ -381,6 +389,7 @@ const ChannelsTable = () => {
|
||||
basic
|
||||
/>
|
||||
</Table.Cell>
|
||||
<Table.Cell>{channel.used_quota}</Table.Cell>
|
||||
<Table.Cell>
|
||||
<div>
|
||||
<Button
|
||||
|
@ -16,7 +16,8 @@ const EditChannel = () => {
|
||||
base_url: '',
|
||||
other: '',
|
||||
models: [],
|
||||
groups: ['default']
|
||||
groups: ['default'],
|
||||
used_quota: 0
|
||||
};
|
||||
const [batch, setBatch] = useState(false);
|
||||
const [inputs, setInputs] = useState(originInputs);
|
||||
@ -25,6 +26,9 @@ const EditChannel = () => {
|
||||
const [basicModels, setBasicModels] = useState([]);
|
||||
const [fullModels, setFullModels] = useState([]);
|
||||
const handleInputChange = (e, { name, value }) => {
|
||||
if (name === "used_quota") {
|
||||
value = parseInt(value)
|
||||
}
|
||||
setInputs((inputs) => ({ ...inputs, [name]: value }));
|
||||
};
|
||||
|
||||
@ -113,6 +117,11 @@ const EditChannel = () => {
|
||||
showSuccess('渠道创建成功!');
|
||||
setInputs(originInputs);
|
||||
}
|
||||
if (isEdit) {
|
||||
loadChannel().then();
|
||||
}
|
||||
fetchModels().then();
|
||||
fetchGroups().then();
|
||||
} else {
|
||||
showError(message);
|
||||
}
|
||||
@ -201,6 +210,16 @@ const EditChannel = () => {
|
||||
autoComplete='new-password'
|
||||
/>
|
||||
</Form.Field>
|
||||
<Form.Field>
|
||||
<Form.Input
|
||||
label='已使用额度'
|
||||
name='used_quota'
|
||||
placeholder={'请输入已使用额度'}
|
||||
onChange={handleInputChange}
|
||||
value={inputs.used_quota}
|
||||
type='number'
|
||||
/>
|
||||
</Form.Field>
|
||||
<Form.Field>
|
||||
<Form.Dropdown
|
||||
label='分组'
|
||||
|
Loading…
Reference in New Issue
Block a user