mirror of
https://gitee.com/wanwujie/sub2api
synced 2026-05-05 21:50:44 +08:00
chore(channels): drop admin-side available channels view
Remove the admin-side "Available Channels" aggregate view — admins already see full channel configuration (groups, pricing, model mappings) in the channel edit dialog, making a read-only admin aggregate view redundant. The user-side "可用渠道" remains. Backend: - Delete handler/admin/available_channel_handler.go (+ test) - Drop AdminHandlers.AvailableChannel field and wire injection - Remove /admin/channels/available route Frontend: - Delete views/admin/AvailableChannelsView.vue - Drop /admin/available-channels router entry - Strip AvailableChannel types + listAvailable from api/admin/channels.ts
This commit is contained in:
@@ -164,42 +164,5 @@ export async function getModelDefaultPricing(model: string): Promise<ModelDefaul
|
||||
return data
|
||||
}
|
||||
|
||||
// --- Available channels (聚合视图:渠道 + 分组 + 支持模型) ---
|
||||
|
||||
export interface AvailableGroupRef {
|
||||
id: number
|
||||
name: string
|
||||
platform: string
|
||||
}
|
||||
|
||||
export interface SupportedModel {
|
||||
name: string
|
||||
platform: string
|
||||
pricing: ChannelModelPricing | null
|
||||
}
|
||||
|
||||
export interface AvailableChannel {
|
||||
id: number
|
||||
name: string
|
||||
description: string
|
||||
status: ChannelStatus
|
||||
billing_model_source: BillingModelSource
|
||||
restrict_models: boolean
|
||||
groups: AvailableGroupRef[]
|
||||
supported_models: SupportedModel[]
|
||||
}
|
||||
|
||||
interface AvailableChannelsResponse {
|
||||
items: AvailableChannel[]
|
||||
}
|
||||
|
||||
/** 列出所有可用渠道(含关联分组与支持模型) */
|
||||
export async function listAvailable(options?: { signal?: AbortSignal }): Promise<AvailableChannel[]> {
|
||||
const { data } = await apiClient.get<AvailableChannelsResponse>('/admin/channels/available', {
|
||||
signal: options?.signal
|
||||
})
|
||||
return data.items
|
||||
}
|
||||
|
||||
const channelsAPI = { list, getById, create, update, remove, getModelDefaultPricing, listAvailable }
|
||||
const channelsAPI = { list, getById, create, update, remove, getModelDefaultPricing }
|
||||
export default channelsAPI
|
||||
|
||||
Reference in New Issue
Block a user