🗑️ chore(custom channel): Remove custom channel support from upstream ratio sync

Remove all custom channel functionality from the upstream ratio sync feature to simplify the codebase and focus on database-stored channels only.

Changes:
- Remove custom channel UI components and related state management
- Remove custom channel testing and validation logic
- Simplify ChannelSelectorModal by removing custom channel input fields
- Update API payload to only include channel_ids, removing custom_channels
- Remove custom channel processing logic from backend controller
- Update import path for DEFAULT_ENDPOINT constant

Files modified:
- web/src/pages/Setting/Ratio/UpstreamRatioSync.js
- web/src/components/settings/ChannelSelectorModal.js
- controller/ratio_sync.go

This change streamlines the ratio synchronization workflow by focusing solely on pre-configured database channels, reducing complexity and potential maintenance overhead.
This commit is contained in:
Apple\Apple
2025-06-19 15:17:05 +08:00
parent 7975cdf3bf
commit fb4ff63bad
5 changed files with 7 additions and 169 deletions

View File

@@ -3,12 +3,10 @@ import {
Modal,
Transfer,
Input,
Card,
Space,
Button,
Checkbox,
} from '@douyinfe/semi-ui';
import { IconPlus, IconClose } from '@douyinfe/semi-icons';
import { IconClose } from '@douyinfe/semi-icons';
/**
* ChannelSelectorModal
@@ -20,21 +18,13 @@ export default function ChannelSelectorModal({
visible,
onCancel,
onOk,
// 渠道选择
// 渠道选择
allChannels = [],
selectedChannelIds = [],
setSelectedChannelIds,
// 自定义渠道
customUrl,
setCustomUrl,
customEndpoint,
setCustomEndpoint,
customChannelTesting,
addCustomChannel,
// 渠道端点
channelEndpoints,
updateChannelEndpoint,
// 测试相关
}) {
// Transfer 自定义渲染
const renderSourceItem = (item) => {
@@ -107,32 +97,6 @@ export default function ChannelSelectorModal({
width={1000}
>
<Space vertical style={{ width: '100%' }}>
<Card title={t('添加自定义渠道')} className="w-full">
<Space direction="horizontal" style={{ width: '100%' }}>
<Input
placeholder={t('渠道地址https://example.com')}
value={customUrl}
onChange={setCustomUrl}
style={{ flex: 1 }}
/>
<Input
placeholder={t('接口路径')}
value={customEndpoint}
onChange={setCustomEndpoint}
style={{ width: 150 }}
/>
<Button
icon={<IconPlus />}
onClick={addCustomChannel}
loading={customChannelTesting}
disabled={!customUrl}
className="whitespace-nowrap"
>
{customChannelTesting ? t('测试中...') : t('添加')}
</Button>
</Space>
</Card>
<Transfer
style={{ width: '100%' }}
dataSource={allChannels}