chainmq 1.3.2

A Redis-backed, type-safe job queue for Rust. Provides job registration and execution, delayed jobs, retries with backoff, and scalable workers.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
<!doctype html>
<html lang="en" data-theme="dark">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>ChainMQ Dashboard</title>
    <link
      rel="icon"
      href="favicon.svg?v=chainmq-ui-1"
      type="image/svg+xml"
    />
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link
      href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap"
      rel="stylesheet"
    />
    <link rel="stylesheet" href="styles.css?v=chainmq-ui-46" />
  </head>
  <body>
    <div
      id="loginOverlay"
      class="login-overlay"
      hidden
      role="dialog"
      aria-modal="true"
      aria-labelledby="loginTitle"
    >
      <form id="loginForm" class="login-card" autocomplete="on">
        <h2 id="loginTitle" class="login-title">ChainMQ</h2>
        <p class="login-subtitle">Sign in to the dashboard</p>
        <label class="login-label">
          <span>Username</span>
          <input
            id="loginUsername"
            name="username"
            type="text"
            autocomplete="username"
            value="ChainMQ"
            required
            class="login-input"
          />
        </label>
        <label class="login-label">
          <span>Password</span>
          <input
            id="loginPassword"
            name="password"
            type="password"
            autocomplete="current-password"
            required
            class="login-input"
          />
        </label>
        <p id="loginError" class="login-error" hidden></p>
        <button type="submit" class="login-submit" id="loginSubmit">
          Sign in
        </button>
      </form>
    </div>
    <div class="app-container" id="appContainer">
      <div
        id="sidebarBackdrop"
        class="sidebar-backdrop"
        hidden
        aria-hidden="true"
      ></div>
      <!-- Sidebar (off-canvas on narrow viewports) -->
      <aside class="sidebar" id="sidebarNavDrawer" aria-label="Queues navigation">
        <div class="sidebar-header">
          <button
            type="button"
            id="sidebarCollapseBtn"
            class="icon-btn sidebar-collapse-btn"
            aria-expanded="true"
            aria-controls="sidebarQueuesNav"
            title="Collapse sidebar"
          >
            <svg
              class="sidebar-collapse-icon"
              width="20"
              height="20"
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              stroke-width="2"
              aria-hidden="true"
            >
              <path d="M15 18l-6-6 6-6" />
            </svg>
          </button>
          <div class="sidebar-header-body">
            <div class="logo">
              <svg
                width="24"
                height="24"
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                stroke-width="2"
              >
                <path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z" />
              </svg>
              <h1>ChainMQ</h1>
            </div>
            <div class="header-actions">
              <button id="themeToggle" class="icon-btn" title="Toggle theme">
              <svg
                id="themeIcon"
                width="20"
                height="20"
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                stroke-width="2"
              >
                <circle cx="12" cy="12" r="5" />
                <path
                  d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"
                />
              </svg>
              </button>
              <button id="refreshBtn" class="icon-btn" title="Refresh">
              <svg
                width="20"
                height="20"
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                stroke-width="2"
              >
                <path
                  d="M23 4v6h-6M1 20v-6h6M3.51 9a9 9 0 0 1 14.85-3.48L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"
                />
              </svg>
              </button>
            </div>
          </div>
        </div>
        <div class="sidebar-content" id="sidebarQueuesNav">
          <div class="queues-section">
            <h2>Queues</h2>
            <div id="queues-list" class="queues-list">
              <div class="loading-queues">Loading queues...</div>
            </div>
          </div>
        </div>
        <div class="sidebar-footer">
          <button
            type="button"
            id="logoutBtn"
            class="sidebar-logout-btn"
            title="Sign out"
            hidden
            aria-label="Sign out"
          >
            <svg
              width="20"
              height="20"
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              stroke-width="2"
              aria-hidden="true"
            >
              <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
              <polyline points="16 17 21 12 16 7" />
              <line x1="21" y1="12" x2="9" y2="12" />
            </svg>
            <span class="sidebar-logout-label">Sign out</span>
          </button>
        </div>
      </aside>

      <!-- Main Content -->
      <main class="main-content">
        <header class="mobile-chrome" aria-label="Mobile toolbar">
          <div class="mobile-chrome-brand">
            <svg
              class="mobile-chrome-mark"
              width="24"
              height="24"
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              stroke-width="2"
              aria-hidden="true"
            >
              <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" />
            </svg>
            <span class="mobile-chrome-title">ChainMQ</span>
          </div>
          <button
            type="button"
            id="mobileNavOpenBtn"
            class="icon-btn mobile-nav-open-btn"
            aria-expanded="false"
            aria-controls="sidebarNavDrawer"
            title="Open menu"
            aria-label="Open menu"
          >
            <svg
              class="mobile-nav-open-icon"
              width="22"
              height="22"
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              stroke-width="2"
              aria-hidden="true"
            >
              <path d="M4 6h16M4 12h16M4 18h16" />
            </svg>
          </button>
        </header>
        <div id="empty-state" class="empty-state-main">
          <div class="empty-icon">
            <svg
              width="64"
              height="64"
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              stroke-width="1.5"
            >
              <path d="M9 12l2 2 4-4" />
              <path d="M21 12c-1 0-3-1-3-3s2-3 3-3 3 1 3 3-2 3-3 3" />
              <path d="M3 12c1 0 3-1 3-3s-2-3-3-3-3 1-3 3 2 3 3 3" />
              <path d="M12 3c0 1-1 3-3 3S6 4 6 3s1-3 3-3 3 2 3 3" />
              <path d="M12 21c0-1-1-3-3-3s-3 2-3 3 1 3 3 3 3-2 3-3" />
            </svg>
          </div>
          <h2>Select a queue to view jobs</h2>
          <p>Choose a queue from the sidebar to start monitoring jobs</p>
        </div>

        <div id="queue-view" class="queue-view" style="display: none">
          <!-- Queue Header -->
          <div class="queue-header">
            <div class="queue-title">
              <div class="queue-title-text">
                <span class="queue-eyebrow">Queue</span>
                <h2 id="queue-name-display">Queue Name</h2>
              </div>
              <div class="queue-actions">
                <button
                  id="processDelayedBtn"
                  class="btn btn-secondary btn-icon"
                >
                  <svg
                    width="16"
                    height="16"
                    viewBox="0 0 24 24"
                    fill="none"
                    stroke="currentColor"
                    stroke-width="2"
                  >
                    <circle cx="12" cy="12" r="10" />
                    <polyline points="12 6 12 12 16 14" />
                  </svg>
                  Process Delayed
                </button>
                <button
                  type="button"
                  id="processRepeatBtn"
                  class="btn btn-secondary btn-icon"
                  title="Promote due repeat schedules"
                >
                  Process Repeat
                </button>
                <button
                  type="button"
                  id="pauseQueueBtn"
                  class="btn btn-secondary btn-icon"
                >
                  Pause queue
                </button>
                <button
                  type="button"
                  id="resumeQueueBtn"
                  class="btn btn-secondary btn-icon"
                >
                  Resume queue
                </button>
                <button
                  type="button"
                  id="redisStatsBtn"
                  class="btn btn-secondary btn-icon"
                  title="Redis server memory and health"
                >
                  <svg
                    width="16"
                    height="16"
                    viewBox="0 0 24 24"
                    fill="none"
                    stroke="currentColor"
                    stroke-width="2"
                    aria-hidden="true"
                  >
                    <ellipse cx="12" cy="5" rx="9" ry="3" />
                    <path d="M3 5v7c0 1.66 4 3 9 3s9-1.34 9-3V5" />
                    <path d="M3 12v7c0 1.66 4 3 9 3s9-1.34 9-3v-7" />
                  </svg>
                  Redis
                </button>
                <button
                  id="recoverStalledBtn"
                  class="btn btn-secondary btn-icon"
                >
                  <svg
                    width="16"
                    height="16"
                    viewBox="0 0 24 24"
                    fill="none"
                    stroke="currentColor"
                    stroke-width="2"
                  >
                    <path d="M1 4v6h6M23 20v-6h-6" />
                    <path
                      d="M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15"
                    />
                  </svg>
                  Recover Stalled
                </button>
                <button id="cleanBtn" class="btn btn-secondary btn-icon">
                  <svg
                    width="16"
                    height="16"
                    viewBox="0 0 24 24"
                    fill="none"
                    stroke="currentColor"
                    stroke-width="2"
                  >
                    <polyline points="3 6 5 6 21 6" />
                    <path
                      d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"
                    />
                  </svg>
                  Clean
                </button>
              </div>
            </div>
          </div>

          <!-- Job state rail (single filter + counts) -->
          <div
            class="stats-cards"
            role="tablist"
            aria-label="Job state"
          >
            <div
              class="stat-card active"
              data-state="completed"
              role="tab"
              aria-selected="true"
            >
              <div class="stat-icon completed">
                <svg
                  width="24"
                  height="24"
                  viewBox="0 0 24 24"
                  fill="none"
                  stroke="currentColor"
                  stroke-width="2"
                >
                  <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14" />
                  <polyline points="22 4 12 14.01 9 11.01" />
                </svg>
              </div>
              <div class="stat-info">
                <div class="stat-label">Completed</div>
                <div class="stat-value" id="stat-completed">0</div>
              </div>
            </div>
            <div
              class="stat-card"
              data-state="waiting"
              role="tab"
              aria-selected="false"
            >
              <div class="stat-icon waiting">
                <svg
                  width="24"
                  height="24"
                  viewBox="0 0 24 24"
                  fill="none"
                  stroke="currentColor"
                  stroke-width="2"
                >
                  <circle cx="12" cy="12" r="10" />
                  <polyline points="12 6 12 12 16 14" />
                </svg>
              </div>
              <div class="stat-info">
                <div class="stat-label">Waiting</div>
                <div class="stat-value" id="stat-waiting">0</div>
              </div>
            </div>
            <div
              class="stat-card"
              data-state="active"
              role="tab"
              aria-selected="false"
            >
              <div class="stat-icon active">
                <svg
                  width="24"
                  height="24"
                  viewBox="0 0 24 24"
                  fill="none"
                  stroke="currentColor"
                  stroke-width="2"
                >
                  <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" />
                </svg>
              </div>
              <div class="stat-info">
                <div class="stat-label">Active</div>
                <div class="stat-value" id="stat-active">0</div>
              </div>
            </div>
            <div
              class="stat-card"
              data-state="delayed"
              role="tab"
              aria-selected="false"
            >
              <div class="stat-icon delayed">
                <svg
                  width="24"
                  height="24"
                  viewBox="0 0 24 24"
                  fill="none"
                  stroke="currentColor"
                  stroke-width="2"
                >
                  <circle cx="12" cy="12" r="10" />
                  <polyline points="12 6 12 12 16 14" />
                </svg>
              </div>
              <div class="stat-info">
                <div class="stat-label">Delayed</div>
                <div class="stat-value" id="stat-delayed">0</div>
              </div>
            </div>
            <div
              class="stat-card"
              data-state="failed"
              role="tab"
              aria-selected="false"
            >
              <div class="stat-icon failed">
                <svg
                  width="24"
                  height="24"
                  viewBox="0 0 24 24"
                  fill="none"
                  stroke="currentColor"
                  stroke-width="2"
                >
                  <circle cx="12" cy="12" r="10" />
                  <line x1="15" y1="9" x2="9" y2="15" />
                  <line x1="9" y1="9" x2="15" y2="15" />
                </svg>
              </div>
              <div class="stat-info">
                <div class="stat-label">Failed</div>
                <div class="stat-value" id="stat-failed">0</div>
              </div>
            </div>
          </div>

          <!-- Jobs Section -->
          <div class="jobs-section">
            <div class="jobs-header">
              <p id="jobsContextLabel" class="jobs-context-label" aria-live="polite">
                Showing Completed jobs
              </p>
              <div class="jobs-controls">
                <select
                  id="pageSizeSelect"
                  class="page-size-select"
                  aria-label="Jobs per page"
                  title="Jobs per page"
                >
                  <option value="10">10</option>
                  <option value="25" selected>25</option>
                  <option value="50">50</option>
                  <option value="100">100</option>
                </select>
                <div class="search-wrapper">
                  <svg
                    width="16"
                    height="16"
                    viewBox="0 0 24 24"
                    fill="none"
                    stroke="currentColor"
                    stroke-width="2"
                    aria-hidden="true"
                  >
                    <circle cx="11" cy="11" r="8" />
                    <path d="m21 21-4.35-4.35" />
                  </svg>
                  <input
                    type="text"
                    id="searchInput"
                    class="search-input"
                    placeholder="Search jobs..."
                  />
                </div>
              </div>
            </div>

            <div
              id="jobsBulkBar"
              class="jobs-bulk-bar"
              style="display: none"
              role="region"
              aria-label="Bulk actions for selected jobs"
            >
              <span id="bulkSelectionCount" class="bulk-selection-count"
                >0 jobs selected</span
              >
              <div class="bulk-actions">
                <button
                  type="button"
                  id="bulkClearBtn"
                  class="btn btn-secondary btn-sm"
                >
                  Clear selection
                </button>
                <button
                  type="button"
                  id="bulkRetryBtn"
                  class="btn btn-success btn-sm"
                  style="display: none"
                >
                  Retry selected
                </button>
                <button
                  type="button"
                  id="bulkDeleteBtn"
                  class="btn btn-danger btn-sm"
                >
                  Delete selected
                </button>
              </div>
            </div>

            <div class="jobs-table-container">
              <table class="jobs-table">
                <thead>
                  <tr>
                    <th class="col-select" scope="col">
                      <input
                        type="checkbox"
                        id="selectAllJobsCheckbox"
                        title="Select all jobs in the current list (all pages; respects search filter)"
                        aria-label="Select all jobs in list"
                      />
                    </th>
                    <th>ID</th>
                    <th>Name</th>
                    <th>State</th>
                    <th>Created</th>
                    <th>Attempts</th>
                    <th>Actions</th>
                  </tr>
                </thead>
                <tbody id="jobs-table-body">
                  <tr>
                    <td colspan="7" class="loading-jobs">Loading jobs...</td>
                  </tr>
                </tbody>
              </table>
            </div>

            <div class="pagination" id="pagination" style="display: none">
              <button id="prevPage" class="btn btn-secondary btn-sm">
                Previous
              </button>
              <span id="pageInfo" class="page-info">Page 1 of 1</span>
              <button id="nextPage" class="btn btn-secondary btn-sm">
                Next
              </button>
            </div>
          </div>
        </div>

        <!-- Job detail (full page) -->
        <div id="job-detail-view" class="job-detail-view" style="display: none">
          <div class="job-detail-toolbar">
            <button
              type="button"
              id="jobDetailBackBtn"
              class="btn btn-secondary btn-icon job-detail-back"
            >
              <svg
                width="16"
                height="16"
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                stroke-width="2"
                aria-hidden="true"
              >
                <path d="M19 12H5M12 19l-7-7 7-7" />
              </svg>
              Back to queue
            </button>
            <div class="job-detail-toolbar-live" aria-live="polite">
              <span id="jobDetailUpdatedLabel" class="job-detail-updated-label"
                >Updated —</span
              >
              <button
                type="button"
                id="jobDetailRefreshBtn"
                class="icon-btn job-detail-toolbar-refresh"
                title="Refresh job"
                aria-label="Refresh job"
              >
                <svg
                  width="18"
                  height="18"
                  viewBox="0 0 24 24"
                  fill="none"
                  stroke="currentColor"
                  stroke-width="2"
                >
                  <path
                    d="M23 4v6h-6M1 20v-6h6M3.51 9a9 9 0 0 1 14.85-3.48L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"
                  />
                </svg>
              </button>
              <label class="job-detail-auto-refresh">
                <input type="checkbox" id="jobDetailAutoRefresh" checked />
                <span>Auto</span>
              </label>
            </div>
            <div class="job-detail-toolbar-actions">
              <button
                type="button"
                id="retryJobBtn"
                class="btn btn-success btn-icon"
                style="display: none"
              >
                <svg
                  width="16"
                  height="16"
                  viewBox="0 0 24 24"
                  fill="none"
                  stroke="currentColor"
                  stroke-width="2"
                >
                  <path d="M1 4v6h6M23 20v-6h-6" />
                  <path
                    d="M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15"
                  />
                </svg>
                Retry job
              </button>
              <details class="job-detail-overflow" id="jobDetailOverflow">
                <summary
                  class="job-detail-overflow-trigger icon-btn"
                  title="More actions"
                  aria-label="More actions"
                >
                  <svg
                    width="18"
                    height="18"
                    viewBox="0 0 24 24"
                    fill="none"
                    stroke="currentColor"
                    stroke-width="2"
                  >
                    <circle cx="12" cy="12" r="1" fill="currentColor" />
                    <circle cx="19" cy="12" r="1" fill="currentColor" />
                    <circle cx="5" cy="12" r="1" fill="currentColor" />
                  </svg>
                </summary>
                <div class="job-detail-overflow-menu" role="menu">
                  <button type="button" class="job-detail-overflow-item" id="jobDetailCopyLinkBtn" role="menuitem">
                    Copy link
                  </button>
                  <button type="button" class="job-detail-overflow-item" id="jobDetailCopyIdBtn" role="menuitem">
                    Copy job ID
                  </button>
                  <button type="button" class="job-detail-overflow-item job-detail-overflow-item--danger" id="deleteJobBtn" role="menuitem">
                    Delete job
                  </button>
                </div>
              </details>
            </div>
          </div>
          <div class="job-detail-scroll">
            <div id="jobDetailContent" class="job-detail-content-inner">
              <p class="job-detail-loading">Loading job…</p>
            </div>
          </div>
        </div>
      </main>
    </div>

    <div
      id="redisModalOverlay"
      class="redis-modal-overlay"
      hidden
      role="dialog"
      aria-modal="true"
      aria-labelledby="redisModalTitle"
    >
      <div class="redis-modal" role="document">
        <header class="redis-modal__head">
          <h2 id="redisModalTitle" class="redis-modal__title">Redis</h2>
          <button
            type="button"
            class="redis-modal__close icon-btn"
            id="redisModalCloseBtn"
            aria-label="Close"
          >
            <svg
              width="20"
              height="20"
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              stroke-width="2"
              aria-hidden="true"
            >
              <path d="M18 6L6 18M6 6l12 12" />
            </svg>
          </button>
        </header>
        <p class="redis-modal__lede job-detail-muted">
          Shared instance behind this dashboard (not per-queue job counts).
        </p>
        <div
          id="queueRedisStatsBody"
          class="redis-infra__body redis-modal__panel"
        ></div>
      </div>
    </div>

    <script src="app.js?v=chainmq-ui-44"></script>
  </body>
</html>