@stacksjs/defaults 0.75.652 → 0.75.654
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/ai/skills/stacks-docs/SKILL.md +20 -10
- package/ai/skills/stacks-native/CATALOG.md +4 -4
- package/ai/skills/stacks-security/SKILL.md +3 -2
- package/ai/skills/stacks-testing/SKILL.md +10 -6
- package/app/Actions/Dashboard/DashboardHomeAction.ts +19 -25
- package/app/Actions/Dashboard/Infrastructure/RequestIndexAction.ts +3 -2
- package/ide/vscode/package.json +1 -1
- package/package.json +5 -5
- package/resources/components/Dashboard/Home/DashboardHome.stx +49 -42
- package/resources/components/Dashboard/UI/StatsCard.stx +4 -4
- package/vcs/github/workflows/buddy-bot.yml +4 -1
- package/views/dashboard/layouts/default.stx +2 -23
|
@@ -106,15 +106,25 @@ including a changed guide and a skill page. A successful build alone does not
|
|
|
106
106
|
prove the prose or API examples are correct. For deployment work, read
|
|
107
107
|
`stacks-deploy` and verify the CI run for the pushed commit plus the live docs.
|
|
108
108
|
|
|
109
|
-
##
|
|
110
|
-
|
|
111
|
-
Use `buddy docs:screenshots`
|
|
112
|
-
|
|
113
|
-
`@stacksjs/docs/screenshots
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
109
|
+
## Screen documentation
|
|
110
|
+
|
|
111
|
+
Use `buddy docs:screenshots` to picture every screen rather than one-off page
|
|
112
|
+
captures. `config/screenshots.ts` uses `defineScreenshotConfig` from
|
|
113
|
+
`@stacksjs/docs/screenshots`. Build `pages` with `screensFromViews()` from the
|
|
114
|
+
same module: it reads the stx route table, so a new view is captured on the
|
|
115
|
+
next run and a deleted one loses its pictures. Its `each` and `routes` rules
|
|
116
|
+
assign the signed-in profile and bind a seeded example to each parameterised
|
|
117
|
+
address; unbound ones stay listed as explained gaps. Hand-written pages are
|
|
118
|
+
still accepted, alone or through `extra`. Each profile owns a separate Bun
|
|
119
|
+
WebView process.
|
|
120
|
+
|
|
121
|
+
`film: true` writes one walkthrough MP4 per viewport (needs FFmpeg) and
|
|
122
|
+
`docs: { page, base }` writes a generated page of every screen. `--list`
|
|
123
|
+
verifies the inventory and template coverage without a browser, `--publish`
|
|
124
|
+
rebuilds films and page from the saved manifest, and `--check` verifies the
|
|
125
|
+
saved output against source, config and file hashes. Failed or excluded
|
|
126
|
+
screens remain visible in the manifest. `buddy docs:stories` is the separate
|
|
127
|
+
tool for recorded journeys. Read `docs/guide/screenshots.md` for rules, the CI
|
|
128
|
+
workflow that commits the output, troubleshooting and the reference.
|
|
119
129
|
Use seeded accounts, keep credentials out of artifacts, review every image, and
|
|
120
130
|
verify native apps separately from phone-width web captures.
|
|
@@ -33,7 +33,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
|
|
|
33
33
|
| `@stacksjs/collections` | [`stacks-collections`](../stacks-collections/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/collections/src/index.ts) | 2 |
|
|
34
34
|
| `@stacksjs/commerce` | [`stacks-commerce`](../stacks-commerce/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/index.ts) | 16 |
|
|
35
35
|
| `@stacksjs/composables` | [`stacks-composables`](../stacks-composables/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/composables/src/index.ts) | 18 |
|
|
36
|
-
| `@stacksjs/config` | [`stacks-config`](../stacks-config/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/config/src/index.ts) |
|
|
36
|
+
| `@stacksjs/config` | [`stacks-config`](../stacks-config/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/config/src/index.ts) | 18 |
|
|
37
37
|
| `@stacksjs/cron` | [`stacks-cron`](../stacks-cron/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cron/src/index.ts) | 6 |
|
|
38
38
|
| `@stacksjs/database` | [`stacks-database`](../stacks-database/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/index.ts) | 148 |
|
|
39
39
|
| `@stacksjs/datetime` | [`stacks-datetime`](../stacks-datetime/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/datetime/src/index.ts) | 22 |
|
|
@@ -91,7 +91,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
|
|
|
91
91
|
| `@stacksjs/strings` | [`stacks-strings`](../stacks-strings/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/strings/src/index.ts) | 12 |
|
|
92
92
|
| `@stacksjs/support` | [`stacks-support`](../stacks-support/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/support/src/index.ts) | 6 |
|
|
93
93
|
| `@stacksjs/telephony` | [`stacks-telephony`](../stacks-telephony/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/telephony/src/index.ts) | 5 |
|
|
94
|
-
| `@stacksjs/testing` | [`stacks-testing`](../stacks-testing/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/index.ts) |
|
|
94
|
+
| `@stacksjs/testing` | [`stacks-testing`](../stacks-testing/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/index.ts) | 27 |
|
|
95
95
|
| `@stacksjs/tinker` | [`stacks-repl`](../stacks-repl/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/tinker/src/index.ts) | 4 |
|
|
96
96
|
| `@stacksjs/tunnel` | [`stacks-tunnel`](../stacks-tunnel/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/tunnel/src/index.ts) | 1 |
|
|
97
97
|
| `@stacksjs/types` | [`stacks-types`](../stacks-types/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/types/src/index.ts) | 3 |
|
|
@@ -341,7 +341,7 @@ Declared runtime exports: `DEFAULT_VIEWS_ALWAYS`, `DEFAULT_VIEW_ROUTE_BUNDLES`,
|
|
|
341
341
|
|
|
342
342
|
Local source modules: [src/capabilities.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/config/src/capabilities.ts), [src/config.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/config/src/config.ts), [src/defaults.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/config/src/defaults.ts), [src/discovered-resources.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/config/src/discovered-resources.ts), [src/features.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/config/src/features.ts), [src/form-flash.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/config/src/form-flash.ts), [src/request-context.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/config/src/request-context.ts), [src/validators.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/config/src/validators.ts), [src/views.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/config/src/views.ts).
|
|
343
343
|
|
|
344
|
-
Evidence directory: [
|
|
344
|
+
Evidence directory: [18 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/config/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
|
|
345
345
|
|
|
346
346
|
### @stacksjs/cron
|
|
347
347
|
|
|
@@ -897,7 +897,7 @@ Read the entrypoint and package export map for re-exported or type-only surfaces
|
|
|
897
897
|
|
|
898
898
|
Local source modules: [src/console.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/console.ts), [src/disposable-database.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/disposable-database.ts), [src/events.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/events.ts), [src/feature.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/feature.ts), [src/isolated.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/isolated.ts), [src/mail.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/mail.ts), [src/schema.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/schema.ts), [src/service.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/service.ts), [src/time.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/time.ts).
|
|
899
899
|
|
|
900
|
-
Evidence directory: [
|
|
900
|
+
Evidence directory: [27 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
|
|
901
901
|
|
|
902
902
|
### @stacksjs/tinker
|
|
903
903
|
|
|
@@ -210,8 +210,9 @@ import { eraseSubject, exportSubjectData, pruneRetainedData } from '@stacksjs/or
|
|
|
210
210
|
At most `maxBodyBytes` of a body is read; blocking refuses a larger one with 413. In blocking mode a WAF that cannot
|
|
211
211
|
start answers 503 instead of letting everything through; in detection mode it logs and passes. A
|
|
212
212
|
request built in-process has no socket and is not inspected. With zig-utils/zig-waf#84 a two-rule set
|
|
213
|
-
costs about 15 us per request and full CRS about 10 ms for a GET
|
|
214
|
-
|
|
213
|
+
costs about 15 us per request and full CRS about 10 ms for a GET, most of it zig-waf recompiling
|
|
214
|
+
operators per request (zig-utils/zig-waf#83). A form post costs more, mostly zig-regex backtracking
|
|
215
|
+
over the body (zig-utils/zig-regex#53); see `core/waf/README.md`.
|
|
215
216
|
- The firewall rate limit is per-minute per-IP at the WAF (`firewall.rateLimitPerMinute`)
|
|
216
217
|
- Application rate limits (`.rateLimit()`, `rateLimit()`, the login lockout) share the Redis cache when it is configured and count per process otherwise; see `stacks-router`
|
|
217
218
|
|
|
@@ -38,24 +38,28 @@ without imports throws "Action is not defined". `setupTestEnvironment()` still
|
|
|
38
38
|
exists and only sets the env.
|
|
39
39
|
|
|
40
40
|
```typescript
|
|
41
|
-
import { refreshDatabase, setupDatabase, truncateMysql, truncateSqlite } from '@stacksjs/testing/database'
|
|
41
|
+
import { refreshDatabase, setupDatabase, truncateMysql, truncatePostgres, truncateSqlite } from '@stacksjs/testing/database'
|
|
42
42
|
|
|
43
|
-
// MySQL
|
|
43
|
+
// MySQL and PostgreSQL setup: migrates the test database (SQLite is set up by refreshDatabase)
|
|
44
44
|
await setupDatabase()
|
|
45
45
|
|
|
46
|
-
// Reset the configured test database
|
|
46
|
+
// Reset the configured test database for its driver
|
|
47
47
|
await refreshDatabase()
|
|
48
48
|
|
|
49
49
|
// Truncate tables
|
|
50
|
-
await truncateSqlite()
|
|
51
|
-
await truncateMysql()
|
|
50
|
+
await truncateSqlite() // for SQLite
|
|
51
|
+
await truncateMysql() // for MySQL
|
|
52
|
+
await truncatePostgres() // for PostgreSQL: every live table but `migrations`, ids restarted
|
|
52
53
|
```
|
|
53
54
|
|
|
54
55
|
The database subpath is intentional. Importing its fixtures from the root
|
|
55
56
|
would eagerly load the database graph during test preload and can deadlock
|
|
56
57
|
module loading. Set the test environment before database work and confirm the
|
|
57
58
|
configured database points at disposable test data. `refreshDatabase()` follows
|
|
58
|
-
the active configured driver
|
|
59
|
+
the active configured driver. On PostgreSQL it refuses a database whose name
|
|
60
|
+
does not have `test` or `testing` as a word (`app_test`, `test_app`,
|
|
61
|
+
`app_testing`; not `app_latest`), because it empties every table in the schema;
|
|
62
|
+
`withDisposableDatabase('postgres')` names its databases `stacks_test_...`.
|
|
59
63
|
|
|
60
64
|
## DynamoDB Testing
|
|
61
65
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Action } from '@stacksjs/actions/runtime'
|
|
2
2
|
import { feature } from '@stacksjs/config'
|
|
3
|
-
import { Order, Product,
|
|
3
|
+
import { Order, Product, User } from '@stacksjs/orm'
|
|
4
4
|
import { checkApplicationHealth, type ApplicationHealthCheck } from '@stacksjs/router'
|
|
5
|
-
import { formatRelative, safeGet } from '../../../resources/functions/dashboard/data'
|
|
5
|
+
import { formatRelative, loadModel, safeGet } from '../../../resources/functions/dashboard/data'
|
|
6
6
|
import { dashboardOperationalIssue } from './dashboard-response'
|
|
7
7
|
|
|
8
8
|
/** Totals over every captured request, counted by the database. */
|
|
@@ -109,6 +109,7 @@ export default new Action({
|
|
|
109
109
|
async handle() {
|
|
110
110
|
const commerce = feature('commerce')
|
|
111
111
|
const none = async () => null
|
|
112
|
+
const healthResult = settleEach([() => checkApplicationHealth()] as const)
|
|
112
113
|
const [
|
|
113
114
|
userCount,
|
|
114
115
|
productCount,
|
|
@@ -116,10 +117,7 @@ export default new Action({
|
|
|
116
117
|
totalRevenue,
|
|
117
118
|
recentOrders,
|
|
118
119
|
recentUsers,
|
|
119
|
-
|
|
120
|
-
successfulRequests,
|
|
121
|
-
failedRequests,
|
|
122
|
-
averageDuration,
|
|
120
|
+
requestMetrics,
|
|
123
121
|
] = await settleEach([
|
|
124
122
|
() => User.count(),
|
|
125
123
|
commerce ? () => Product.count() : none,
|
|
@@ -127,26 +125,25 @@ export default new Action({
|
|
|
127
125
|
commerce ? () => Order.sum('totalAmount') : none,
|
|
128
126
|
commerce ? () => Order.orderBy('created_at', 'desc').limit(5).get() : async () => [],
|
|
129
127
|
() => User.orderBy('created_at', 'desc').limit(5).get(),
|
|
130
|
-
() =>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
async () => {
|
|
129
|
+
// A standalone developer dashboard may be open with the app's public
|
|
130
|
+
// dashboard bundle off. Resolve the persisted model from its source.
|
|
131
|
+
const Requests = await loadModel('Request')
|
|
132
|
+
const [total, successful, failed, averageDuration] = await Promise.all([
|
|
133
|
+
() => Requests.count(),
|
|
134
|
+
() => Requests.where('status_code', '>=', 200).where('status_code', '<', 400).count(),
|
|
135
|
+
() => Requests.where('status_code', '>=', 400).count(),
|
|
136
|
+
() => Requests.avg('duration_ms'),
|
|
137
|
+
].map(query => Promise.resolve().then(query)))
|
|
138
|
+
return summarizeHttpRequests({ total: Number(total), successful: Number(successful), failed: Number(failed), averageDuration: Number(averageDuration ?? 0) })
|
|
139
|
+
},
|
|
134
140
|
] as const)
|
|
135
|
-
const healthResult = await Promise.allSettled([checkApplicationHealth()])
|
|
136
141
|
|
|
137
142
|
const stats = homeStats({ users: userCount, products: productCount, revenue: totalRevenue, orders: orderCount }, commerce)
|
|
138
143
|
|
|
139
|
-
const httpMetrics =
|
|
140
|
-
&& failedRequests.status === 'fulfilled' && averageDuration.status === 'fulfilled'
|
|
141
|
-
? summarizeHttpRequests({
|
|
142
|
-
total: Number(requestCount.value) || 0,
|
|
143
|
-
successful: Number(successfulRequests.value) || 0,
|
|
144
|
-
failed: Number(failedRequests.value) || 0,
|
|
145
|
-
averageDuration: Number(averageDuration.value) || 0,
|
|
146
|
-
})
|
|
147
|
-
: summarizeHttpRequests({ total: 0, successful: 0, failed: 0, averageDuration: 0 })
|
|
144
|
+
const httpMetrics = requestMetrics.status === 'fulfilled' ? requestMetrics.value : []
|
|
148
145
|
|
|
149
|
-
const health = healthResult
|
|
146
|
+
const [health] = await healthResult
|
|
150
147
|
const services = health.status === 'fulfilled'
|
|
151
148
|
? Object.entries(health.value.checks).map(([name, check]) => {
|
|
152
149
|
if (!check.ok) {
|
|
@@ -195,10 +192,7 @@ export default new Action({
|
|
|
195
192
|
['Revenue', totalRevenue],
|
|
196
193
|
['Recent orders', recentOrders],
|
|
197
194
|
['Recent users', recentUsers],
|
|
198
|
-
['
|
|
199
|
-
['Successful requests', successfulRequests],
|
|
200
|
-
['Failed requests', failedRequests],
|
|
201
|
-
['Average response', averageDuration],
|
|
195
|
+
['HTTP metrics', requestMetrics],
|
|
202
196
|
]
|
|
203
197
|
const issues = sources
|
|
204
198
|
.map(([source, result]) => issue(source, result))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Action } from '@stacksjs/actions/runtime'
|
|
2
|
-
import {
|
|
2
|
+
import { loadModel } from '../../../../resources/functions/dashboard/data'
|
|
3
3
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
4
4
|
|
|
5
5
|
export default new Action({
|
|
@@ -8,6 +8,7 @@ export default new Action({
|
|
|
8
8
|
method: 'GET',
|
|
9
9
|
async handle() {
|
|
10
10
|
try {
|
|
11
|
+
const Request = await loadModel('Request')
|
|
11
12
|
const oneHourAgo = new Date(Date.now() - 60 * 60 * 1000).toISOString()
|
|
12
13
|
const [allRequests, total, errorCount, averageDurationMs, requestsLastHour] = await Promise.all([
|
|
13
14
|
Request.orderByDesc('id').limit(100).get(),
|
|
@@ -17,7 +18,7 @@ export default new Action({
|
|
|
17
18
|
Request.where('created_at', '>=', oneHourAgo).count(),
|
|
18
19
|
])
|
|
19
20
|
|
|
20
|
-
const requests = allRequests.map(request => ({
|
|
21
|
+
const requests = allRequests.map((request: { get: (column: string) => unknown }) => ({
|
|
21
22
|
id: Number(request.get('id') || 0),
|
|
22
23
|
method: String(request.get('method') || 'GET'),
|
|
23
24
|
path: String(request.get('path') || ''),
|
package/ide/vscode/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"publisher": "Stacks",
|
|
3
3
|
"name": "vscode-stacks",
|
|
4
4
|
"displayName": "Stacks",
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.654",
|
|
6
6
|
"description": "Stacks, built into VS Code: stx templates, pickier linting and formatting, encrypted env files, the dev server preview and every buddy command. No other extensions required.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"funding": "https://github.com/sponsors/chrisbbreuer",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/defaults",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.654",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/stacksjs/stacks.git",
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@iconify-json/f7": "^1.2.2",
|
|
47
47
|
"@iconify-json/hugeicons": "^1.2.35",
|
|
48
|
-
"@stacksjs/mobile": "0.75.
|
|
48
|
+
"@stacksjs/mobile": "0.75.654",
|
|
49
49
|
"@stacksjs/sanitizer": "^0.2.908",
|
|
50
50
|
"@stacksjs/stx": "^0.2.908",
|
|
51
|
-
"@stacksjs/strings": "0.75.
|
|
51
|
+
"@stacksjs/strings": "0.75.654",
|
|
52
52
|
"@xterm/addon-fit": "^0.11.0",
|
|
53
53
|
"@xterm/xterm": "^6.0.0",
|
|
54
54
|
"ts-qr-codes": "^0.1.8",
|
|
55
|
-
"@stacksjs/support": "0.75.
|
|
56
|
-
"@stacksjs/browser": "0.75.
|
|
55
|
+
"@stacksjs/support": "0.75.654",
|
|
56
|
+
"@stacksjs/browser": "0.75.654"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -13,7 +13,7 @@ const loadingCards = [1, 2, 3, 4]
|
|
|
13
13
|
const allQuickLinks = [
|
|
14
14
|
{
|
|
15
15
|
title: 'Blog',
|
|
16
|
-
description: 'Manage
|
|
16
|
+
description: 'Manage posts and pages',
|
|
17
17
|
href: '/content/dashboard',
|
|
18
18
|
icon: 'i-hugeicons-book-open-01',
|
|
19
19
|
tone: 'blue',
|
|
@@ -29,7 +29,7 @@ const allQuickLinks = [
|
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
title: 'Cloud',
|
|
32
|
-
description: '
|
|
32
|
+
description: 'View infrastructure',
|
|
33
33
|
href: '/cloud',
|
|
34
34
|
icon: 'i-hugeicons-cloud',
|
|
35
35
|
tone: 'purple',
|
|
@@ -61,8 +61,8 @@ function quickLinks() {
|
|
|
61
61
|
/** Orders are part of the feed only with commerce on, so they are named only then. */
|
|
62
62
|
function activityDescription(): string {
|
|
63
63
|
return dashboard.sections.value.commerce === true
|
|
64
|
-
? '
|
|
65
|
-
: '
|
|
64
|
+
? 'Orders and user registrations'
|
|
65
|
+
: 'User registrations'
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
const resourceLinks = [
|
|
@@ -126,29 +126,50 @@ onMount(() => {
|
|
|
126
126
|
})
|
|
127
127
|
</script>
|
|
128
128
|
|
|
129
|
-
<
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
129
|
+
<style>
|
|
130
|
+
.dashboard-overview {
|
|
131
|
+
--overview-border: light-dark(#dedee5, #ffffff1a);
|
|
132
|
+
--overview-surface: light-dark(#ffffff, #18191f);
|
|
133
|
+
}
|
|
134
|
+
.overview-metrics {
|
|
135
|
+
display: grid;
|
|
136
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
|
|
137
|
+
gap: .625rem;
|
|
138
|
+
min-width: 0;
|
|
139
|
+
}
|
|
140
|
+
.overview-details {
|
|
141
|
+
display: grid;
|
|
142
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
|
|
143
|
+
gap: 1rem;
|
|
144
|
+
}
|
|
145
|
+
.overview-panel {
|
|
146
|
+
background: var(--overview-surface);
|
|
147
|
+
border: 1px solid var(--overview-border);
|
|
148
|
+
border-radius: 1rem;
|
|
149
|
+
}
|
|
150
|
+
</style>
|
|
151
|
+
|
|
152
|
+
<div class="mx-auto px-4 py-6 sm:px-8 sm:py-8 max-w-6xl dashboard-overview">
|
|
153
|
+
<div class="flex flex-wrap gap-3 items-start justify-between mb-6">
|
|
154
|
+
<PageHeader title="Dashboard" description="Application activity and service health" />
|
|
155
|
+
<Button variant="secondary" size="sm" :loading="dashboard.isLoading.value" @click="loadDashboard">
|
|
156
|
+
Refresh
|
|
157
|
+
</Button>
|
|
147
158
|
</div>
|
|
148
159
|
|
|
149
|
-
<
|
|
150
|
-
<
|
|
151
|
-
<
|
|
160
|
+
<details :if="issues().length > 0" class="mb-4 px-4 py-3 text-amber-800 text-sm dark:text-amber-200 overview-panel">
|
|
161
|
+
<summary class="font-medium cursor-pointer">Some dashboard data is unavailable</summary>
|
|
162
|
+
<ul class="mt-2 pl-5 list-disc">
|
|
163
|
+
<li :for="issue in issues()">{{ issue.source }}: {{ issue.message }}</li>
|
|
164
|
+
</ul>
|
|
165
|
+
</details>
|
|
166
|
+
|
|
167
|
+
<section aria-labelledby="application-overview" class="mb-5 p-3 sm:p-4 overview-panel">
|
|
168
|
+
<div class="flex flex-wrap gap-2 items-center justify-between mb-3">
|
|
169
|
+
<h2 id="application-overview" class="font-semibold text-base text-neutral-900 dark:text-white">Overview</h2>
|
|
170
|
+
<StxLink to="/requests" class="text-neutral-500 text-sm hover:text-neutral-700 dark:hover:text-neutral-300">Request history</StxLink>
|
|
171
|
+
</div>
|
|
172
|
+
<div class="overview-metrics">
|
|
152
173
|
<StatsCard :for="item in loadingCards" :if="dashboard.isLoading.value && stats().length === 0" loading />
|
|
153
174
|
<StatsCard
|
|
154
175
|
:for="stat in stats()"
|
|
@@ -159,19 +180,6 @@ onMount(() => {
|
|
|
159
180
|
:icon="stat.icon"
|
|
160
181
|
:iconBg="stat.iconBg"
|
|
161
182
|
/>
|
|
162
|
-
</div>
|
|
163
|
-
</section>
|
|
164
|
-
|
|
165
|
-
<section aria-labelledby="http-performance" class="mb-8">
|
|
166
|
-
<div class="flex items-end justify-between mb-4">
|
|
167
|
-
<div>
|
|
168
|
-
<h2 id="http-performance" class="font-semibold text-base text-neutral-900 dark:text-white">HTTP performance</h2>
|
|
169
|
-
<p class="mt-1 text-neutral-500 text-sm dark:text-neutral-400">Metrics calculated from captured application requests.</p>
|
|
170
|
-
</div>
|
|
171
|
-
<StxLink to="/requests" class="text-neutral-500 text-sm hover:text-neutral-700 dark:hover:text-neutral-300">Request history</StxLink>
|
|
172
|
-
</div>
|
|
173
|
-
<div class="grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-4">
|
|
174
|
-
<StatsCard :for="item in loadingCards" :if="dashboard.isLoading.value && httpMetrics().length === 0" loading />
|
|
175
183
|
<StatsCard
|
|
176
184
|
:for="metric in httpMetrics()"
|
|
177
185
|
:title="metric.title"
|
|
@@ -183,9 +191,7 @@ onMount(() => {
|
|
|
183
191
|
</div>
|
|
184
192
|
</section>
|
|
185
193
|
|
|
186
|
-
<
|
|
187
|
-
|
|
188
|
-
<div class="grid gap-6 grid-cols-1 lg:grid-cols-2 mt-8">
|
|
194
|
+
<div class="overview-details">
|
|
189
195
|
<ServiceHealth :services="services()" :loading="dashboard.isLoading.value" />
|
|
190
196
|
<ActivityTable :activities="activities()" :description="activityDescription()" :loading="dashboard.isLoading.value">
|
|
191
197
|
<template #actions>
|
|
@@ -194,5 +200,6 @@ onMount(() => {
|
|
|
194
200
|
</ActivityTable>
|
|
195
201
|
</div>
|
|
196
202
|
|
|
197
|
-
<
|
|
203
|
+
<div class="mt-5"><QuickLinks :links="quickLinks()" /></div>
|
|
204
|
+
<div class="mt-5"><QuickLinks title="Resources" :links="resourceLinks" /></div>
|
|
198
205
|
</div>
|
|
@@ -39,10 +39,10 @@ const iconBackgroundClass = derived(() => iconBgClasses[liveIconBg() || 'primary
|
|
|
39
39
|
const trendDirection = derived(() => liveTrend() === null || liveTrend() === 0 ? 'neutral' : (Number(liveTrend()) > 0 ? 'up' : 'down'))
|
|
40
40
|
const trendClass = derived(() => trendClasses[trendDirection()])
|
|
41
41
|
</script>
|
|
42
|
-
<div class="p-5 bg-white dark:bg-neutral-800/90 border border-black/5 rounded-xl dark:border-white/5 hover:shadow-black/5 hover:shadow-md dark:hover:shadow-black/20 duration-150 transition-all">
|
|
43
|
-
<div class="flex items-start justify-between">
|
|
42
|
+
<div class="p-3 sm:p-5 bg-white dark:bg-neutral-800/90 border border-black/5 rounded-xl dark:border-white/5 hover:shadow-black/5 hover:shadow-md dark:hover:shadow-black/20 duration-150 transition-all">
|
|
43
|
+
<div class="flex gap-2 items-start justify-between">
|
|
44
44
|
<div class="flex-1 min-w-0">
|
|
45
|
-
<p class="font-medium text-[13px] text-neutral-500 tracking-tight
|
|
45
|
+
<p class="font-medium leading-snug text-[13px] text-neutral-500 tracking-tight dark:text-neutral-400">
|
|
46
46
|
{{ liveTitle() }}
|
|
47
47
|
</p>
|
|
48
48
|
|
|
@@ -80,7 +80,7 @@ const trendClass = derived(() => trendClasses[trendDirection()])
|
|
|
80
80
|
@endif
|
|
81
81
|
</div>
|
|
82
82
|
|
|
83
|
-
<div :if="liveIcon()" :class="'p-2.5 rounded-lg flex-shrink-0 ' + iconBackgroundClass()">
|
|
83
|
+
<div :if="liveIcon()" :class="'p-1.5 sm:p-2.5 rounded-lg flex-shrink-0 ' + iconBackgroundClass()">
|
|
84
84
|
<div :class="liveIcon() + ' h-5 w-5'"></div>
|
|
85
85
|
</div>
|
|
86
86
|
</div>
|
|
@@ -100,9 +100,12 @@ jobs:
|
|
|
100
100
|
if: ${{ github.event.schedule == '0 */2 * * *' || (github.event_name == 'workflow_dispatch' && contains(fromJSON('["all", "update"]'), inputs.job)) }}
|
|
101
101
|
run: bunx @buddysh/buddy update --strategy "${{ inputs.strategy || 'patch' }}" ${{ inputs.dry_run && '--dry-run' || '' }}
|
|
102
102
|
|
|
103
|
+
# `dashboard` has no --dry-run (it rejects the option and fails the run),
|
|
104
|
+
# so a dry run previews with `scan`, which lists what the dashboard would
|
|
105
|
+
# show and writes nothing - as the framework's own workflow does.
|
|
103
106
|
- name: Update the dependency dashboard
|
|
104
107
|
if: ${{ github.event.schedule == '15 */2 * * *' || (github.event_name == 'workflow_dispatch' && contains(fromJSON('["all", "dashboard"]'), inputs.job)) }}
|
|
105
|
-
run: bunx @buddysh/buddy
|
|
108
|
+
run: bunx @buddysh/buddy ${{ inputs.dry_run && 'scan' || 'dashboard' }}
|
|
106
109
|
|
|
107
110
|
- name: Close landed pull requests and clean up branches
|
|
108
111
|
if: ${{ github.event.schedule == '0 4 * * *' || (github.event_name == 'workflow_dispatch' && contains(fromJSON('["all", "check"]'), inputs.job)) }}
|
|
@@ -137,7 +137,7 @@ select:not([multiple]):not([size]):not([data-ui-select]) {
|
|
|
137
137
|
the document or moving the fixed dashboard shell. */
|
|
138
138
|
overflow-x: hidden;
|
|
139
139
|
margin-left: var(--stx-sidebar-width, 250px);
|
|
140
|
-
background: #
|
|
140
|
+
background: #f6f6f9;
|
|
141
141
|
transition: margin-left 0.3s ease-out;
|
|
142
142
|
}
|
|
143
143
|
/*
|
|
@@ -188,29 +188,8 @@ html .dashboard-modal-layer {
|
|
|
188
188
|
left: 0;
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
/*
|
|
192
|
-
* These three rules used to hide the web sidebar and collapse the content
|
|
193
|
-
* offset, because Craft rendered a real NSOutlineView in that strip and
|
|
194
|
-
* showing both would have meant two navigations side by side.
|
|
195
|
-
*
|
|
196
|
-
* That native sidebar is retired (see actions/src/dev/dashboard.ts: "the web
|
|
197
|
-
* one owns rendering and behavior"), and the dev server never requests one.
|
|
198
|
-
* It does request `webSidebarMaterial: true`, purely for the NSVisualEffectView
|
|
199
|
-
* vibrancy that sits BEHIND the stx-rendered rows.
|
|
200
|
-
*
|
|
201
|
-
* Craft conflates the two: macos.zig gates its native-sidebar bootstrap on
|
|
202
|
-
* `style.web_sidebar_material` alone, and that bootstrap sets the global
|
|
203
|
-
* `__craftNativeSidebar` flag. So asking for vibrancy silently asserted "a
|
|
204
|
-
* native sidebar exists", the marker got stamped on the root element, and
|
|
205
|
-
* these rules hid the only navigation the window had. The Craft window showed
|
|
206
|
-
* a vibrant empty strip.
|
|
207
|
-
*
|
|
208
|
-
* Removed rather than re-gated: with the native sidebar retired there is no
|
|
209
|
-
* state in which hiding the web sidebar is correct. The upstream conflation is
|
|
210
|
-
* worth fixing in Craft too, so the flag stops lying to every other consumer.
|
|
211
|
-
*/
|
|
212
191
|
.dark [data-stx-content] {
|
|
213
|
-
background: #
|
|
192
|
+
background: #121318;
|
|
214
193
|
}
|
|
215
194
|
|
|
216
195
|
/* ===========================================================================
|