feat: rebuild frontend with react
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import http from './http'
|
||||
import type { BatchCommandResponse, Connection, ConnectionCreateRequest } from '../types'
|
||||
|
||||
export function listConnections() {
|
||||
return http.get<Connection[]>('/connections')
|
||||
}
|
||||
|
||||
export function createConnection(payload: ConnectionCreateRequest) {
|
||||
return http.post<Connection>('/connections', payload)
|
||||
}
|
||||
|
||||
export function updateConnection(id: number, payload: ConnectionCreateRequest) {
|
||||
return http.put<Connection>(`/connections/${id}`, payload)
|
||||
}
|
||||
|
||||
export function deleteConnection(id: number) {
|
||||
return http.delete<{ message: string }>(`/connections/${id}`)
|
||||
}
|
||||
|
||||
export function executeBatchCommand(connectionIds: number[], command: string) {
|
||||
return http.post<BatchCommandResponse>('/connections/batch-command', { connectionIds, command })
|
||||
}
|
||||
Reference in New Issue
Block a user