- Created `qa-test-output-after-fix.txt` and `qa-test-output.txt` to log results of certificate page authentication tests. - Added `build.sh` for deterministic backend builds in CI, utilizing `go list` for efficiency. - Introduced `codeql_scan.sh` for CodeQL database creation and analysis for Go and JavaScript/TypeScript. - Implemented `dockerfile_check.sh` to validate Dockerfiles for base image and package manager mismatches. - Added `sourcery_precommit_wrapper.sh` to facilitate Sourcery CLI usage in pre-commit hooks.
30 lines
663 B
TypeScript
30 lines
663 B
TypeScript
import client from './client'
|
|
|
|
export interface DockerPort {
|
|
private_port: number
|
|
public_port: number
|
|
type: string
|
|
}
|
|
|
|
export interface DockerContainer {
|
|
id: string
|
|
names: string[]
|
|
image: string
|
|
state: string
|
|
status: string
|
|
network: string
|
|
ip: string
|
|
ports: DockerPort[]
|
|
}
|
|
|
|
export const dockerApi = {
|
|
listContainers: async (host?: string, serverId?: string): Promise<DockerContainer[]> => {
|
|
const params: Record<string, string> = {}
|
|
if (host) params.host = host
|
|
if (serverId) params.server_id = serverId
|
|
|
|
const response = await client.get<DockerContainer[]>('/docker/containers', { params })
|
|
return response.data
|
|
},
|
|
}
|