feat: 添加成功时自动启用通道功能, close #27

This commit is contained in:
CaIon
2024-02-01 18:52:39 +08:00
parent affe5111cc
commit 5c8f8b4901
6 changed files with 48 additions and 9 deletions

View File

@@ -478,7 +478,7 @@ const ChannelsTable = () => {
const res = await API.get(`/api/channel/test`);
const {success, message} = res.data;
if (success) {
showInfo('已成功开始测试所有已启用通道,请刷新页面查看结果。');
showInfo('已成功开始测试所有通道,请刷新页面查看结果。');
} else {
showError(message);
}
@@ -702,7 +702,7 @@ const ChannelsTable = () => {
onConfirm={testAllChannels}
position={isMobile()?'top':'top'}
>
<Button theme='light' type='warning' style={{marginRight: 8}}>测试所有已启用通道</Button>
<Button theme='light' type='warning' style={{marginRight: 8}}>测试所有通道</Button>
</Popconfirm>
<Popconfirm
title="确定?"

View File

@@ -18,6 +18,7 @@ const OperationSetting = () => {
ChatLink2: '', // 添加的新状态变量
QuotaPerUnit: 0,
AutomaticDisableChannelEnabled: '',
AutomaticEnableChannelEnabled: '',
ChannelDisableThreshold: 0,
LogConsumeEnabled: '',
DisplayInCurrencyEnabled: '',
@@ -332,6 +333,12 @@ const OperationSetting = () => {
name='AutomaticDisableChannelEnabled'
onChange={handleInputChange}
/>
<Form.Checkbox
checked={inputs.AutomaticEnableChannelEnabled === 'true'}
label='成功时自动启用通道'
name='AutomaticEnableChannelEnabled'
onChange={handleInputChange}
/>
</Form.Group>
<Form.Button onClick={() => {
submitConfig('monitor').then();