mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-06 17:14:28 +00:00
Refactor InstanceSettingsCard and API types to use NodesMap
This commit is contained in:
@@ -105,14 +105,15 @@ export const backendsApi = {
|
||||
|
||||
// Node API types
|
||||
export interface NodeResponse {
|
||||
name: string;
|
||||
address: string;
|
||||
}
|
||||
|
||||
export type NodesMap = Record<string, NodeResponse>;
|
||||
|
||||
// Node API functions
|
||||
export const nodesApi = {
|
||||
// GET /nodes
|
||||
list: () => apiCall<NodeResponse[]>("/nodes"),
|
||||
// GET /nodes - returns map of node name to NodeResponse
|
||||
list: () => apiCall<NodesMap>("/nodes"),
|
||||
|
||||
// GET /nodes/{name}
|
||||
get: (name: string) => apiCall<NodeResponse>(`/nodes/${name}`),
|
||||
|
||||
Reference in New Issue
Block a user