Files
web/src/actions/channel.ts
2026-04-13 10:23:19 +08:00

37 lines
774 B
TypeScript

'use server'
import {callByUser, callPublic} from '@/actions/base'
import {Channel} from '@/lib/models'
import {PageRecord} from '@/lib/api'
import {Batch} from '@/lib/models/batch'
export async function listChannels(props: {
page: number
size: number
auth_type?: number
prov?: string
city?: string
isp?: string
expiration?: Date
}) {
return callByUser<PageRecord<Channel>>('/api/channel/list', props)
}
type CreateChannelsResp = {
host: string
port: string
username?: string
password?: string
}
export async function createChannels(params: {
resource_id: number
protocol: number
auth_type: number
count: number
prov?: string
city?: string
isp?: number
}) {
return callByUser<CreateChannelsResp[]>('/api/channel/create', params)
}