@dunx/dashboard 2.0.0 → 2.1.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.
- package/README.md +13 -10
- package/dist/contracts.d.ts +16 -7
- package/dist/ui.js +3 -3
- package/dist/ui.js.map +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ curl -H 'x-ops-key: …' $APP/_dunx/api/queues # names only; the board is at
|
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
These are the endpoints the page itself uses, and they are supported rather than an
|
|
86
|
-
implementation detail
|
|
86
|
+
implementation detail, which makes the dashboard usable on a box with no
|
|
87
87
|
browser. Their types are exported (`Snapshot`, `RuntimeReport`, `RedisReport`,
|
|
88
88
|
`QueuesReport`), so a `fetch` of them is typed. Anything *about* a queue is
|
|
89
89
|
bull-board's own API, under `{path}/queues`.
|
|
@@ -97,7 +97,7 @@ because "fine behind a private network" is a real answer and guessing is not.
|
|
|
97
97
|
|
|
98
98
|
Four things follow, and none is obvious:
|
|
99
99
|
|
|
100
|
-
- **A rejected request gets 404
|
|
100
|
+
- **A rejected request gets 404 rather than 403.** A dashboard that announces itself to an
|
|
101
101
|
unauthenticated caller has told them where to keep knocking.
|
|
102
102
|
- **Register it ahead of any session guard.** With the middleware last in the chain,
|
|
103
103
|
a `SessionGuard` answers every dashboard request `401` before `authorize` runs,
|
|
@@ -131,12 +131,15 @@ not per click by whoever reached it.
|
|
|
131
131
|
the repeatable-job editor, per-queue metrics, redis stats, retry/promote/clean, all
|
|
132
132
|
of it, and none of it dunx's to maintain.
|
|
133
133
|
|
|
134
|
-
This package briefly shipped its own queue table, and that was the wrong call
|
|
135
|
-
the framework's first rule: never invent what a mature library already
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
134
|
+
This package briefly shipped its own queue table, and that was the wrong call
|
|
135
|
+
under the framework's first rule: never invent what a mature library already
|
|
136
|
+
solves.
|
|
137
|
+
|
|
138
|
+
The one thing that had ever justified hand-rolling it was that mounting
|
|
139
|
+
bull-board on `Bun.serve` meant writing a server adapter - which the deleted
|
|
140
|
+
`@dunx/queue-dashboard` did, and which was a liability. **bull-board 8.6.0
|
|
141
|
+
ships `@bull-board/bun`**, so that reason is gone and the integration is three
|
|
142
|
+
calls.
|
|
140
143
|
|
|
141
144
|
It also settled the question that started all this - see **Workers do show up**
|
|
142
145
|
below. The hand-rolled panel had planned to omit a worker column and explain why;
|
|
@@ -157,7 +160,7 @@ Two things dunx does contribute, and they are the two bull-board cannot know:
|
|
|
157
160
|
refusing its POSTs. It already has the switch; a second implementation would
|
|
158
161
|
disagree the moment bull-board grew an operation dunx had not heard of.
|
|
159
162
|
|
|
160
|
-
One caveat
|
|
163
|
+
One caveat: **bull-board's page loads a webfont from Google Fonts.**
|
|
161
164
|
dunx's own page fetches nothing, and that guarantee does not extend across the
|
|
162
165
|
handoff.
|
|
163
166
|
|
|
@@ -175,7 +178,7 @@ queueNames: ['thumbnails'],
|
|
|
175
178
|
This is free. The board - and therefore any connection to the broker - is built on
|
|
176
179
|
the **first request for `{path}/queues`**, never at boot and never by the polling
|
|
177
180
|
`/api/queues` endpoint, which reads names straight off the options. An app that
|
|
178
|
-
mounts the dashboard and never opens the board holds no socket for it, which
|
|
181
|
+
mounts the dashboard and never opens the board holds no socket for it, which
|
|
179
182
|
lets a process still exit cleanly against an absent Redis.
|
|
180
183
|
|
|
181
184
|
## Options
|
package/dist/contracts.d.ts
CHANGED
|
@@ -75,13 +75,22 @@ export interface RedisProbe {
|
|
|
75
75
|
ping(message?: string): Promise<string>;
|
|
76
76
|
send(command: string, args?: readonly string[]): Promise<unknown>;
|
|
77
77
|
}
|
|
78
|
-
/**
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
/**
|
|
79
|
+
* The state a probe reports, and its result. `unknown` is not `down`; see
|
|
80
|
+
* `StatusDot`.
|
|
81
|
+
*
|
|
82
|
+
* Declared in `@dunx/http` and re-exported here. They moved down when the health
|
|
83
|
+
* module became a second consumer: this package already peer-depends on
|
|
84
|
+
* `@dunx/http`, so the descent adds no edge, and two copies of a three-value union
|
|
85
|
+
* is how one of them gains a fourth value nobody else honours.
|
|
86
|
+
*
|
|
87
|
+
* `RedisProbe` below did **not** move with them. `@dunx/http`'s `PingProbe` is a
|
|
88
|
+
* `ping` and nothing else, while this needs `connected` and `send` for the `INFO`
|
|
89
|
+
* panel, so one shared contract would oblige a health check to supply two members
|
|
90
|
+
* it never calls.
|
|
91
|
+
*/
|
|
92
|
+
export type { ProbeResult, ProbeState } from '@dunx/http';
|
|
93
|
+
import type { ProbeResult } from '@dunx/http';
|
|
85
94
|
/**
|
|
86
95
|
* Anything else worth a light on the page - a third-party API, a disk, a leader
|
|
87
96
|
* election. The dashboard awaits it with a timeout and never lets it throw into a
|