mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-28 00:07:33 +00:00
fix(composite): support CN providers
Extend composite routing, pricing, migrations, and admin options for Kimi, GLM, and DeepSeek.
This commit is contained in:
@@ -763,9 +763,8 @@ let abortController: AbortController | null = null
|
||||
|
||||
// ── Platform config ──
|
||||
const platformOrder: GroupPlatform[] = ['anthropic', 'openai', 'gemini', 'antigravity', 'grok', 'kimi', 'zhipu', 'deepseek']
|
||||
// composite 分组仅覆盖主平台(与后端 isConcreteRequestPlatform / composite-routes target_platform 一致),
|
||||
// 不含国产供应商平台。
|
||||
const compositePlatforms: GroupPlatform[] = ['anthropic', 'openai', 'gemini', 'antigravity', 'grok']
|
||||
// Composite pricing/mapping may target every concrete schedulable provider.
|
||||
const compositePlatforms: GroupPlatform[] = ['anthropic', 'openai', 'gemini', 'antigravity', 'grok', 'kimi', 'zhipu', 'deepseek']
|
||||
|
||||
// ── Helpers ──
|
||||
function formatDate(value: string): string {
|
||||
|
||||
@@ -4768,6 +4768,9 @@ const compositeRoutePlatformOptions = computed(() => [
|
||||
{ value: "gemini", label: "Gemini" },
|
||||
{ value: "antigravity", label: "Antigravity" },
|
||||
{ value: "grok", label: "Grok" },
|
||||
{ value: "kimi", label: "Kimi" },
|
||||
{ value: "zhipu", label: "Zhipu GLM" },
|
||||
{ value: "deepseek", label: "DeepSeek" },
|
||||
]);
|
||||
|
||||
const compositeRouteEndpointOptions = computed(() => [
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
describe('GroupsView Composite route options', () => {
|
||||
it('offers Kimi, Zhipu GLM, and DeepSeek as route targets', () => {
|
||||
const source = readFileSync(resolve('src/views/admin/GroupsView.vue'), 'utf8')
|
||||
const options = source.slice(
|
||||
source.indexOf('const compositeRoutePlatformOptions'),
|
||||
source.indexOf('const compositeRouteEndpointOptions')
|
||||
)
|
||||
|
||||
expect(options).toContain('{ value: "kimi", label: "Kimi" }')
|
||||
expect(options).toContain('{ value: "zhipu", label: "Zhipu GLM" }')
|
||||
expect(options).toContain('{ value: "deepseek", label: "DeepSeek" }')
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,14 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
describe('Composite channel platform options', () => {
|
||||
it('includes the CN concrete providers for pricing and model mapping', () => {
|
||||
const source = readFileSync(resolve('src/views/admin/ChannelsView.vue'), 'utf8')
|
||||
const declaration = source.match(/const compositePlatforms:[^=]+=[^\n]+/)?.[0]
|
||||
|
||||
expect(declaration).toContain("'kimi'")
|
||||
expect(declaration).toContain("'zhipu'")
|
||||
expect(declaration).toContain("'deepseek'")
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user