feat(delivery): refine base service integrations

This commit is contained in:
mac
2026-07-29 16:36:27 +08:00
parent 2ca08f9360
commit 35875218c9
22 changed files with 1042 additions and 377 deletions
+13 -3
View File
@@ -66,6 +66,7 @@ export interface DeliveryTask {
updated_at: string
started_at?: string
finished_at?: string
credential_available?: boolean
}
export interface TaskEvent {
@@ -85,8 +86,12 @@ export interface DeliveryTaskSnapshot {
}
export interface DeploymentCredential {
username: string
service: string
instance_name: string
host: string
port: number
username: string
account_host: string
password: string
}
@@ -109,8 +114,13 @@ export const deliveryApi = {
return Array.isArray(data.items) ? data.items : []
},
async listTargetMountPaths(targetId: number, host: string): Promise<DeliveryMountPath[]> {
const data = await authRequest(`/auth/api/v1/delivery/targets/${targetId}/hosts/${encodeURIComponent(host)}/mount-paths`)
async listTargetMountPaths(targetId: number, host: string, prefix = ''): Promise<DeliveryMountPath[]> {
const search = new URLSearchParams()
if (prefix) search.set('prefix', prefix)
const query = search.toString()
const data = await authRequest(
`/auth/api/v1/delivery/targets/${targetId}/hosts/${encodeURIComponent(host)}/mount-paths${query ? `?${query}` : ''}`,
)
return Array.isArray(data.items) ? data.items : []
},