新增通道列表查询页面

This commit is contained in:
2025-04-28 17:41:54 +08:00
parent b20ec85db9
commit b44888a6d7
16 changed files with 290 additions and 117 deletions

View File

@@ -1,7 +1,28 @@
'use server'
import {callByUser} from '@/actions/base'
import {Channel} from '@/lib/models'
import {PageRecord} from '@/lib/api'
async function createChannels(params: {
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
@@ -12,14 +33,3 @@ async function createChannels(params: {
}) {
return callByUser<CreateChannelsResp[]>('/api/channel/create', params)
}
type CreateChannelsResp = {
host: string
port: string
username?: string
password?: string
}
export {
createChannels,
}