mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
feat(federation): ✨ Add UI to view BullMQ metadata
This commit is contained in:
parent
8a920218ea
commit
ecc7d1eee7
7 changed files with 215 additions and 71 deletions
38
utils/bull-board.ts
Normal file
38
utils/bull-board.ts
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { createBullBoard } from "@bull-board/api";
|
||||
import { BullMQAdapter } from "@bull-board/api/bullMQAdapter";
|
||||
import { HonoAdapter } from "@bull-board/hono";
|
||||
import { serveStatic } from "@hono/hono/bun";
|
||||
import type { OpenAPIHono } from "@hono/zod-openapi";
|
||||
import { config } from "~/packages/config-manager";
|
||||
import type { HonoEnv } from "~/types/api";
|
||||
import { deliveryQueue, inboxQueue } from "~/worker";
|
||||
|
||||
export const applyToHono = (app: OpenAPIHono<HonoEnv>): void => {
|
||||
const serverAdapter = new HonoAdapter(serveStatic);
|
||||
|
||||
createBullBoard({
|
||||
queues: [
|
||||
new BullMQAdapter(inboxQueue),
|
||||
new BullMQAdapter(deliveryQueue),
|
||||
],
|
||||
serverAdapter,
|
||||
options: {
|
||||
uiConfig: {
|
||||
boardTitle: "Server Queues",
|
||||
favIcon: {
|
||||
default: "/favicon.png",
|
||||
alternative: "/favicon.ico",
|
||||
},
|
||||
boardLogo: {
|
||||
path:
|
||||
config.instance.logo ??
|
||||
"https://cdn.versia.pub/branding/icon.svg",
|
||||
height: 40,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
serverAdapter.setBasePath("/admin/queues");
|
||||
app.route("/admin/queues", serverAdapter.registerPlugin());
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue