mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-11-16 23:04:24 +08:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user