feat: load balancers ui

Signed-off-by: allanice001 <allanice001@gmail.com>
This commit is contained in:
allanice001
2025-11-17 15:16:20 +00:00
parent 9853d32b04
commit d163a050d8
25 changed files with 622 additions and 72 deletions

View File

@@ -10,7 +10,9 @@ export const annotationsApi = {
}),
createAnnotation: (body: DtoCreateAnnotationRequest) =>
withRefresh(async () => {
return await annotations.createAnnotation({ body })
return await annotations.createAnnotation({
dtoCreateAnnotationRequest: body,
})
}),
getAnnotation: (id: string) =>
withRefresh(async () => {
@@ -22,6 +24,9 @@ export const annotationsApi = {
}),
updateAnnotation: (id: string, body: DtoUpdateAnnotationRequest) =>
withRefresh(async () => {
return await annotations.updateAnnotation({ id, body })
return await annotations.updateAnnotation({
id,
dtoUpdateAnnotationRequest: body,
})
}),
}

View File

@@ -17,7 +17,7 @@ export const archerAdminApi = {
run_at?: string
}) => {
return withRefresh(async () => {
return await archerAdmin.adminEnqueueArcherJob({ body })
return await archerAdmin.adminEnqueueArcherJob({ dtoEnqueueRequest: body })
})
},
retryJob: (id: string) => {

View File

@@ -11,7 +11,7 @@ export const credentialsApi = {
}),
createCredential: async (body: DtoCreateCredentialRequest) =>
withRefresh(async () => {
return await credentials.createCredential({ body })
return await credentials.createCredential({ dtoCreateCredentialRequest: body })
}),
getCredential: async (id: string) =>
withRefresh(async () => {
@@ -23,7 +23,7 @@ export const credentialsApi = {
}),
updateCredential: async (id: string, body: DtoUpdateCredentialRequest) =>
withRefresh(async () => {
return await credentials.updateCredential({ id, body })
return await credentials.updateCredential({ id, dtoUpdateCredentialRequest: body })
}),
revealCredential: async (id: string) =>
withRefresh(async () => {

View File

@@ -20,11 +20,11 @@ export const dnsApi = {
}),
createDomain: async (body: DtoCreateDomainRequest) =>
withRefresh(async () => {
return await dns.createDomain({ body })
return await dns.createDomain({ dtoCreateDomainRequest: body })
}),
updateDomain: async (id: string, body: DtoUpdateDomainRequest) =>
withRefresh(async () => {
return await dns.updateDomain({ id, body })
return await dns.updateDomain({ id, dtoUpdateDomainRequest: body })
}),
deleteDomain: async (id: string) =>
withRefresh(async () => {
@@ -36,11 +36,11 @@ export const dnsApi = {
}),
createRecordSetsByDomain: async (domainId: string, body: DtoCreateRecordSetRequest) =>
withRefresh(async () => {
return await dns.createRecordSet({ domainId, body })
return await dns.createRecordSet({ domainId, dtoCreateRecordSetRequest: body })
}),
updateRecordSetsByDomain: async (id: string, body: DtoUpdateRecordSetRequest) =>
withRefresh(async () => {
return await dns.updateRecordSet({ id, body })
return await dns.updateRecordSet({ id, dtoUpdateRecordSetRequest: body })
}),
deleteRecordSetsByDomain: async (id: string) =>
withRefresh(async () => {

View File

@@ -11,7 +11,7 @@ export const labelsApi = {
}),
createLabel: (body: DtoCreateLabelRequest) =>
withRefresh(async () => {
return await labels.createLabel({ body })
return await labels.createLabel({ dtoCreateLabelRequest: body })
}),
getLabel: (id: string) =>
withRefresh(async () => {
@@ -23,6 +23,6 @@ export const labelsApi = {
}),
updateLabel: (id: string, body: DtoUpdateLabelRequest) =>
withRefresh(async () => {
return await labels.updateLabel({ id, body })
return await labels.updateLabel({ id, dtoUpdateLabelRequest: body })
}),
}

View File

@@ -0,0 +1,32 @@
import { withRefresh } from "@/api/with-refresh"
import type { DtoCreateLoadBalancerRequest, DtoUpdateLoadBalancerRequest } from "@/sdk"
import { makeLoadBalancerApi } from "@/sdkClient"
const loadBalancers = makeLoadBalancerApi()
export const loadBalancersApi = {
listLoadBalancers: () =>
withRefresh(async () => {
return await loadBalancers.listLoadBalancers()
}),
getLoadBalancer: (id: string) =>
withRefresh(async () => {
return await loadBalancers.getLoadBalancers({ id })
}),
createLoadBalancer: (body: DtoCreateLoadBalancerRequest) =>
withRefresh(async () => {
return await loadBalancers.createLoadBalancer({
dtoCreateLoadBalancerRequest: body,
})
}),
updateLoadBalancer: (id: string, body: DtoUpdateLoadBalancerRequest) =>
withRefresh(async () => {
return await loadBalancers.updateLoadBalancer({
id,
dtoUpdateLoadBalancerRequest: body,
})
}),
deleteLoadBalancer: (id: string) =>
withRefresh(async () => {
return await loadBalancers.deleteLoadBalancer({ id })
}),
}

View File

@@ -19,7 +19,7 @@ export const meApi = {
updateMe: (body: HandlersUpdateMeRequest) =>
withRefresh(async (): Promise<ModelsUser> => {
return await me.updateMe({ body })
return await me.updateMe({ handlersUpdateMeRequest: body })
}),
listKeys: () =>
@@ -29,7 +29,7 @@ export const meApi = {
createKey: (body: HandlersCreateUserKeyRequest) =>
withRefresh(async (): Promise<HandlersUserAPIKeyOut> => {
return await keys.createUserAPIKey({ body })
return await keys.createUserAPIKey({ handlersCreateUserKeyRequest: body })
}),
deleteKey: (id: string) =>

View File

@@ -22,7 +22,7 @@ export const nodePoolsApi = {
}),
createNodePool: (body: DtoCreateNodePoolRequest) =>
withRefresh(async () => {
return await nodePools.createNodePool({ body })
return await nodePools.createNodePool({ dtoCreateNodePoolRequest: body })
}),
getNodePool: (id: string) =>
withRefresh(async () => {
@@ -34,7 +34,7 @@ export const nodePoolsApi = {
}),
updateNodePool: (id: string, body: DtoUpdateNodePoolRequest) =>
withRefresh(async () => {
return await nodePools.updateNodePool({ id, body })
return await nodePools.updateNodePool({ id, dtoUpdateNodePoolRequest: body })
}),
// Servers
listNodePoolServers: (id: string) =>
@@ -43,7 +43,7 @@ export const nodePoolsApi = {
}),
attachNodePoolServer: (id: string, body: DtoAttachServersRequest) =>
withRefresh(async () => {
return await nodePools.attachNodePoolServers({ id, body })
return await nodePools.attachNodePoolServers({ id, dtoAttachServersRequest: body })
}),
detachNodePoolServers: (id: string, serverId: string) =>
withRefresh(async () => {
@@ -56,7 +56,7 @@ export const nodePoolsApi = {
}),
attachNodePoolTaints: (id: string, body: DtoAttachTaintsRequest) =>
withRefresh(async () => {
return await nodePools.attachNodePoolTaints({ id, body })
return await nodePools.attachNodePoolTaints({ id, dtoAttachTaintsRequest: body })
}),
detachNodePoolTaints: (id: string, taintId: string) =>
withRefresh(async () => {
@@ -69,7 +69,7 @@ export const nodePoolsApi = {
}),
attachNodePoolLabels: (id: string, body: DtoAttachLabelsRequest) =>
withRefresh(async () => {
return await nodePools.attachNodePoolLabels({ id, body })
return await nodePools.attachNodePoolLabels({ id, dtoAttachLabelsRequest: body })
}),
detachNodePoolLabels: (id: string, labelId: string) =>
withRefresh(async () => {
@@ -82,7 +82,7 @@ export const nodePoolsApi = {
}),
attachNodePoolAnnotations: (id: string, body: DtoAttachAnnotationsRequest) =>
withRefresh(async () => {
return await nodePools.attachNodePoolAnnotations({ id, body })
return await nodePools.attachNodePoolAnnotations({ id, dtoAttachAnnotationsRequest: body })
}),
detachNodePoolAnnotations: (id: string, annotationId: string) =>
withRefresh(async () => {

View File

@@ -11,7 +11,7 @@ export const serversApi = {
}),
createServer: (body: DtoCreateServerRequest) =>
withRefresh(async () => {
return await servers.createServer({ body })
return await servers.createServer({ dtoCreateServerRequest: body })
}),
getServer: (id: string) =>
withRefresh(async () => {
@@ -19,7 +19,7 @@ export const serversApi = {
}),
updateServer: (id: string, body: DtoUpdateServerRequest) =>
withRefresh(async () => {
return await servers.updateServer({ id, body })
return await servers.updateServer({ id, dtoUpdateServerRequest: body })
}),
deleteServer: (id: string) =>
withRefresh(async () => {

View File

@@ -33,7 +33,7 @@ export const sshApi = {
createSshKey: (body: DtoCreateSSHRequest) =>
withRefresh(async (): Promise<DtoSshResponse> => {
// SDK expects { body }
return await ssh.createSSHKey({ body })
return await ssh.createSSHKey({ dtoCreateSSHRequest: body })
}),
getSshKeyById: (id: string) =>

View File

@@ -10,7 +10,7 @@ export const taintsApi = {
}),
createTaint: (body: DtoCreateTaintRequest) =>
withRefresh(async () => {
return await taints.createTaint({ body })
return await taints.createTaint({ dtoCreateTaintRequest: body })
}),
getTaint: (id: string) =>
withRefresh(async () => {
@@ -22,6 +22,6 @@ export const taintsApi = {
}),
updateTaint: (id: string, body: DtoUpdateTaintRequest) =>
withRefresh(async () => {
return await taints.updateTaint({ id, body })
return await taints.updateTaint({ id, dtoUpdateTaintRequest: body })
}),
}