bullmq-dash 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/data/jobs.d.ts +2 -2
- package/dist/data/jobs.d.ts.map +1 -1
- package/dist/data/queues.d.ts +1 -0
- package/dist/data/queues.d.ts.map +1 -1
- package/dist/index.js +43 -28
- package/dist/index.js.map +13 -13
- package/dist/state.d.ts +3 -3
- package/dist/state.d.ts.map +1 -1
- package/dist/ui/colors.d.ts +1 -0
- package/dist/ui/colors.d.ts.map +1 -1
- package/dist/ui/config-prompt.d.ts.map +1 -1
- package/dist/ui/status-filter.d.ts +3 -3
- package/dist/ui/status-filter.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# bullmq-dash
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Terminal UI dashboard for [BullMQ](https://bullmq.io/)
|
|
4
4
|
|
|
5
5
|
<img width="1491" height="854" alt="SCR-20260127-gsqa" src="https://github.com/user-attachments/assets/739d7729-b6cd-4933-a9e8-96e8cf84d33a" />
|
|
6
6
|
|
package/dist/config.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
17
17
|
db?: number | undefined;
|
|
18
18
|
}>;
|
|
19
19
|
pollInterval: z.ZodDefault<z.ZodNumber>;
|
|
20
|
+
prefix: z.ZodDefault<z.ZodString>;
|
|
20
21
|
queueNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
21
22
|
}, "strip", z.ZodTypeAny, {
|
|
22
23
|
redis: {
|
|
@@ -26,6 +27,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
26
27
|
password?: string | undefined;
|
|
27
28
|
};
|
|
28
29
|
pollInterval: number;
|
|
30
|
+
prefix: string;
|
|
29
31
|
queueNames?: string[] | undefined;
|
|
30
32
|
}, {
|
|
31
33
|
redis: {
|
|
@@ -35,6 +37,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
35
37
|
db?: number | undefined;
|
|
36
38
|
};
|
|
37
39
|
pollInterval?: number | undefined;
|
|
40
|
+
prefix?: string | undefined;
|
|
38
41
|
queueNames?: string[] | undefined;
|
|
39
42
|
}>;
|
|
40
43
|
export type Config = z.infer<typeof configSchema>;
|
|
@@ -44,6 +47,7 @@ export interface CliArgs {
|
|
|
44
47
|
redisPassword?: string;
|
|
45
48
|
redisDb?: number;
|
|
46
49
|
pollInterval?: number;
|
|
50
|
+
prefix?: string;
|
|
47
51
|
queues?: string[];
|
|
48
52
|
help?: boolean;
|
|
49
53
|
version?: boolean;
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,QAAA,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUhB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD,MAAM,WAAW,OAAO;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAoCD,wBAAgB,YAAY,IAAI,OAAO,CAqCtC;AAED,wBAAgB,QAAQ,IAAI,IAAI,CAG/B;AAED,wBAAgB,WAAW,IAAI,IAAI,CAGlC;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAM/E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAE5D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAuBnD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,EAChE,OAAO,EAAE,OAAO,GACf,MAAM,CAuBR;AAKD,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED,wBAAgB,SAAS,IAAI,MAAM,CAKlC"}
|
package/dist/data/jobs.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type JobListView = "latest" | "wait" | "active" | "completed" | "failed" | "delayed" | "schedulers";
|
|
2
2
|
export interface JobSummary {
|
|
3
3
|
id: string;
|
|
4
4
|
name: string;
|
|
@@ -28,7 +28,7 @@ export interface JobsResult {
|
|
|
28
28
|
/**
|
|
29
29
|
* Get jobs by status with pagination
|
|
30
30
|
*/
|
|
31
|
-
export declare function getJobs(queueName: string, status:
|
|
31
|
+
export declare function getJobs(queueName: string, status: JobListView, page?: number, pageSize?: number): Promise<JobsResult>;
|
|
32
32
|
/**
|
|
33
33
|
* Get detailed information for a single job
|
|
34
34
|
*/
|
package/dist/data/jobs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../../src/data/jobs.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../../src/data/jobs.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,YAAY,CAAC;AAE3G,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,SAAU,SAAQ,UAAU;IAC3C,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAID;;GAEG;AACH,wBAAsB,OAAO,CAC3B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WAAW,EACnB,IAAI,GAAE,MAAU,EAChB,QAAQ,GAAE,MAAkB,GAC3B,OAAO,CAAC,UAAU,CAAC,CAwGrB;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CA2B9F;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAUlF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAc5D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGrE"}
|
package/dist/data/queues.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queues.d.ts","sourceRoot":"","sources":["../../src/data/queues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"queues.d.ts","sourceRoot":"","sources":["../../src/data/queues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAgB/B,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,CAejD;AAED;;GAEG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAkD5D;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CA8B1E;AAED;;GAEG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAM9D;AAED;;GAEG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAKpD"}
|
package/dist/index.js
CHANGED
|
@@ -243,6 +243,7 @@ var configSchema = z.object({
|
|
|
243
243
|
db: z.coerce.number().int().min(0).default(0)
|
|
244
244
|
}),
|
|
245
245
|
pollInterval: z.coerce.number().int().positive().default(3000),
|
|
246
|
+
prefix: z.string().default("bull"),
|
|
246
247
|
queueNames: z.array(z.string()).optional()
|
|
247
248
|
});
|
|
248
249
|
var VERSION = "0.1.0";
|
|
@@ -257,6 +258,7 @@ Options:
|
|
|
257
258
|
--redis-password <pass> Redis password
|
|
258
259
|
--redis-db <db> Redis database number (default: 0)
|
|
259
260
|
--poll-interval <ms> Polling interval in milliseconds (default: 3000)
|
|
261
|
+
--prefix <prefix> BullMQ key prefix (default: bull)
|
|
260
262
|
--queues <names> Comma-separated queue names to monitor
|
|
261
263
|
-v, --version Show version
|
|
262
264
|
-h, --help Show this help message
|
|
@@ -267,12 +269,14 @@ Environment Variables:
|
|
|
267
269
|
REDIS_PASSWORD Redis password
|
|
268
270
|
REDIS_DB Redis database number
|
|
269
271
|
POLL_INTERVAL Polling interval in milliseconds
|
|
272
|
+
BULL_PREFIX BullMQ key prefix (default: bull)
|
|
270
273
|
QUEUE_NAMES Comma-separated queue names
|
|
271
274
|
|
|
272
275
|
Examples:
|
|
273
276
|
bullmq-dash
|
|
274
277
|
bullmq-dash --redis-host 192.168.1.100 --redis-port 6380
|
|
275
278
|
bullmq-dash --queues email,notifications
|
|
279
|
+
bullmq-dash --prefix bull:taskService
|
|
276
280
|
`;
|
|
277
281
|
function parseCliArgs() {
|
|
278
282
|
try {
|
|
@@ -284,6 +288,7 @@ function parseCliArgs() {
|
|
|
284
288
|
"redis-password": { type: "string" },
|
|
285
289
|
"redis-db": { type: "string" },
|
|
286
290
|
"poll-interval": { type: "string" },
|
|
291
|
+
prefix: { type: "string" },
|
|
287
292
|
queues: { type: "string" },
|
|
288
293
|
help: { type: "boolean", short: "h" },
|
|
289
294
|
version: { type: "boolean", short: "v" }
|
|
@@ -296,6 +301,7 @@ function parseCliArgs() {
|
|
|
296
301
|
redisPassword: values["redis-password"],
|
|
297
302
|
redisDb: values["redis-db"] ? parseInt(values["redis-db"], 10) : undefined,
|
|
298
303
|
pollInterval: values["poll-interval"] ? parseInt(values["poll-interval"], 10) : undefined,
|
|
304
|
+
prefix: values.prefix,
|
|
299
305
|
queues: values.queues ? parseQueueNames(values.queues) : undefined,
|
|
300
306
|
help: values.help,
|
|
301
307
|
version: values.version
|
|
@@ -334,6 +340,7 @@ function loadConfig(cliArgs) {
|
|
|
334
340
|
db: cliArgs.redisDb ?? process.env.REDIS_DB
|
|
335
341
|
},
|
|
336
342
|
pollInterval: cliArgs.pollInterval ?? process.env.POLL_INTERVAL,
|
|
343
|
+
prefix: cliArgs.prefix ?? process.env.BULL_PREFIX,
|
|
337
344
|
queueNames: cliArgs.queues ?? parseQueueNames(process.env.QUEUE_NAMES)
|
|
338
345
|
};
|
|
339
346
|
const result = configSchema.safeParse(raw);
|
|
@@ -354,6 +361,7 @@ function createConfigFromPrompt(promptAnswers, cliArgs) {
|
|
|
354
361
|
db: cliArgs.redisDb ?? process.env.REDIS_DB
|
|
355
362
|
},
|
|
356
363
|
pollInterval: cliArgs.pollInterval ?? process.env.POLL_INTERVAL,
|
|
364
|
+
prefix: cliArgs.prefix ?? process.env.BULL_PREFIX,
|
|
357
365
|
queueNames: cliArgs.queues ?? parseQueueNames(process.env.QUEUE_NAMES)
|
|
358
366
|
};
|
|
359
367
|
const result = configSchema.safeParse(raw);
|
|
@@ -413,12 +421,11 @@ var queueCache = new Map;
|
|
|
413
421
|
var queueNamesCache = null;
|
|
414
422
|
var QUEUE_NAMES_CACHE_TTL = 5000;
|
|
415
423
|
var SCAN_COUNT = 1000;
|
|
416
|
-
var PREFIX = "bull:";
|
|
417
|
-
var SUFFIX = ":meta";
|
|
418
424
|
function getQueue(queueName) {
|
|
419
425
|
if (!queueCache.has(queueName)) {
|
|
420
426
|
const config2 = getConfig();
|
|
421
427
|
const queue = new Queue(queueName, {
|
|
428
|
+
prefix: config2.prefix,
|
|
422
429
|
connection: {
|
|
423
430
|
host: config2.redis.host,
|
|
424
431
|
port: config2.redis.port,
|
|
@@ -441,14 +448,17 @@ async function discoverQueueNames() {
|
|
|
441
448
|
}
|
|
442
449
|
const redis = getRedisClient();
|
|
443
450
|
const queueNames = new Set;
|
|
451
|
+
const prefix = config2.prefix + ":";
|
|
444
452
|
let cursor = "0";
|
|
445
453
|
do {
|
|
446
|
-
const [nextCursor, keys] = await redis.scan(cursor, "MATCH",
|
|
454
|
+
const [nextCursor, keys] = await redis.scan(cursor, "MATCH", `${config2.prefix}:*`, "COUNT", SCAN_COUNT);
|
|
447
455
|
cursor = nextCursor;
|
|
448
456
|
for (const key of keys) {
|
|
449
|
-
if (key.startsWith(
|
|
450
|
-
const
|
|
451
|
-
|
|
457
|
+
if (key.startsWith(prefix)) {
|
|
458
|
+
const rest = key.slice(prefix.length);
|
|
459
|
+
const colonIdx = rest.indexOf(":");
|
|
460
|
+
const queueName = colonIdx === -1 ? rest : rest.slice(0, colonIdx);
|
|
461
|
+
if (queueName) {
|
|
452
462
|
queueNames.add(queueName);
|
|
453
463
|
}
|
|
454
464
|
}
|
|
@@ -463,9 +473,10 @@ async function discoverQueueNames() {
|
|
|
463
473
|
}
|
|
464
474
|
async function getQueueStats(queueName) {
|
|
465
475
|
const queue = getQueue(queueName);
|
|
466
|
-
const [counts, isPaused] = await Promise.all([
|
|
476
|
+
const [counts, isPaused, schedulersCount] = await Promise.all([
|
|
467
477
|
queue.getJobCounts(),
|
|
468
|
-
queue.isPaused()
|
|
478
|
+
queue.isPaused(),
|
|
479
|
+
queue.getJobSchedulersCount()
|
|
469
480
|
]);
|
|
470
481
|
const waitCount = (counts.waiting || 0) + (counts.prioritized || 0);
|
|
471
482
|
return {
|
|
@@ -475,7 +486,8 @@ async function getQueueStats(queueName) {
|
|
|
475
486
|
active: counts.active || 0,
|
|
476
487
|
completed: counts.completed || 0,
|
|
477
488
|
failed: counts.failed || 0,
|
|
478
|
-
delayed: counts.delayed || 0
|
|
489
|
+
delayed: counts.delayed || 0,
|
|
490
|
+
schedulers: schedulersCount || 0
|
|
479
491
|
},
|
|
480
492
|
isPaused,
|
|
481
493
|
total: waitCount + (counts.active || 0) + (counts.completed || 0) + (counts.failed || 0) + (counts.delayed || 0)
|
|
@@ -547,6 +559,8 @@ async function getJobs(queueName, status, page = 1, pageSize = PAGE_SIZE) {
|
|
|
547
559
|
const delayedCounts = await queue.getJobCounts("delayed");
|
|
548
560
|
total = delayedCounts.delayed || 0;
|
|
549
561
|
break;
|
|
562
|
+
case "schedulers":
|
|
563
|
+
throw new Error("Cannot fetch schedulers via getJobs(). Use getJobSchedulers() instead.");
|
|
550
564
|
default:
|
|
551
565
|
jobs = [];
|
|
552
566
|
total = 0;
|
|
@@ -903,7 +917,7 @@ class PollingManager {
|
|
|
903
917
|
const updatedState = stateManager.getState();
|
|
904
918
|
const selectedQueue = queues[clampedIndex];
|
|
905
919
|
if (selectedQueue) {
|
|
906
|
-
if (updatedState.jobsStatus === "
|
|
920
|
+
if (updatedState.jobsStatus === "schedulers") {
|
|
907
921
|
const schedulersResult = await getJobSchedulers(selectedQueue.name, updatedState.schedulersPage);
|
|
908
922
|
stateManager.setState({
|
|
909
923
|
schedulers: schedulersResult.schedulers,
|
|
@@ -967,7 +981,7 @@ class PollingManager {
|
|
|
967
981
|
return;
|
|
968
982
|
}
|
|
969
983
|
try {
|
|
970
|
-
if (state.jobsStatus === "
|
|
984
|
+
if (state.jobsStatus === "schedulers") {
|
|
971
985
|
const schedulersResult = await getJobSchedulers(selectedQueue.name, state.schedulersPage);
|
|
972
986
|
stateManager.setState({
|
|
973
987
|
schedulers: schedulersResult.schedulers,
|
|
@@ -1033,7 +1047,8 @@ var colors = {
|
|
|
1033
1047
|
yellow: "#f9e2af",
|
|
1034
1048
|
peach: "#fab387",
|
|
1035
1049
|
red: "#f38ba8",
|
|
1036
|
-
mauve: "#cba6f7"
|
|
1050
|
+
mauve: "#cba6f7",
|
|
1051
|
+
maroon: "#eba0ac"
|
|
1037
1052
|
};
|
|
1038
1053
|
|
|
1039
1054
|
// src/ui/layout.ts
|
|
@@ -1285,7 +1300,7 @@ function updateQueueStats(elements, queue) {
|
|
|
1285
1300
|
const pausedIndicator = queue.isPaused ? " [PAUSED]" : "";
|
|
1286
1301
|
title.content = t2`${bold2(fg2(colors.text)(queue.name))}${fg2(colors.red)(pausedIndicator)}`;
|
|
1287
1302
|
const { counts } = queue;
|
|
1288
|
-
statsText.content = t2`${fg2(colors.yellow)(`wait: ${counts.wait}`)} ${fg2(colors.green)(`active: ${counts.active}`)} ${fg2(colors.blue)(`completed: ${counts.completed}`)} ${fg2(colors.red)(`failed: ${counts.failed}`)} ${fg2(colors.mauve)(`delayed: ${counts.delayed}`)}`;
|
|
1303
|
+
statsText.content = t2`${fg2(colors.yellow)(`wait: ${counts.wait}`)} ${fg2(colors.green)(`active: ${counts.active}`)} ${fg2(colors.blue)(`completed: ${counts.completed}`)} ${fg2(colors.red)(`failed: ${counts.failed}`)} ${fg2(colors.mauve)(`delayed: ${counts.delayed}`)} ${fg2(colors.maroon)(`schedulers: ${counts.schedulers}`)}`;
|
|
1289
1304
|
}
|
|
1290
1305
|
|
|
1291
1306
|
// src/ui/status-filter.ts
|
|
@@ -1319,7 +1334,7 @@ var STATUS_OPTIONS = [
|
|
|
1319
1334
|
{ key: "4", status: "completed", label: "completed" },
|
|
1320
1335
|
{ key: "5", status: "failed", label: "failed" },
|
|
1321
1336
|
{ key: "6", status: "delayed", label: "delayed" },
|
|
1322
|
-
{ key: "7", status: "
|
|
1337
|
+
{ key: "7", status: "schedulers", label: "schedulers" }
|
|
1323
1338
|
];
|
|
1324
1339
|
function createStatusFilter(renderer, parent) {
|
|
1325
1340
|
const container = new BoxRenderable4(renderer, {
|
|
@@ -1341,7 +1356,7 @@ function createStatusFilter(renderer, parent) {
|
|
|
1341
1356
|
}
|
|
1342
1357
|
function updateStatusFilter(elements, currentStatus) {
|
|
1343
1358
|
const { text } = elements;
|
|
1344
|
-
const parts = [
|
|
1359
|
+
const parts = [];
|
|
1345
1360
|
STATUS_OPTIONS.forEach(({ key, status, label }, index) => {
|
|
1346
1361
|
const isSelected = status === currentStatus;
|
|
1347
1362
|
if (isSelected) {
|
|
@@ -1692,7 +1707,7 @@ function createSchedulerList(renderer, parent) {
|
|
|
1692
1707
|
container.add(select);
|
|
1693
1708
|
const emptyText = new TextRenderable7(renderer, {
|
|
1694
1709
|
id: "scheduler-list-empty",
|
|
1695
|
-
content: "No
|
|
1710
|
+
content: "No job schedulers found",
|
|
1696
1711
|
fg: colors.overlay0,
|
|
1697
1712
|
position: "absolute",
|
|
1698
1713
|
left: 2,
|
|
@@ -2319,7 +2334,7 @@ class App {
|
|
|
2319
2334
|
case "return":
|
|
2320
2335
|
case "enter":
|
|
2321
2336
|
if (state.focusedPane === "jobs") {
|
|
2322
|
-
if (state.jobsStatus === "
|
|
2337
|
+
if (state.jobsStatus === "schedulers") {
|
|
2323
2338
|
await this.openSchedulerDetail();
|
|
2324
2339
|
} else {
|
|
2325
2340
|
await this.openJobDetail();
|
|
@@ -2330,7 +2345,7 @@ class App {
|
|
|
2330
2345
|
break;
|
|
2331
2346
|
case "left":
|
|
2332
2347
|
if (state.focusedPane === "jobs") {
|
|
2333
|
-
if (state.jobsStatus === "
|
|
2348
|
+
if (state.jobsStatus === "schedulers") {
|
|
2334
2349
|
stateManager.prevSchedulerPage();
|
|
2335
2350
|
await pollingManager.refreshSchedulers();
|
|
2336
2351
|
} else {
|
|
@@ -2341,7 +2356,7 @@ class App {
|
|
|
2341
2356
|
break;
|
|
2342
2357
|
case "right":
|
|
2343
2358
|
if (state.focusedPane === "jobs") {
|
|
2344
|
-
if (state.jobsStatus === "
|
|
2359
|
+
if (state.jobsStatus === "schedulers") {
|
|
2345
2360
|
stateManager.nextSchedulerPage();
|
|
2346
2361
|
await pollingManager.refreshSchedulers();
|
|
2347
2362
|
} else {
|
|
@@ -2351,7 +2366,7 @@ class App {
|
|
|
2351
2366
|
}
|
|
2352
2367
|
break;
|
|
2353
2368
|
case "d":
|
|
2354
|
-
if (state.focusedPane === "jobs" && state.jobsStatus !== "
|
|
2369
|
+
if (state.focusedPane === "jobs" && state.jobsStatus !== "schedulers" && state.jobs.length > 0) {
|
|
2355
2370
|
stateManager.showDeleteConfirm();
|
|
2356
2371
|
}
|
|
2357
2372
|
break;
|
|
@@ -2360,9 +2375,9 @@ class App {
|
|
|
2360
2375
|
break;
|
|
2361
2376
|
case "g":
|
|
2362
2377
|
if (state.focusedPane === "jobs") {
|
|
2363
|
-
if (state.jobsStatus === "
|
|
2378
|
+
if (state.jobsStatus === "schedulers" && state.schedulersTotalPages > 1) {
|
|
2364
2379
|
stateManager.showPageJumpModal();
|
|
2365
|
-
} else if (state.jobsStatus !== "
|
|
2380
|
+
} else if (state.jobsStatus !== "schedulers" && state.jobsTotalPages > 1) {
|
|
2366
2381
|
stateManager.showPageJumpModal();
|
|
2367
2382
|
}
|
|
2368
2383
|
}
|
|
@@ -2377,7 +2392,7 @@ class App {
|
|
|
2377
2392
|
const newStatus = getStatusFromKey(key.name);
|
|
2378
2393
|
if (newStatus) {
|
|
2379
2394
|
stateManager.setJobsStatus(newStatus);
|
|
2380
|
-
if (newStatus === "
|
|
2395
|
+
if (newStatus === "schedulers") {
|
|
2381
2396
|
stateManager.setState({
|
|
2382
2397
|
selectedSchedulerIndex: 0,
|
|
2383
2398
|
schedulersPage: 1
|
|
@@ -2455,7 +2470,7 @@ class App {
|
|
|
2455
2470
|
if (pageInput) {
|
|
2456
2471
|
const targetPage = parseInt(pageInput, 10);
|
|
2457
2472
|
if (!isNaN(targetPage) && targetPage >= 1) {
|
|
2458
|
-
if (state.jobsStatus === "
|
|
2473
|
+
if (state.jobsStatus === "schedulers") {
|
|
2459
2474
|
stateManager.goToSchedulerPage(targetPage);
|
|
2460
2475
|
await pollingManager.refreshSchedulers();
|
|
2461
2476
|
} else {
|
|
@@ -2490,8 +2505,8 @@ class App {
|
|
|
2490
2505
|
const selectedQueue = stateManager.getSelectedQueue();
|
|
2491
2506
|
updateQueueStats(queueStats, selectedQueue);
|
|
2492
2507
|
updateStatusFilter(statusFilter, state.jobsStatus);
|
|
2493
|
-
const
|
|
2494
|
-
if (
|
|
2508
|
+
const isSchedulersView = state.jobsStatus === "schedulers";
|
|
2509
|
+
if (isSchedulersView) {
|
|
2495
2510
|
jobList.container.visible = false;
|
|
2496
2511
|
showSchedulerList(schedulerList);
|
|
2497
2512
|
updateSchedulerList(schedulerList, state.schedulers, state.selectedSchedulerIndex, state.schedulersPage, state.schedulersTotalPages, state.schedulersTotal, state.focusedPane === "jobs");
|
|
@@ -2508,7 +2523,7 @@ class App {
|
|
|
2508
2523
|
} else {
|
|
2509
2524
|
hideConfirmDialog(confirmDialog);
|
|
2510
2525
|
}
|
|
2511
|
-
updatePageJump(pageJump, state.showPageJump, state.pageJumpInput,
|
|
2526
|
+
updatePageJump(pageJump, state.showPageJump, state.pageJumpInput, isSchedulersView ? state.schedulersPage : state.jobsPage, isSchedulersView ? state.schedulersTotalPages : state.jobsTotalPages);
|
|
2512
2527
|
}
|
|
2513
2528
|
async cleanup() {
|
|
2514
2529
|
pollingManager.stop();
|
|
@@ -2650,5 +2665,5 @@ async function main() {
|
|
|
2650
2665
|
}
|
|
2651
2666
|
main();
|
|
2652
2667
|
|
|
2653
|
-
//# debugId=
|
|
2668
|
+
//# debugId=9E6AA2BE6E8DE2BD64756E2164756E21
|
|
2654
2669
|
//# sourceMappingURL=index.js.map
|