@zintrust/queue-monitor 2.4.7 → 2.8.0

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.
@@ -6,6 +6,64 @@ const objectIds = new WeakMap();
6
6
  let nextObjectId = 0;
7
7
  const isAllQueuesSelection = (queue) => queue === ALL_QUEUES;
8
8
  const sortJobsByTimestamp = (jobs) => jobs.toSorted((left, right) => right.timestamp - left.timestamp);
9
+ const jobIdentity = (job) => {
10
+ const queue = job.queue ?? '';
11
+ const id = String(job.id ?? '');
12
+ const timestamp = Number.isFinite(job.timestamp) ? String(job.timestamp) : '';
13
+ return `${queue}::${id}::${timestamp}`;
14
+ };
15
+ const dedupeJobs = (jobs) => {
16
+ const seen = new Set();
17
+ return jobs.filter((job) => {
18
+ const identity = jobIdentity(job);
19
+ if (seen.has(identity))
20
+ return false;
21
+ seen.add(identity);
22
+ return true;
23
+ });
24
+ };
25
+ const jobSummaryFromDriverJob = (queueName, job, now) => {
26
+ // Use the actual state from BullMQ if available.
27
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
+ const jobState = job._state;
29
+ const isFailed = Boolean(job.failedReason) || jobState === 'failed';
30
+ const isCompleted = Boolean(job.finishedOn) || jobState === 'completed';
31
+ const isActive = Boolean(job.processedOn && !job.finishedOn && !job.failedReason) || jobState === 'active';
32
+ const isDelayed = jobState === 'delayed';
33
+ const isPaused = jobState === 'paused';
34
+ let status;
35
+ if (isFailed) {
36
+ status = 'failed';
37
+ }
38
+ else if (isCompleted) {
39
+ status = 'completed';
40
+ }
41
+ else if (isActive) {
42
+ status = 'active';
43
+ }
44
+ else if (isDelayed) {
45
+ status = 'delayed';
46
+ }
47
+ else if (isPaused) {
48
+ status = 'paused';
49
+ }
50
+ else {
51
+ status = 'waiting';
52
+ }
53
+ return {
54
+ id: job.id,
55
+ name: job.name,
56
+ queue: queueName,
57
+ data: job.data,
58
+ opts: job.opts,
59
+ attempts: job.attemptsMade,
60
+ status,
61
+ failedReason: job.failedReason || undefined,
62
+ timestamp: job.timestamp ?? now,
63
+ processedOn: job.processedOn ?? undefined,
64
+ finishedOn: job.finishedOn ?? undefined,
65
+ };
66
+ };
9
67
  export const emptyLockAnalytics = () => ({
10
68
  locks: [],
11
69
  metrics: { active: 0, attempts: 0, acquired: 0, collisions: 0, collisionRate: 0 },
@@ -236,63 +294,18 @@ export const QueueMonitoringStream = (res, req, getSnapshot, getLocks, metrics,
236
294
  });
237
295
  };
238
296
  export async function getRecentJobsForQueue(queueName, metrics, driver) {
239
- const [recent, failed] = await Promise.all([
297
+ const [recent, failed, driverJobs] = await Promise.all([
240
298
  metrics.getRecentJobs(queueName).catch(() => []),
241
299
  metrics.getFailedJobs(queueName).catch(() => []),
300
+ driver.getRecentJobs(queueName, 100).catch((error) => {
301
+ Logger.warn('[queue-monitor] Driver recent jobs unavailable; returning no jobs', error);
302
+ return [];
303
+ }),
242
304
  ]);
243
- const all = sortJobsByTimestamp([...recent, ...failed].map((job) => ({
305
+ const now = Date.now();
306
+ const liveJobs = driverJobs.map((job) => jobSummaryFromDriverJob(queueName, job, now));
307
+ return dedupeJobs(sortJobsByTimestamp([...recent, ...failed, ...liveJobs].map((job) => ({
244
308
  ...job,
245
309
  queue: job.queue ?? queueName,
246
- }))).slice(0, 100);
247
- if (all.length > 0) {
248
- return all;
249
- }
250
- const jobs = await driver.getRecentJobs(queueName, 100).catch((error) => {
251
- Logger.warn('[queue-monitor] Driver recent jobs unavailable; returning no jobs', error);
252
- return [];
253
- });
254
- const now = Date.now();
255
- return jobs.map((job) => {
256
- // Use the actual state from BullMQ if available
257
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
258
- const jobState = job._state;
259
- // Fallback detection if state is not available
260
- const isFailed = Boolean(job.failedReason) || jobState === 'failed';
261
- const isCompleted = Boolean(job.finishedOn) || jobState === 'completed';
262
- const isActive = Boolean(job.processedOn && !job.finishedOn && !job.failedReason) || jobState === 'active';
263
- const isDelayed = jobState === 'delayed';
264
- const isPaused = jobState === 'paused';
265
- let status;
266
- if (isFailed) {
267
- status = 'failed';
268
- }
269
- else if (isCompleted) {
270
- status = 'completed';
271
- }
272
- else if (isActive) {
273
- status = 'active';
274
- }
275
- else if (isDelayed) {
276
- status = 'delayed';
277
- }
278
- else if (isPaused) {
279
- status = 'paused';
280
- }
281
- else {
282
- status = 'waiting';
283
- }
284
- return {
285
- id: job.id,
286
- name: job.name,
287
- queue: queueName,
288
- data: job.data,
289
- opts: job.opts,
290
- attempts: job.attemptsMade,
291
- status,
292
- failedReason: job.failedReason || undefined,
293
- timestamp: job.timestamp ?? now,
294
- processedOn: job.processedOn ?? undefined,
295
- finishedOn: job.finishedOn ?? undefined,
296
- };
297
- });
310
+ })))).slice(0, 100);
298
311
  }
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@zintrust/queue-monitor",
3
- "version": "2.4.6",
4
- "buildDate": "2026-06-11T20:48:32.186Z",
3
+ "version": "2.8.0",
4
+ "buildDate": "2026-06-25T15:00:38.667Z",
5
5
  "buildEnvironment": {
6
- "node": "v22.22.1",
7
- "platform": "darwin",
8
- "arch": "arm64"
6
+ "node": "v20.20.2",
7
+ "platform": "linux",
8
+ "arch": "x64"
9
9
  },
10
10
  "git": {
11
- "commit": "5a1a7000",
12
- "branch": "release"
11
+ "commit": "4f1c19ee",
12
+ "branch": "master"
13
13
  },
14
14
  "package": {
15
15
  "engines": {
@@ -38,12 +38,8 @@
38
38
  "sha256": "949569e78120329804b63736b25c8cff9b5516ca44c9e7f1b2989d9cb09360b9"
39
39
  },
40
40
  "QueueMonitoringService.js": {
41
- "size": 10048,
42
- "sha256": "3b7e85e6a0ba5dd958010bdf023052b1fb66cfbb52047554b326b4465b817719"
43
- },
44
- "build-manifest.json": {
45
- "size": 3871,
46
- "sha256": "e528885f6647e617d567e6e7231f1abef4878bfee18c4a0b1cae7172984162cc"
41
+ "size": 10412,
42
+ "sha256": "a3c94f60d0f2adf223301bd7002270a9fc404cf44c516776801cec1ba3292df7"
47
43
  },
48
44
  "connection.d.ts": {
49
45
  "size": 287,
@@ -66,32 +62,32 @@
66
62
  "sha256": "5140191207b5620500ac5e1edacefed65956a1ad88739695d545ea7d2b405243"
67
63
  },
68
64
  "dashboard-ui.js": {
69
- "size": 54132,
70
- "sha256": "1a017b07922c7f37e4717547b2d97cfb76b2460a4f3c9659ec9e5c2a41ebf889"
65
+ "size": 60096,
66
+ "sha256": "9f2b40d3921efbdb2ed84bd43b05bd7770b8af2c328448de6e0df1070c94860a"
71
67
  },
72
68
  "driver-index.d.ts": {
73
- "size": 287,
74
- "sha256": "915a41bc57b3a5d826832bd4a899861ddbfd15a66ab04f7a599454a248222480"
69
+ "size": 311,
70
+ "sha256": "67cb3435d023bbb76ef968f722e2a6ff206a56d911671ba0d14504d04196cbe1"
75
71
  },
76
72
  "driver-index.js": {
77
73
  "size": 184,
78
74
  "sha256": "fb91df973acd13a88cca443e50ecdd34944c66e1a1d48333f63099079a00f3c9"
79
75
  },
80
76
  "driver.d.ts": {
81
- "size": 1417,
82
- "sha256": "9aa9e6ac31d8a0a3d4145a8228bd61180be89e7170b02d1290fcb732a4c217a1"
77
+ "size": 1758,
78
+ "sha256": "967003567f92527f389046f7fbbf221146ae56254becc6c07a8c4e0e5261d954"
83
79
  },
84
80
  "driver.js": {
85
- "size": 12508,
86
- "sha256": "c77e609af5d2c05b96fd5512c9597cb5e37c3e7a187cf8face4c94ce7fbc7990"
81
+ "size": 16226,
82
+ "sha256": "b6125ade0a562d2bef8579e51b769b78de64e204dfc834aae729754d2922b323"
87
83
  },
88
84
  "index.d.ts": {
89
- "size": 2344,
90
- "sha256": "370b578ca6412fbdbb2f6966c0899a4c9d6d1ab08defe48a9004564124b1f45e"
85
+ "size": 2368,
86
+ "sha256": "ae9a03519f69648e9c71d4fbd1f00fb7aa27be714e10cc0786ea8696aea2b327"
91
87
  },
92
88
  "index.js": {
93
- "size": 17226,
94
- "sha256": "ea914e117c67999b35ebe5da07af9e4301a9360f522645be918ef3c541d1fa5c"
89
+ "size": 18434,
90
+ "sha256": "557c5158dcec80fdf55e568fc4fc0a8da49c54b717dfc739aff63cc3c4797299"
95
91
  },
96
92
  "metrics-index.d.ts": {
97
93
  "size": 239,
@@ -115,6 +115,15 @@ html[data-theme="light"] .refresh-btn:hover { background: rgba(2, 132, 199, 0.16
115
115
  .recover-btn { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border-color: rgba(245, 158, 11, 0.35); }
116
116
  .recover-btn:hover { background: rgba(245, 158, 11, 0.2); }
117
117
 
118
+ .job-tab-bar { display: flex; gap: 0; padding: 0 8px; border-bottom: 1px solid var(--border); overflow-x: auto; }
119
+ .job-tab { background: transparent; border: none; border-bottom: 2px solid transparent; padding: 9px 12px; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); transition: color 0.15s, border-color 0.15s; margin-bottom: -1px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
120
+ .job-tab:hover { color: var(--text); }
121
+ .job-tab.active-tab { color: var(--accent); border-bottom-color: var(--accent); }
122
+ .job-tab-count { background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 800; min-width: 16px; text-align: center; }
123
+ .job-tab.active-tab .job-tab-count { background: rgba(186,230,253,0.12); }
124
+ html[data-theme="light"] .job-tab-count { background: rgba(0,0,0,0.06); }
125
+ html[data-theme="light"] .job-tab.active-tab .job-tab-count { background: rgba(2,132,199,0.12); }
126
+
118
127
  #error-container { display: none; margin-bottom: 2rem; padding: 1rem; background: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); border-radius: 0.5rem; font-size: 13px; font-weight: 600; }
119
128
  code { background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 12px; color: var(--accent); border: 1px solid var(--border); }
120
129
 
@@ -195,11 +204,21 @@ const getLocksSection = () => `
195
204
  `;
196
205
  const getJobsSection = () => `
197
206
  <div class="tile" style="margin-top: 24px; padding: 0;">
198
- <div style="padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border);">
207
+ <div style="padding: 16px 20px; display: flex; justify-content: space-between; align-items: center;">
199
208
  <h3 style="margin: 0; font-size: 14px; font-weight: 800; color: var(--text);">Recent Jobs</h3>
200
- <select id="queue-select">
201
- <!-- Queues inserted here -->
202
- </select>
209
+ <div style="display: flex; align-items: center; gap: 10px; flex-wrap: wrap;">
210
+ <button id="jobs-refresh" class="refresh-btn" type="button">Refresh jobs</button>
211
+ <select id="queue-select">
212
+ <!-- Queues inserted here -->
213
+ </select>
214
+ </div>
215
+ </div>
216
+ <div class="job-tab-bar">
217
+ <button class="job-tab active-tab" data-status="all" type="button" onclick="setJobStatusFilter('all')">All <span class="job-tab-count" id="tab-count-all">—</span></button>
218
+ <button class="job-tab" data-status="active" type="button" onclick="setJobStatusFilter('active')">Active <span class="job-tab-count" id="tab-count-active">—</span></button>
219
+ <button class="job-tab" data-status="waiting" type="button" onclick="setJobStatusFilter('waiting')">Waiting <span class="job-tab-count" id="tab-count-waiting">—</span></button>
220
+ <button class="job-tab" data-status="failed" type="button" onclick="setJobStatusFilter('failed')">Failed <span class="job-tab-count" id="tab-count-failed">—</span></button>
221
+ <button class="job-tab" data-status="completed" type="button" onclick="setJobStatusFilter('completed')">Completed <span class="job-tab-count" id="tab-count-completed">—</span></button>
203
222
  </div>
204
223
  <div style="overflow-x: auto;">
205
224
  <table id="jobs-table">
@@ -253,6 +272,9 @@ const getDashboardScriptState = (options) => String.raw `
253
272
  let dashboardResetTimer = null;
254
273
  let reconnectAttempts = 0;
255
274
  let currentTheme = null;
275
+ const JOB_STATUS_FILTER_KEY = 'zintrust-queue-monitor-job-status-filter';
276
+ let currentJobStatusFilter = localStorage.getItem(JOB_STATUS_FILTER_KEY) || 'all';
277
+ let allJobsCache = [];
256
278
  `;
257
279
  const getDashboardScriptTheme = () => `
258
280
  function getPreferredTheme() {
@@ -524,7 +546,7 @@ const getRenderJobsStateFunction = () => `
524
546
  const getRenderJobsIdentityHelpersFunction = () => `
525
547
  function getJobId(job) {
526
548
  const queue = job.queue || currentQueue || '';
527
- const id = job.id == null ? '' : String(job.id);
549
+ const id = String(job.id ?? '');
528
550
  const timestamp = Number.isFinite(job.timestamp) ? String(job.timestamp) : '';
529
551
  return queue + '::' + id + '::' + timestamp;
530
552
  }
@@ -704,9 +726,8 @@ const getRenderJobsRowHelpersFunction = () => `
704
726
  }
705
727
  `;
706
728
  const getRenderJobsFunction = () => `
707
- function renderJobs(jobs) {
729
+ function _renderJobsToDOM(jobList) {
708
730
  const tbody = document.querySelector('#jobs-table tbody');
709
- const jobList = Array.isArray(jobs) ? jobs : [];
710
731
 
711
732
  if (jobList.length === 0) {
712
733
  ensureEmptyJobsState(tbody);
@@ -736,7 +757,47 @@ const getRenderJobsFunction = () => `
736
757
 
737
758
  expandedJobIds = new Set([...expandedJobIds].filter(id => currentJobIds.has(id)));
738
759
  tbody.replaceChildren(fragment);
760
+ }
761
+
762
+ function renderJobs(jobs) {
763
+ allJobsCache = Array.isArray(jobs) ? jobs : [];
764
+ updateJobTabCounts(allJobsCache);
765
+ applyJobStatusFilter();
739
766
  }`;
767
+ const getJobStatusTabsFunction = () => `
768
+ function updateJobTabCounts(jobs) {
769
+ const counts = { all: jobs.length, active: 0, waiting: 0, failed: 0, completed: 0 };
770
+ jobs.forEach(function(job) {
771
+ const status = (job.status || (job.failedReason ? 'failed' : 'completed')).toLowerCase();
772
+ if (Object.prototype.hasOwnProperty.call(counts, status)) {
773
+ counts[status]++;
774
+ }
775
+ });
776
+ Object.keys(counts).forEach(function(status) {
777
+ const el = document.getElementById('tab-count-' + status);
778
+ if (el) el.textContent = String(counts[status]);
779
+ });
780
+ }
781
+
782
+ function applyJobStatusFilter() {
783
+ const filtered = currentJobStatusFilter === 'all'
784
+ ? allJobsCache
785
+ : allJobsCache.filter(function(job) {
786
+ const status = (job.status || (job.failedReason ? 'failed' : 'completed')).toLowerCase();
787
+ return status === currentJobStatusFilter;
788
+ });
789
+ _renderJobsToDOM(filtered);
790
+ }
791
+
792
+ function setJobStatusFilter(status) {
793
+ currentJobStatusFilter = status;
794
+ localStorage.setItem(JOB_STATUS_FILTER_KEY, status);
795
+ document.querySelectorAll('.job-tab').forEach(function(btn) {
796
+ btn.classList.toggle('active-tab', btn.dataset.status === status);
797
+ });
798
+ applyJobStatusFilter();
799
+ }
800
+ `;
740
801
  const getRenderLocksFunction = () => `
741
802
  // Track expanded lock keys to preserve state during SSE updates
742
803
  let expandedLockKeys = new Set();
@@ -994,7 +1055,7 @@ const getRecoverActiveJobFunction = () => `
994
1055
  ? 'Removed'
995
1056
  : 'Recovered';
996
1057
  setTimeout(() => {
997
- console.log('HTTP jobs polling disabled - using SSE only');
1058
+ fetchData();
998
1059
  }, 1000);
999
1060
  } else {
1000
1061
  btn.textContent = 'Failed';
@@ -1024,8 +1085,7 @@ const getRetryJobFunction = () => `
1024
1085
  ? '✓ Requeued'
1025
1086
  : '✓ Retried';
1026
1087
  setTimeout(() => {
1027
- console.log('HTTP jobs polling disabled - using SSE only');
1028
- // fetchJobs(currentQueue);
1088
+ fetchData();
1029
1089
  }, 1000);
1030
1090
  } else {
1031
1091
  btn.textContent = '✗ Failed';
@@ -1197,11 +1257,7 @@ const getDashboardScriptEventStream = () => `
1197
1257
  }
1198
1258
  `;
1199
1259
  const getFetchDataFunction = () => `
1200
- // HTTP polling disabled - 100% SSE reliance
1201
1260
  async function fetchData() {
1202
- console.log('HTTP polling disabled - using SSE only');
1203
- // Disabled to ensure 100% SSE streaming
1204
- /*
1205
1261
  try {
1206
1262
  document.getElementById('error-container').style.display = 'none';
1207
1263
  const res = await fetch(API_BASE + '/api/snapshot');
@@ -1209,18 +1265,26 @@ const getFetchDataFunction = () => `
1209
1265
  const data = await res.json();
1210
1266
 
1211
1267
  renderStats(data);
1212
- updateQueueSelect(data.queues);
1268
+ const nextQueue = updateQueueSelect(data.queues || []);
1269
+ currentQueue = nextQueue;
1270
+ if (currentQueue) {
1271
+ localStorage.setItem(QUEUE_KEY, currentQueue);
1272
+ } else {
1273
+ localStorage.removeItem(QUEUE_KEY);
1274
+ }
1213
1275
  handleQueueSelection(data);
1276
+ if (currentQueue) {
1277
+ await fetchJobs(currentQueue);
1278
+ }
1214
1279
  await fetchLocks();
1215
1280
  document.getElementById('last-updated').textContent = formatDateTime(new Date());
1216
1281
  } catch (e) {
1217
1282
  showError(e.message);
1218
1283
  }
1219
- */
1220
1284
  }
1221
1285
 
1222
1286
  function handleQueueSelection(data) {
1223
- if (data.queues.length > 0) {
1287
+ if (Array.isArray(data.queues) && data.queues.length > 0 && currentQueue) {
1224
1288
  document.getElementById('queue-select').value = currentQueue;
1225
1289
  } else {
1226
1290
  document.getElementById('queue-select').innerHTML = '<option>No Queues</option>';
@@ -1229,35 +1293,33 @@ const getFetchDataFunction = () => `
1229
1293
  }
1230
1294
  `;
1231
1295
  const getDashboardScriptFetch = () => `
1232
- // HTTP polling disabled - 100% SSE reliance
1233
1296
  async function fetchJobs(queue) {
1234
- console.log('HTTP jobs polling disabled - using SSE only');
1235
- // Disabled to ensure 100% SSE streaming
1236
- /*
1297
+ if (!queue) {
1298
+ renderJobs([]);
1299
+ return;
1300
+ }
1237
1301
  try {
1238
- const res = await fetch(API_BASE + '/api/jobs/' + queue);
1302
+ const res = await fetch(API_BASE + '/api/jobs/' + encodeURIComponent(queue));
1303
+ if (!res.ok) throw new Error('Failed to fetch jobs');
1239
1304
  const jobs = await res.json();
1240
1305
  renderJobs(jobs);
1241
1306
  } catch (e) {
1242
1307
  console.error('Failed to fetch jobs', e);
1308
+ showError(e.message);
1243
1309
  }
1244
- */
1245
1310
  }
1246
1311
 
1247
- // HTTP polling disabled - 100% SSE reliance
1248
1312
  async function fetchLocks() {
1249
- console.log('HTTP locks polling disabled - using SSE only');
1250
- // Disabled to ensure 100% SSE streaming
1251
- /*
1252
1313
  try {
1253
1314
  const pattern = getLockPattern();
1254
1315
  const res = await fetch(API_BASE + '/api/locks?pattern=' + encodeURIComponent(pattern));
1316
+ if (!res.ok) throw new Error('Failed to fetch locks');
1255
1317
  const data = await res.json();
1256
1318
  renderLocks(data);
1257
1319
  } catch (e) {
1258
1320
  console.error('Failed to fetch locks', e);
1321
+ showError(e.message);
1259
1322
  }
1260
- */
1261
1323
  }
1262
1324
  `;
1263
1325
  const getDashboardScriptRender = () => [
@@ -1270,6 +1332,7 @@ const getDashboardScriptRender = () => [
1270
1332
  getRenderJobsEmptyStateFunction(),
1271
1333
  getRenderJobsRowHelpersFunction(),
1272
1334
  getRenderJobsFunction(),
1335
+ getJobStatusTabsFunction(),
1273
1336
  getRenderLocksFunction(),
1274
1337
  getLockHelperFunctions(),
1275
1338
  getErrorAndTooltipFunctions(),
@@ -1297,9 +1360,9 @@ const getDashboardScriptBootstrap = () => `
1297
1360
  } else {
1298
1361
  localStorage.removeItem(QUEUE_KEY);
1299
1362
  }
1300
- console.log('Queue changed - SSE will update automatically');
1301
1363
  clearError();
1302
1364
 
1365
+ fetchData();
1303
1366
  setupEventStream(currentQueue);
1304
1367
  });
1305
1368
  }
@@ -1307,8 +1370,15 @@ const getDashboardScriptBootstrap = () => `
1307
1370
  const lockRefresh = document.getElementById('lock-refresh');
1308
1371
  if (lockRefresh) {
1309
1372
  lockRefresh.addEventListener('click', () => {
1310
- console.log('Lock refresh disabled - SSE handles updates');
1311
- // fetchLocks(); // Disabled - SSE handles updates
1373
+ fetchLocks();
1374
+ setupEventStream(currentQueue);
1375
+ });
1376
+ }
1377
+
1378
+ const jobsRefresh = document.getElementById('jobs-refresh');
1379
+ if (jobsRefresh) {
1380
+ jobsRefresh.addEventListener('click', () => {
1381
+ fetchData();
1312
1382
  setupEventStream(currentQueue);
1313
1383
  });
1314
1384
  }
@@ -1319,8 +1389,13 @@ const getDashboardScriptBootstrap = () => `
1319
1389
  : storedAutoRefresh === 'true';
1320
1390
 
1321
1391
  applyTheme(getPreferredTheme());
1322
- console.log('HTTP polling disabled - 100% SSE streaming active');
1323
- // fetchData(); // Disabled - SSE handles initial data
1392
+
1393
+ // Restore persisted status filter tab
1394
+ document.querySelectorAll('.job-tab').forEach(function(btn) {
1395
+ btn.classList.toggle('active-tab', btn.dataset.status === currentJobStatusFilter);
1396
+ });
1397
+
1398
+ fetchData();
1324
1399
  setAutoRefresh(initialAutoRefresh);
1325
1400
 
1326
1401
  setupEventStream(currentQueue);
package/dist/driver.js CHANGED
@@ -377,7 +377,8 @@ const createBullMQRecoverActiveJob = (getQueue, getJob) => async (queueName, job
377
377
  }
378
378
  try {
379
379
  job.discard();
380
- const client = await queue.client;
380
+ const queueWithClient = queue;
381
+ const client = await queueWithClient.client;
381
382
  await client.set(queue.toKey(jobId) + ':lock', 'pull-worker', 'PX', String(Math.max(1, Env.getInt('QUEUE_MONITOR_RECOVER_ACTIVE_LOCK_MS', 30_000))));
382
383
  await job.moveToFailed(new Error('manual queue-monitor stale active recovery'), 'pull-worker', false);
383
384
  return { ok: true, status: 'failed' };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zintrust/queue-monitor",
3
- "version": "2.4.7",
3
+ "version": "2.8.0",
4
4
  "description": "Queue monitoring package for ZinTrust with BullMQ and Redis.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -62,4 +62,4 @@
62
62
  "bullmq": "^5.77.6",
63
63
  "ioredis": "^5.11.0"
64
64
  }
65
- }
65
+ }