@bakery-framework/plugin-dashboard 2.4.2 → 2.5.0-alpha.1
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/package.json +5 -5
- package/src/client/parts/logs.ts +1 -3
- package/src/client/parts/sessions.ts +0 -1
- package/src/client/parts/stats.ts +0 -1
- package/src/components/LogsPanel.tsx +4 -2
- package/src/components/SessionsPanel.tsx +12 -6
- package/src/components/StatsPanel.tsx +10 -5
- package/src/components/TopPagesPanel.tsx +10 -5
- package/src/paths.ts +1 -1
- package/src/setup.ts +1 -5
- package/src/shell.tsx +10 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bakery-framework/plugin-dashboard",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0-alpha.1",
|
|
4
4
|
"description": "Bakery dashboard plugin.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bakery",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"!src/tests"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@bakery-framework/core": "^2.
|
|
37
|
-
"@bakery-framework/plugin-analytics": "^2.
|
|
36
|
+
"@bakery-framework/core": "^2.5.0-alpha.1",
|
|
37
|
+
"@bakery-framework/plugin-analytics": "^2.5.0-alpha.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@bakery-framework/orm": "^2.
|
|
40
|
+
"@bakery-framework/orm": "^2.5.0-alpha.1"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
|
-
"bun": ">=1.4.
|
|
43
|
+
"bun": ">=1.4.4"
|
|
44
44
|
}
|
|
45
45
|
}
|
package/src/client/parts/logs.ts
CHANGED
|
@@ -123,9 +123,7 @@ export function toggleLogsPlay() {
|
|
|
123
123
|
logsPaused = !logsPaused
|
|
124
124
|
const btn = document.getElementById('btn-logs-play')
|
|
125
125
|
if (btn) {
|
|
126
|
-
btn.innerHTML = logsPaused
|
|
127
|
-
? '<span>Resume</span>'
|
|
128
|
-
: '<span>Pause</span>'
|
|
126
|
+
btn.innerHTML = logsPaused ? '<span>Resume</span>' : '<span>Pause</span>'
|
|
129
127
|
btn.classList.toggle('btn-success', logsPaused)
|
|
130
128
|
}
|
|
131
129
|
}
|
|
@@ -9,13 +9,15 @@ export function renderLogsPanel() {
|
|
|
9
9
|
type="button"
|
|
10
10
|
class="btn btn-secondary"
|
|
11
11
|
onclick="toggleLogsPlay()"
|
|
12
|
-
id="btn-logs-play"
|
|
12
|
+
id="btn-logs-play"
|
|
13
|
+
>
|
|
13
14
|
<span>Pause</span>
|
|
14
15
|
</button>
|
|
15
16
|
<button
|
|
16
17
|
type="button"
|
|
17
18
|
class="btn btn-secondary btn-danger"
|
|
18
|
-
onclick="clearLogs()"
|
|
19
|
+
onclick="clearLogs()"
|
|
20
|
+
>
|
|
19
21
|
<span>Clear Logs</span>
|
|
20
22
|
</button>
|
|
21
23
|
<label>
|
|
@@ -12,7 +12,8 @@ export function renderSessionsPanel() {
|
|
|
12
12
|
<button
|
|
13
13
|
type="button"
|
|
14
14
|
class="btn btn-secondary"
|
|
15
|
-
onclick="loadSessions()"
|
|
15
|
+
onclick="loadSessions()"
|
|
16
|
+
>
|
|
16
17
|
<span>Refresh Sessions</span>
|
|
17
18
|
</button>
|
|
18
19
|
</div>
|
|
@@ -28,7 +29,8 @@ export function renderSessionsPanel() {
|
|
|
28
29
|
<select
|
|
29
30
|
id="session-sort-by"
|
|
30
31
|
class="filter-select"
|
|
31
|
-
onchange="loadSessions()"
|
|
32
|
+
onchange="loadSessions()"
|
|
33
|
+
>
|
|
32
34
|
<option value="accessed">Last Accessed</option>
|
|
33
35
|
<option value="id">Session ID</option>
|
|
34
36
|
<option value="keys">Persisted Keys</option>
|
|
@@ -36,14 +38,16 @@ export function renderSessionsPanel() {
|
|
|
36
38
|
<select
|
|
37
39
|
id="session-sort-order"
|
|
38
40
|
class="filter-select"
|
|
39
|
-
onchange="loadSessions()"
|
|
41
|
+
onchange="loadSessions()"
|
|
42
|
+
>
|
|
40
43
|
<option value="DESC">Newest First</option>
|
|
41
44
|
<option value="ASC">Oldest First</option>
|
|
42
45
|
</select>
|
|
43
46
|
<select
|
|
44
47
|
id="session-page-size"
|
|
45
48
|
class="filter-select"
|
|
46
|
-
onchange="changeSessionPageSize()"
|
|
49
|
+
onchange="changeSessionPageSize()"
|
|
50
|
+
>
|
|
47
51
|
<option value="10">10 rows</option>
|
|
48
52
|
<option value="25" selected>
|
|
49
53
|
25 rows
|
|
@@ -60,7 +64,8 @@ export function renderSessionsPanel() {
|
|
|
60
64
|
type="button"
|
|
61
65
|
id="session-page-prev"
|
|
62
66
|
class="btn btn-secondary"
|
|
63
|
-
onclick="prevSessionPage()"
|
|
67
|
+
onclick="prevSessionPage()"
|
|
68
|
+
>
|
|
64
69
|
<span>Prev</span>
|
|
65
70
|
</button>
|
|
66
71
|
<span id="session-page-info">Page 1 of 1</span>
|
|
@@ -68,7 +73,8 @@ export function renderSessionsPanel() {
|
|
|
68
73
|
type="button"
|
|
69
74
|
id="session-page-next"
|
|
70
75
|
class="btn btn-secondary"
|
|
71
|
-
onclick="nextSessionPage()"
|
|
76
|
+
onclick="nextSessionPage()"
|
|
77
|
+
>
|
|
72
78
|
<span>Next</span>
|
|
73
79
|
</button>
|
|
74
80
|
</div>
|
|
@@ -61,35 +61,40 @@ export function renderStatsPanel() {
|
|
|
61
61
|
type="button"
|
|
62
62
|
class="timescale-btn active"
|
|
63
63
|
id="timescale-1m"
|
|
64
|
-
onclick="changeTimescale('1m')"
|
|
64
|
+
onclick="changeTimescale('1m')"
|
|
65
|
+
>
|
|
65
66
|
1m
|
|
66
67
|
</button>
|
|
67
68
|
<button
|
|
68
69
|
type="button"
|
|
69
70
|
class="timescale-btn"
|
|
70
71
|
id="timescale-1h"
|
|
71
|
-
onclick="changeTimescale('1h')"
|
|
72
|
+
onclick="changeTimescale('1h')"
|
|
73
|
+
>
|
|
72
74
|
1h
|
|
73
75
|
</button>
|
|
74
76
|
<button
|
|
75
77
|
type="button"
|
|
76
78
|
class="timescale-btn"
|
|
77
79
|
id="timescale-1d"
|
|
78
|
-
onclick="changeTimescale('1d')"
|
|
80
|
+
onclick="changeTimescale('1d')"
|
|
81
|
+
>
|
|
79
82
|
1d
|
|
80
83
|
</button>
|
|
81
84
|
<button
|
|
82
85
|
type="button"
|
|
83
86
|
class="timescale-btn"
|
|
84
87
|
id="timescale-7d"
|
|
85
|
-
onclick="changeTimescale('7d')"
|
|
88
|
+
onclick="changeTimescale('7d')"
|
|
89
|
+
>
|
|
86
90
|
7d
|
|
87
91
|
</button>
|
|
88
92
|
<button
|
|
89
93
|
type="button"
|
|
90
94
|
class="timescale-btn"
|
|
91
95
|
id="timescale-30d"
|
|
92
|
-
onclick="changeTimescale('30d')"
|
|
96
|
+
onclick="changeTimescale('30d')"
|
|
97
|
+
>
|
|
93
98
|
30d
|
|
94
99
|
</button>
|
|
95
100
|
</div>
|
|
@@ -10,35 +10,40 @@ export function renderTopPagesPanel() {
|
|
|
10
10
|
type="button"
|
|
11
11
|
class="pages-filter-btn"
|
|
12
12
|
id="pages-filter-1m"
|
|
13
|
-
onclick="changePagesFilter('1m')"
|
|
13
|
+
onclick="changePagesFilter('1m')"
|
|
14
|
+
>
|
|
14
15
|
1m
|
|
15
16
|
</button>
|
|
16
17
|
<button
|
|
17
18
|
type="button"
|
|
18
19
|
class="pages-filter-btn"
|
|
19
20
|
id="pages-filter-1h"
|
|
20
|
-
onclick="changePagesFilter('1h')"
|
|
21
|
+
onclick="changePagesFilter('1h')"
|
|
22
|
+
>
|
|
21
23
|
1h
|
|
22
24
|
</button>
|
|
23
25
|
<button
|
|
24
26
|
type="button"
|
|
25
27
|
class="pages-filter-btn active"
|
|
26
28
|
id="pages-filter-1d"
|
|
27
|
-
onclick="changePagesFilter('1d')"
|
|
29
|
+
onclick="changePagesFilter('1d')"
|
|
30
|
+
>
|
|
28
31
|
1d
|
|
29
32
|
</button>
|
|
30
33
|
<button
|
|
31
34
|
type="button"
|
|
32
35
|
class="pages-filter-btn"
|
|
33
36
|
id="pages-filter-7d"
|
|
34
|
-
onclick="changePagesFilter('7d')"
|
|
37
|
+
onclick="changePagesFilter('7d')"
|
|
38
|
+
>
|
|
35
39
|
7d
|
|
36
40
|
</button>
|
|
37
41
|
<button
|
|
38
42
|
type="button"
|
|
39
43
|
class="pages-filter-btn"
|
|
40
44
|
id="pages-filter-30d"
|
|
41
|
-
onclick="changePagesFilter('30d')"
|
|
45
|
+
onclick="changePagesFilter('30d')"
|
|
46
|
+
>
|
|
42
47
|
30d
|
|
43
48
|
</button>
|
|
44
49
|
</div>
|
package/src/paths.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { fs } from '@bakery-framework/core/utils'
|
|
|
7
7
|
* became its own package every asset lookup pointed into core and 404'd. Each
|
|
8
8
|
* package that ships files needs its own anchor, derived from its own location.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
const pluginRoot: string = fs.resolve(import.meta.dir)
|
|
11
11
|
|
|
12
12
|
export function pluginPath(...segments: string[]): string {
|
|
13
13
|
return fs.resolve(pluginRoot, ...segments)
|
package/src/setup.ts
CHANGED
|
@@ -35,8 +35,6 @@ import { DashboardLogsHandler } from './endpoints/logs-socket'
|
|
|
35
35
|
import { pluginPath } from './paths'
|
|
36
36
|
import renderDashboardShell from './shell'
|
|
37
37
|
|
|
38
|
-
export { connectedLoggers }
|
|
39
|
-
|
|
40
38
|
let cachedDashboardJsPath: string | null = null
|
|
41
39
|
|
|
42
40
|
/**
|
|
@@ -339,9 +337,7 @@ const dispatchDashboardRoute = routeTable(dashboardRoutes)
|
|
|
339
337
|
* a `JsonResponseData` is stamped with the elapsed time and JSON-encoded.
|
|
340
338
|
*/
|
|
341
339
|
export type DashboardResponse =
|
|
342
|
-
|
|
|
343
|
-
| Bun.BunFile
|
|
344
|
-
| JsonResponseData<unknown>
|
|
340
|
+
Response | Bun.BunFile | JsonResponseData<unknown>
|
|
345
341
|
|
|
346
342
|
export async function handleDashboardRequest(
|
|
347
343
|
req: Request,
|
package/src/shell.tsx
CHANGED
|
@@ -88,7 +88,8 @@ function NavItem({ id, label, href }: NavEntry) {
|
|
|
88
88
|
<button
|
|
89
89
|
type="button"
|
|
90
90
|
class={id === 'stats' ? 'tab-btn active' : 'tab-btn'}
|
|
91
|
-
onclick={`switchTab('${id}')`}
|
|
91
|
+
onclick={`switchTab('${id}')`}
|
|
92
|
+
>
|
|
92
93
|
<span class="nav-dot"></span>
|
|
93
94
|
<span>{label}</span>
|
|
94
95
|
</button>
|
|
@@ -169,7 +170,8 @@ export default function Dashboard() {
|
|
|
169
170
|
type="button"
|
|
170
171
|
class="btn rail-toggle"
|
|
171
172
|
onclick="document.getElementById('rail').classList.toggle('open')"
|
|
172
|
-
aria-label="Toggle navigation"
|
|
173
|
+
aria-label="Toggle navigation"
|
|
174
|
+
>
|
|
173
175
|
☰
|
|
174
176
|
</button>
|
|
175
177
|
<span>Console</span>
|
|
@@ -185,12 +187,14 @@ export default function Dashboard() {
|
|
|
185
187
|
|
|
186
188
|
<div
|
|
187
189
|
class="profile-dropdown-wrapper"
|
|
188
|
-
id="profile-dropdown-wrapper"
|
|
190
|
+
id="profile-dropdown-wrapper"
|
|
191
|
+
>
|
|
189
192
|
<button
|
|
190
193
|
type="button"
|
|
191
194
|
class="profile-trigger-btn"
|
|
192
195
|
onclick="toggleProfileDropdown(event)"
|
|
193
|
-
aria-label="Account menu"
|
|
196
|
+
aria-label="Account menu"
|
|
197
|
+
>
|
|
194
198
|
<span class="profile-avatar">A</span>
|
|
195
199
|
<span aria-hidden="true">▾</span>
|
|
196
200
|
</button>
|
|
@@ -203,7 +207,8 @@ export default function Dashboard() {
|
|
|
203
207
|
application authenticates, via the authorize predicate. */}
|
|
204
208
|
<button
|
|
205
209
|
type="button"
|
|
206
|
-
onclick="resetAnalytics(); toggleProfileDropdown(event);"
|
|
210
|
+
onclick="resetAnalytics(); toggleProfileDropdown(event);"
|
|
211
|
+
>
|
|
207
212
|
<span>Reset analytics</span>
|
|
208
213
|
</button>
|
|
209
214
|
</div>
|