perf(nodes): paginate node lists and fetch details directly (#54)

* perf(nodes): paginate node lists and fetch details directly

* fix(nodes): preserve Unicode search and page transition state

* fix(nodes): validate search using the UTF-8 byte limit
This commit is contained in:
ArthurKoba
2026-11-07 16:29:52 +03:00
committed by GitHub
parent 72d67c80f2
commit 3c7b347d7b
28 changed files with 1873 additions and 45 deletions
+2
View File
@@ -38,6 +38,8 @@ export type {
NodeAgentUpdatePayload,
NodeBootstrapToken,
NodeItem,
NodeListQuery,
NodeListResult,
NodeMutationPayload,
NodeHealthEvent,
NodeObservability,
@@ -4,6 +4,8 @@ import type {
NodeAgentUpdatePayload,
NodeBootstrapToken,
NodeItem,
NodeListQuery,
NodeListResult,
NodeMutationPayload,
NodeObservability,
ReleaseChannel,
@@ -16,6 +18,16 @@ export class NodeService extends OpenFlareBaseService {
return this.get<NodeItem[]>('/');
}
static async listNodePage(
query: NodeListQuery = {},
): Promise<NodeListResult> {
return this.get<NodeListResult>('/page', { ...query });
}
static async getNode(id: number): Promise<NodeItem> {
return this.get<NodeItem>(`/${id}`);
}
static async createNode(payload: NodeMutationPayload): Promise<NodeItem> {
return this.post<NodeItem>('/', payload);
}
+15
View File
@@ -56,6 +56,21 @@ export interface NodeItem {
updated_at: string;
}
export interface NodeListQuery {
page?: number;
page_size?: number;
search?: string;
status?: NodeStatus | '';
node_type?: NodeType | '';
}
export interface NodeListResult {
total: number;
results: NodeItem[];
page: number;
page_size: number;
}
export interface NodeBootstrapToken {
discovery_token: string;
}