mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-19 11:15:53 +08:00
3befee382d
Allow users to find task by task ID
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
export const paths = {
|
|
HOME: "/",
|
|
SETTINGS: "/settings",
|
|
SERVERS: "/servers",
|
|
SCHEDULERS: "/schedulers",
|
|
QUEUE_DETAILS: "/queues/:qname",
|
|
REDIS: "/redis",
|
|
TASK_DETAILS: "/queues/:qname/tasks/:taskId",
|
|
};
|
|
|
|
/**************************************************************
|
|
Path Helper functions
|
|
**************************************************************/
|
|
|
|
export function queueDetailsPath(qname: string, taskStatus?: string): string {
|
|
const path = paths.QUEUE_DETAILS.replace(":qname", qname);
|
|
if (taskStatus) {
|
|
return `${path}?status=${taskStatus}`;
|
|
}
|
|
return path;
|
|
}
|
|
|
|
export function taskDetailsPath(qname: string, taskId: string): string {
|
|
return paths.TASK_DETAILS.replace(":qname", qname).replace(":taskId", taskId);
|
|
}
|
|
|
|
/**************************************************************
|
|
URL Params
|
|
**************************************************************/
|
|
|
|
export interface QueueDetailsRouteParams {
|
|
qname: string;
|
|
}
|
|
|
|
export interface TaskDetailsRouteParams {
|
|
qname: string;
|
|
taskId: string;
|
|
} |