mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 06:40:45 +08:00
feat(collect): draft jobs, merged create UI, and unified start
Create collection jobs without auto-running; add /start for first run and re-run. Merge create form with filterable NE picker and selected list. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
fed7f56ad0
commit
f1ed4fe753
9 changed files with 343 additions and 147 deletions
|
|
@ -142,10 +142,11 @@ export const importManagedNe = async (file: File): Promise<ManagedNeImportResult
|
|||
return data as ManagedNeImportResult;
|
||||
};
|
||||
|
||||
export const fetchEligibleNe = (params: { page: number; pageSize: number }) => {
|
||||
export const fetchEligibleNe = (params: { page: number; pageSize: number; keyword?: string }) => {
|
||||
const p = new URLSearchParams();
|
||||
p.set("page", String(Math.max(1, params.page)));
|
||||
p.set("page_size", String(Math.max(1, Math.min(500, params.pageSize))));
|
||||
if (params.keyword?.trim()) p.set("keyword", params.keyword.trim());
|
||||
return apiGet<{ total: number; page: number; page_size: number; items: EligibleNeItem[] }>(
|
||||
`/v1/ne-collections/eligible-ne?${p.toString()}`,
|
||||
);
|
||||
|
|
@ -183,6 +184,9 @@ export const fetchCollectionRuns = (params: {
|
|||
export const pauseCollectionJob = (jobId: string) =>
|
||||
apiPost<CollectionJobItem>(`/v1/ne-collections/${jobId}/pause`, {});
|
||||
|
||||
export const startCollectionJob = (jobId: string) =>
|
||||
apiPost<CollectionJobItem>(`/v1/ne-collections/${jobId}/start`, {});
|
||||
|
||||
export const restartCollectionJob = (jobId: string) =>
|
||||
apiPost<CollectionJobItem>(`/v1/ne-collections/${jobId}/restart`, {});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue