Database
+-
+application persistence
+diff --git a/scripts/ui-qa-check.mjs b/scripts/ui-qa-check.mjs index f4937cf..8c74946 100644 --- a/scripts/ui-qa-check.mjs +++ b/scripts/ui-qa-check.mjs @@ -7,7 +7,9 @@ const pages = [ "ui/admin-system-audit-logs/index.html", "ui/settlement-batch-management/index.html", "ui/merchant-settlement-history/index.html", - "ui/device-technical-detail/index.html" + "ui/device-technical-detail/index.html", + "ui/mqtt-trace/index.html", + "ui/config-commands/index.html" ]; const checks = []; diff --git a/src/routes/admin.ts b/src/routes/admin.ts index 81e7957..626cb6e 100644 --- a/src/routes/admin.ts +++ b/src/routes/admin.ts @@ -2551,13 +2551,27 @@ router.get("/dashboard/summary", requireAdminToken, async (req: Request, res: Re router.get("/mqtt/status", requireAdminToken, async (req: Request, res: Response) => { const limitRaw = req.query.limit; const limit = limitRaw === undefined || limitRaw === "" ? 10 : Number(limitRaw); - const safeLimit = Number.isFinite(limit) ? Math.min(Math.max(limit, 1), 50) : 10; + const safeLimit = Number.isFinite(limit) ? Math.min(Math.max(limit, 1), 500) : 10; + const direction = req.query.direction === "uplink" || req.query.direction === "downlink" + ? req.query.direction + : undefined; + const messageType = typeof req.query.message_type === "string" && req.query.message_type.trim() + ? req.query.message_type.trim() + : undefined; + const deviceId = typeof req.query.device_id === "string" && req.query.device_id.trim() + ? req.query.device_id.trim() + : undefined; res.json( successResponse(req, { publisher: getMqttPublisherStatus(), subscriber: getMqttSubscriberStatus(), - last_messages: (await listMqttMessages({ limit: safeLimit })).map(toMqttMessagePayload) + last_messages: (await listMqttMessages({ + limit: safeLimit, + direction, + message_type: messageType, + device_id: deviceId + })).map(toMqttMessagePayload) }) ); }); diff --git a/ui/config-commands/index.html b/ui/config-commands/index.html new file mode 100644 index 0000000..7262bd4 --- /dev/null +++ b/ui/config-commands/index.html @@ -0,0 +1,327 @@ + + +
+ + +Database
+-
+application persistence
+Pending Notification
+0
+waiting to publish
+Failed Notification
+0
+needs operator review
+Export Worker
+-
+-
+Select a registered soundbox and send operational commands.
+-
+SN: -
+Model
+-
+Connection
+-
+Last Seen
+-
+Broker
+-
+-
+Subscriber
+-
+-
+Visible Events
+0
+after filters
+Last Message
+-
+auto refresh every 10s
+Loading MQTT trace...
+