feat: server-side pagination and filtering for admin queues page
- Move queue, status, and offset to URL search params (?queue=&status=&offset=) - Load jobs server-side in +page.server.ts with auth token (matches other admin pages) - Derive total from adminQueues counts (waiting+active+completed+failed+delayed) so pagination knows total without an extra query - Add fetchFn/token params to getAdminQueueJobs for server-side use - Retry/remove/pause/resume actions now use invalidateAll() instead of local state Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1981,12 +1981,17 @@ export async function getAdminQueueJobs(
|
||||
status?: string,
|
||||
limit?: number,
|
||||
offset?: number,
|
||||
fetchFn?: typeof globalThis.fetch,
|
||||
token?: string,
|
||||
): Promise<Job[]> {
|
||||
return loggedApiCall("getAdminQueueJobs", async () => {
|
||||
const data = await getGraphQLClient().request<{ adminQueueJobs: Job[] }>(
|
||||
ADMIN_QUEUE_JOBS_QUERY,
|
||||
{ queue, status, limit, offset },
|
||||
);
|
||||
const client = token ? getAuthClient(token, fetchFn) : getGraphQLClient(fetchFn);
|
||||
const data = await client.request<{ adminQueueJobs: Job[] }>(ADMIN_QUEUE_JOBS_QUERY, {
|
||||
queue,
|
||||
status,
|
||||
limit,
|
||||
offset,
|
||||
});
|
||||
return data.adminQueueJobs;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user