feat: add OpenRouter pricing support to upstream ratio sync

This commit is contained in:
RedwindA
2026-02-12 12:57:27 +08:00
parent 29d48e262e
commit 9f20f32474
4 changed files with 147 additions and 6 deletions

View File

@@ -117,6 +117,7 @@ const ChannelSelectorModal = forwardRef(
const getEndpointType = (ep) => {
if (ep === '/api/ratio_config') return 'ratio_config';
if (ep === '/api/pricing') return 'pricing';
if (ep === 'openrouter') return 'openrouter';
return 'custom';
};
@@ -127,6 +128,8 @@ const ChannelSelectorModal = forwardRef(
updateEndpoint(channelId, '/api/ratio_config');
} else if (val === 'pricing') {
updateEndpoint(channelId, '/api/pricing');
} else if (val === 'openrouter') {
updateEndpoint(channelId, 'openrouter');
} else {
if (currentType !== 'custom') {
updateEndpoint(channelId, '');
@@ -144,6 +147,7 @@ const ChannelSelectorModal = forwardRef(
optionList={[
{ label: 'ratio_config', value: 'ratio_config' },
{ label: 'pricing', value: 'pricing' },
{ label: 'OpenRouter', value: 'openrouter' },
{ label: 'custom', value: 'custom' },
]}
/>