qarpeo 0.1.6 → 0.1.8
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/LICENSE +21 -21
- package/README.md +102 -102
- package/dist/module.mjs +1 -1
- package/dist/runtime/app/components/BlobImage.vue +100 -100
- package/dist/runtime/app/components/CMSBlocks.vue +93 -93
- package/dist/runtime/app/components/CMSContent.vue +23 -23
- package/dist/runtime/app/components/CMSImage.vue +49 -49
- package/dist/runtime/app/components/CMSLocaleSwitcher.vue +110 -110
- package/dist/runtime/app/components/CMSPreviewBanner.vue +79 -79
- package/dist/runtime/app/components/CMSVersionBanner.vue +49 -49
- package/dist/runtime/app/components/CMSVersionSwitcher.vue +140 -140
- package/dist/runtime/app/components/ContentRenderer.vue +80 -80
- package/dist/runtime/app/components/FileUpload.vue +196 -196
- package/dist/runtime/app/components/ImpersonationBanner.vue +57 -57
- package/dist/runtime/app/components/SignedIn.vue +13 -13
- package/dist/runtime/app/components/SignedOut.vue +13 -13
- package/dist/runtime/app/components/shiki.css +34 -34
- package/dist/runtime/app/pages/cms.vue +2249 -2249
- package/dist/runtime/app/pages/devtools/overview.vue +390 -390
- package/dist/runtime/app/pages/devtools/settings.vue +560 -560
- package/dist/runtime/app/pages/devtools.vue +165 -165
- package/dist/runtime/app/public/sw-notifications.mjs +52 -52
- package/dist/runtime/server/utils/cms.mjs +102 -18
- package/dist/runtime/types/auth-globals.d.ts +14 -14
- package/dist/runtime/types/imports.d.ts +58 -58
- package/package.json +3 -3
|
@@ -1,390 +1,390 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, onMounted, ref } from "vue"
|
|
3
|
-
|
|
4
|
-
definePageMeta({ layout: false })
|
|
5
|
-
|
|
6
|
-
const {
|
|
7
|
-
data: overviewData,
|
|
8
|
-
status: overviewStatus,
|
|
9
|
-
pending: overviewPending,
|
|
10
|
-
execute: executeLoadOverview,
|
|
11
|
-
} = useFetch<any>("/_qarpeo/api/overview", {
|
|
12
|
-
immediate: false,
|
|
13
|
-
lazy: true,
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
const overviewLoading = computed(
|
|
17
|
-
() =>
|
|
18
|
-
overviewPending.value || overviewStatus.value === "idle" || overviewStatus.value === "pending",
|
|
19
|
-
)
|
|
20
|
-
const overview = computed(() => overviewData.value)
|
|
21
|
-
|
|
22
|
-
const checkingHealth = ref(false)
|
|
23
|
-
const healthResults = ref<Record<string, { ok: boolean; latencyMs: number; error?: string }>>({})
|
|
24
|
-
|
|
25
|
-
async function loadOverview() {
|
|
26
|
-
await executeLoadOverview()
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async function runHealthCheck() {
|
|
30
|
-
checkingHealth.value = true
|
|
31
|
-
try {
|
|
32
|
-
const res = await $fetch<any>("/_qarpeo/api/overview/health").catch(() => null)
|
|
33
|
-
if (res?.health) {
|
|
34
|
-
healthResults.value = res.health
|
|
35
|
-
} else {
|
|
36
|
-
// Dev mock response
|
|
37
|
-
healthResults.value = {
|
|
38
|
-
d1: { ok: true, latencyMs: 2.1 },
|
|
39
|
-
kv: { ok: true, latencyMs: 1.4 },
|
|
40
|
-
r2: { ok: true, latencyMs: 3.8 },
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
} finally {
|
|
44
|
-
checkingHealth.value = false
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const route = useRoute()
|
|
49
|
-
const basePath = computed(() => {
|
|
50
|
-
if (route.path.startsWith("/_qarpeo/devtools")) {
|
|
51
|
-
return "/_qarpeo/devtools"
|
|
52
|
-
}
|
|
53
|
-
return "/devtools"
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
const primitives = computed(() => [
|
|
57
|
-
{
|
|
58
|
-
id: "db",
|
|
59
|
-
name: "D1 Database",
|
|
60
|
-
icon: "i-lucide-database",
|
|
61
|
-
desc: "Serverless SQLite at the edge",
|
|
62
|
-
bindingKey: "d1",
|
|
63
|
-
to: `${basePath.value}/db`,
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
id: "kv",
|
|
67
|
-
name: "KV Store",
|
|
68
|
-
icon: "i-lucide-zap",
|
|
69
|
-
desc: "Global low-latency key-value storage",
|
|
70
|
-
bindingKey: "kv",
|
|
71
|
-
to: `${basePath.value}/kv`,
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
id: "blob",
|
|
75
|
-
name: "Blob Storage",
|
|
76
|
-
icon: "i-lucide-box",
|
|
77
|
-
desc: "S3-compatible R2 object storage",
|
|
78
|
-
bindingKey: "r2",
|
|
79
|
-
to: `${basePath.value}/blob`,
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
id: "domains",
|
|
83
|
-
name: "Domains & Tenants",
|
|
84
|
-
icon: "i-lucide-globe",
|
|
85
|
-
desc: "Custom hostnames & Cloudflare SSL",
|
|
86
|
-
bindingKey: null,
|
|
87
|
-
to: `${basePath.value}/domains`,
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
id: "mail",
|
|
91
|
-
name: "Dev Mailbox",
|
|
92
|
-
icon: "i-lucide-mail",
|
|
93
|
-
desc: "Captured transactional emails",
|
|
94
|
-
bindingKey: null,
|
|
95
|
-
to: `${basePath.value}/mail`,
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
id: "agents",
|
|
99
|
-
name: "Edge Agents",
|
|
100
|
-
icon: "i-lucide-bot",
|
|
101
|
-
desc: "Stateful Durable Object AI agents",
|
|
102
|
-
bindingKey: "agents",
|
|
103
|
-
to: `${basePath.value}/agents`,
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
id: "analytics",
|
|
107
|
-
name: "Edge Analytics",
|
|
108
|
-
icon: "i-lucide-bar-chart-3",
|
|
109
|
-
desc: "Zero-cookie analytics engine",
|
|
110
|
-
bindingKey: "analytics",
|
|
111
|
-
to: `${basePath.value}/analytics`,
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
id: "logs",
|
|
115
|
-
name: "Tail Logs",
|
|
116
|
-
icon: "i-lucide-terminal",
|
|
117
|
-
desc: "Live worker execution logs",
|
|
118
|
-
bindingKey: null,
|
|
119
|
-
to: `${basePath.value}/logs`,
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
id: "cms",
|
|
123
|
-
name: "CMS",
|
|
124
|
-
icon: "i-lucide-file-text",
|
|
125
|
-
desc: "Git-backed content management",
|
|
126
|
-
bindingKey: null,
|
|
127
|
-
to: "/cms",
|
|
128
|
-
},
|
|
129
|
-
])
|
|
130
|
-
|
|
131
|
-
onMounted(async () => {
|
|
132
|
-
await loadOverview()
|
|
133
|
-
runHealthCheck()
|
|
134
|
-
})
|
|
135
|
-
</script>
|
|
136
|
-
|
|
137
|
-
<template>
|
|
138
|
-
<UDashboardPanel id="devtools-overview">
|
|
139
|
-
<template #header>
|
|
140
|
-
<UDashboardNavbar>
|
|
141
|
-
<template #title>
|
|
142
|
-
<div class="flex items-center gap-2.5">
|
|
143
|
-
<UIcon name="i-lucide-layout-dashboard" class="w-4 h-4 text-primary" />
|
|
144
|
-
<span class="font-bold text-sm text-highlighted">System Overview</span>
|
|
145
|
-
<UBadge size="xs" color="primary" variant="subtle">Cloudflare Edge</UBadge>
|
|
146
|
-
<UBadge
|
|
147
|
-
v-if="overview?.environment"
|
|
148
|
-
size="xs"
|
|
149
|
-
:color="overview.environment === 'production' ? 'success' : 'neutral'"
|
|
150
|
-
variant="subtle"
|
|
151
|
-
>
|
|
152
|
-
{{ overview.environment }}
|
|
153
|
-
</UBadge>
|
|
154
|
-
</div>
|
|
155
|
-
</template>
|
|
156
|
-
|
|
157
|
-
<template #right>
|
|
158
|
-
<div class="flex items-center gap-2">
|
|
159
|
-
<UButton
|
|
160
|
-
label="Run Health Diagnostics"
|
|
161
|
-
icon="i-lucide-stethoscope"
|
|
162
|
-
size="xs"
|
|
163
|
-
color="primary"
|
|
164
|
-
variant="subtle"
|
|
165
|
-
:loading="checkingHealth"
|
|
166
|
-
@click="runHealthCheck"
|
|
167
|
-
/>
|
|
168
|
-
<UButton
|
|
169
|
-
icon="i-lucide-refresh-cw"
|
|
170
|
-
size="xs"
|
|
171
|
-
color="neutral"
|
|
172
|
-
variant="ghost"
|
|
173
|
-
title="Refresh overview"
|
|
174
|
-
:loading="overviewLoading"
|
|
175
|
-
@click="loadOverview"
|
|
176
|
-
/>
|
|
177
|
-
</div>
|
|
178
|
-
</template>
|
|
179
|
-
</UDashboardNavbar>
|
|
180
|
-
</template>
|
|
181
|
-
|
|
182
|
-
<template #body>
|
|
183
|
-
<!-- ── Top System Runtime KPI Cards ────────────────────────────── -->
|
|
184
|
-
<div v-if="overviewLoading" class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
|
|
185
|
-
<UCard v-for="i in 4" :key="i">
|
|
186
|
-
<div class="h-3 w-20 rounded bg-muted animate-pulse mb-2"></div>
|
|
187
|
-
<div class="h-6 w-32 rounded bg-muted animate-pulse mb-1"></div>
|
|
188
|
-
<div class="h-2 w-24 rounded bg-muted animate-pulse"></div>
|
|
189
|
-
</UCard>
|
|
190
|
-
</div>
|
|
191
|
-
|
|
192
|
-
<div v-else class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
|
|
193
|
-
<UCard>
|
|
194
|
-
<div class="text-xs text-muted">Platform Runtime</div>
|
|
195
|
-
<div class="text-base font-bold mt-1 text-highlighted">
|
|
196
|
-
{{ overview?.engine || "Nuxt 5 + Cloudflare Workers" }}
|
|
197
|
-
</div>
|
|
198
|
-
<div class="text-[11px] text-muted mt-0.5">Zero-config edge deployment</div>
|
|
199
|
-
</UCard>
|
|
200
|
-
|
|
201
|
-
<UCard>
|
|
202
|
-
<div class="text-xs text-muted">Environment</div>
|
|
203
|
-
<div class="text-base font-bold mt-1 text-success flex items-center gap-2">
|
|
204
|
-
<span class="w-2 h-2 rounded-full bg-success"></span>
|
|
205
|
-
{{ overview?.environment || "development" }}
|
|
206
|
-
</div>
|
|
207
|
-
<div class="text-[11px] text-muted mt-0.5">Local Miniflare / Workerd</div>
|
|
208
|
-
</UCard>
|
|
209
|
-
|
|
210
|
-
<UCard>
|
|
211
|
-
<div class="text-xs text-muted">Core Module Version</div>
|
|
212
|
-
<div class="text-base font-bold mt-1 font-mono text-primary">
|
|
213
|
-
v{{ overview?.version || "0.0.1" }}
|
|
214
|
-
</div>
|
|
215
|
-
<div class="text-[11px] text-muted mt-0.5">Compatibility: 2025-02-01</div>
|
|
216
|
-
</UCard>
|
|
217
|
-
|
|
218
|
-
<UCard>
|
|
219
|
-
<div class="text-xs text-muted">Edge Health</div>
|
|
220
|
-
<div class="text-base font-bold mt-1 text-success flex items-center gap-1.5">
|
|
221
|
-
<UIcon name="i-lucide-check-circle-2" class="w-4 h-4 text-success" />
|
|
222
|
-
<span>All Systems Nominal</span>
|
|
223
|
-
</div>
|
|
224
|
-
<div class="text-[11px] text-muted mt-0.5">D1, KV, and R2 connected</div>
|
|
225
|
-
</UCard>
|
|
226
|
-
</div>
|
|
227
|
-
|
|
228
|
-
<!-- ── Cloudflare Primitives & Tools Grid ─────────────────────── -->
|
|
229
|
-
<div>
|
|
230
|
-
<div class="flex items-center justify-between mb-3">
|
|
231
|
-
<span
|
|
232
|
-
class="text-xs font-semibold uppercase tracking-wider text-muted flex items-center gap-1.5"
|
|
233
|
-
>
|
|
234
|
-
<UIcon name="i-lucide-boxes" class="w-4 h-4 text-primary" />
|
|
235
|
-
Cloudflare Edge Primitives & Tools
|
|
236
|
-
</span>
|
|
237
|
-
<span class="text-xs text-muted font-mono">
|
|
238
|
-
{{ primitives.length }} tools available
|
|
239
|
-
</span>
|
|
240
|
-
</div>
|
|
241
|
-
|
|
242
|
-
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
|
|
243
|
-
<UCard
|
|
244
|
-
v-for="p in primitives"
|
|
245
|
-
:key="p.id"
|
|
246
|
-
class="hover:border-primary/40 transition-all flex flex-col justify-between"
|
|
247
|
-
>
|
|
248
|
-
<div class="space-y-2">
|
|
249
|
-
<div class="flex items-center justify-between">
|
|
250
|
-
<div
|
|
251
|
-
class="w-8 h-8 rounded-lg bg-primary/10 border border-primary/20 flex items-center justify-center text-primary"
|
|
252
|
-
>
|
|
253
|
-
<UIcon :name="p.icon" class="w-4.5 h-4.5" />
|
|
254
|
-
</div>
|
|
255
|
-
|
|
256
|
-
<!-- Health / Status Badge -->
|
|
257
|
-
<div v-if="p.bindingKey && healthResults[p.bindingKey]">
|
|
258
|
-
<UBadge
|
|
259
|
-
size="xs"
|
|
260
|
-
:color="healthResults[p.bindingKey].ok ? 'success' : 'error'"
|
|
261
|
-
variant="subtle"
|
|
262
|
-
class="font-mono"
|
|
263
|
-
>
|
|
264
|
-
{{
|
|
265
|
-
healthResults[p.bindingKey].ok
|
|
266
|
-
? `${healthResults[p.bindingKey].latencyMs}ms`
|
|
267
|
-
: "ERR"
|
|
268
|
-
}}
|
|
269
|
-
</UBadge>
|
|
270
|
-
</div>
|
|
271
|
-
<UBadge v-else size="xs" color="neutral" variant="subtle"> Active </UBadge>
|
|
272
|
-
</div>
|
|
273
|
-
|
|
274
|
-
<div>
|
|
275
|
-
<div class="font-bold text-sm text-highlighted">
|
|
276
|
-
{{ p.name }}
|
|
277
|
-
</div>
|
|
278
|
-
<div class="text-xs text-muted mt-0.5 line-clamp-1">
|
|
279
|
-
{{ p.desc }}
|
|
280
|
-
</div>
|
|
281
|
-
</div>
|
|
282
|
-
|
|
283
|
-
<div
|
|
284
|
-
v-if="p.bindingKey && overview?.bindings?.[p.bindingKey]"
|
|
285
|
-
class="text-[11px] font-mono text-muted"
|
|
286
|
-
>
|
|
287
|
-
Binding:
|
|
288
|
-
<span class="text-primary font-semibold">{{
|
|
289
|
-
overview.bindings[p.bindingKey]
|
|
290
|
-
}}</span>
|
|
291
|
-
</div>
|
|
292
|
-
</div>
|
|
293
|
-
|
|
294
|
-
<div class="pt-4 mt-2 border-t border-default/50">
|
|
295
|
-
<UButton
|
|
296
|
-
:to="p.to"
|
|
297
|
-
label="Open Tool"
|
|
298
|
-
trailing-icon="i-lucide-arrow-right"
|
|
299
|
-
size="xs"
|
|
300
|
-
color="neutral"
|
|
301
|
-
variant="subtle"
|
|
302
|
-
class="w-full justify-between"
|
|
303
|
-
/>
|
|
304
|
-
</div>
|
|
305
|
-
</UCard>
|
|
306
|
-
</div>
|
|
307
|
-
</div>
|
|
308
|
-
|
|
309
|
-
<!-- ── Configured Modules Matrix ──────────────────────────────── -->
|
|
310
|
-
<UCard>
|
|
311
|
-
<template #header>
|
|
312
|
-
<div class="flex items-center justify-between">
|
|
313
|
-
<span class="font-bold text-sm text-highlighted flex items-center gap-2">
|
|
314
|
-
<UIcon name="i-lucide-cpu" class="w-4 h-4 text-primary" />
|
|
315
|
-
Configured Features Matrix
|
|
316
|
-
</span>
|
|
317
|
-
<span class="text-xs text-muted font-mono"> Tier 1 & Tier 2 Solutions </span>
|
|
318
|
-
</div>
|
|
319
|
-
</template>
|
|
320
|
-
|
|
321
|
-
<div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-3">
|
|
322
|
-
<div
|
|
323
|
-
v-for="[name, enabled] in Object.entries(overview?.modules || {})"
|
|
324
|
-
:key="name"
|
|
325
|
-
class="flex items-center gap-2 p-2.5 rounded-md border border-default bg-muted/20"
|
|
326
|
-
>
|
|
327
|
-
<span
|
|
328
|
-
class="w-2 h-2 rounded-full shrink-0"
|
|
329
|
-
:class="enabled ? 'bg-success' : 'bg-muted'"
|
|
330
|
-
></span>
|
|
331
|
-
<span class="font-mono text-xs font-semibold capitalize text-default truncate">
|
|
332
|
-
{{ name }}
|
|
333
|
-
</span>
|
|
334
|
-
</div>
|
|
335
|
-
</div>
|
|
336
|
-
</UCard>
|
|
337
|
-
|
|
338
|
-
<!-- ── Worker Bindings Inspection Table ───────────────────────── -->
|
|
339
|
-
<UCard :ui="{ body: 'p-0 overflow-hidden' }">
|
|
340
|
-
<template #header>
|
|
341
|
-
<div class="flex items-center justify-between">
|
|
342
|
-
<span class="font-bold text-sm text-highlighted flex items-center gap-2">
|
|
343
|
-
<UIcon name="i-lucide-cable" class="w-4 h-4 text-primary" />
|
|
344
|
-
Environment Bindings
|
|
345
|
-
</span>
|
|
346
|
-
<span class="text-xs text-muted font-mono"> wrangler.json / runtimeConfig </span>
|
|
347
|
-
</div>
|
|
348
|
-
</template>
|
|
349
|
-
|
|
350
|
-
<table class="w-full text-left text-xs">
|
|
351
|
-
<thead>
|
|
352
|
-
<tr class="border-b border-default bg-muted/40 text-muted font-mono">
|
|
353
|
-
<th class="py-2.5 px-4 font-semibold">Primitive Type</th>
|
|
354
|
-
<th class="py-2.5 px-4 font-semibold">Environment Variable</th>
|
|
355
|
-
<th class="py-2.5 px-4 font-semibold">Diagnostic Latency</th>
|
|
356
|
-
</tr>
|
|
357
|
-
</thead>
|
|
358
|
-
<tbody class="divide-y divide-default font-mono">
|
|
359
|
-
<tr
|
|
360
|
-
v-for="[prim, varName] in Object.entries(overview?.bindings || {})"
|
|
361
|
-
:key="prim"
|
|
362
|
-
class="hover:bg-elevated/50 transition-colors"
|
|
363
|
-
>
|
|
364
|
-
<td class="py-2.5 px-4 text-primary font-bold uppercase">
|
|
365
|
-
{{ prim }}
|
|
366
|
-
</td>
|
|
367
|
-
<td class="py-2.5 px-4 text-default">
|
|
368
|
-
{{ varName }}
|
|
369
|
-
</td>
|
|
370
|
-
<td class="py-2.5 px-4">
|
|
371
|
-
<span
|
|
372
|
-
v-if="healthResults[prim]"
|
|
373
|
-
class="text-xs"
|
|
374
|
-
:class="healthResults[prim].ok ? 'text-success' : 'text-error'"
|
|
375
|
-
>
|
|
376
|
-
{{
|
|
377
|
-
healthResults[prim].ok
|
|
378
|
-
? `${healthResults[prim].latencyMs} ms`
|
|
379
|
-
: healthResults[prim].error
|
|
380
|
-
}}
|
|
381
|
-
</span>
|
|
382
|
-
<span v-else class="text-muted text-[11px]">—</span>
|
|
383
|
-
</td>
|
|
384
|
-
</tr>
|
|
385
|
-
</tbody>
|
|
386
|
-
</table>
|
|
387
|
-
</UCard>
|
|
388
|
-
</template>
|
|
389
|
-
</UDashboardPanel>
|
|
390
|
-
</template>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted, ref } from "vue"
|
|
3
|
+
|
|
4
|
+
definePageMeta({ layout: false })
|
|
5
|
+
|
|
6
|
+
const {
|
|
7
|
+
data: overviewData,
|
|
8
|
+
status: overviewStatus,
|
|
9
|
+
pending: overviewPending,
|
|
10
|
+
execute: executeLoadOverview,
|
|
11
|
+
} = useFetch<any>("/_qarpeo/api/overview", {
|
|
12
|
+
immediate: false,
|
|
13
|
+
lazy: true,
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const overviewLoading = computed(
|
|
17
|
+
() =>
|
|
18
|
+
overviewPending.value || overviewStatus.value === "idle" || overviewStatus.value === "pending",
|
|
19
|
+
)
|
|
20
|
+
const overview = computed(() => overviewData.value)
|
|
21
|
+
|
|
22
|
+
const checkingHealth = ref(false)
|
|
23
|
+
const healthResults = ref<Record<string, { ok: boolean; latencyMs: number; error?: string }>>({})
|
|
24
|
+
|
|
25
|
+
async function loadOverview() {
|
|
26
|
+
await executeLoadOverview()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async function runHealthCheck() {
|
|
30
|
+
checkingHealth.value = true
|
|
31
|
+
try {
|
|
32
|
+
const res = await $fetch<any>("/_qarpeo/api/overview/health").catch(() => null)
|
|
33
|
+
if (res?.health) {
|
|
34
|
+
healthResults.value = res.health
|
|
35
|
+
} else {
|
|
36
|
+
// Dev mock response
|
|
37
|
+
healthResults.value = {
|
|
38
|
+
d1: { ok: true, latencyMs: 2.1 },
|
|
39
|
+
kv: { ok: true, latencyMs: 1.4 },
|
|
40
|
+
r2: { ok: true, latencyMs: 3.8 },
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
} finally {
|
|
44
|
+
checkingHealth.value = false
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const route = useRoute()
|
|
49
|
+
const basePath = computed(() => {
|
|
50
|
+
if (route.path.startsWith("/_qarpeo/devtools")) {
|
|
51
|
+
return "/_qarpeo/devtools"
|
|
52
|
+
}
|
|
53
|
+
return "/devtools"
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
const primitives = computed(() => [
|
|
57
|
+
{
|
|
58
|
+
id: "db",
|
|
59
|
+
name: "D1 Database",
|
|
60
|
+
icon: "i-lucide-database",
|
|
61
|
+
desc: "Serverless SQLite at the edge",
|
|
62
|
+
bindingKey: "d1",
|
|
63
|
+
to: `${basePath.value}/db`,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: "kv",
|
|
67
|
+
name: "KV Store",
|
|
68
|
+
icon: "i-lucide-zap",
|
|
69
|
+
desc: "Global low-latency key-value storage",
|
|
70
|
+
bindingKey: "kv",
|
|
71
|
+
to: `${basePath.value}/kv`,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: "blob",
|
|
75
|
+
name: "Blob Storage",
|
|
76
|
+
icon: "i-lucide-box",
|
|
77
|
+
desc: "S3-compatible R2 object storage",
|
|
78
|
+
bindingKey: "r2",
|
|
79
|
+
to: `${basePath.value}/blob`,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: "domains",
|
|
83
|
+
name: "Domains & Tenants",
|
|
84
|
+
icon: "i-lucide-globe",
|
|
85
|
+
desc: "Custom hostnames & Cloudflare SSL",
|
|
86
|
+
bindingKey: null,
|
|
87
|
+
to: `${basePath.value}/domains`,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: "mail",
|
|
91
|
+
name: "Dev Mailbox",
|
|
92
|
+
icon: "i-lucide-mail",
|
|
93
|
+
desc: "Captured transactional emails",
|
|
94
|
+
bindingKey: null,
|
|
95
|
+
to: `${basePath.value}/mail`,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: "agents",
|
|
99
|
+
name: "Edge Agents",
|
|
100
|
+
icon: "i-lucide-bot",
|
|
101
|
+
desc: "Stateful Durable Object AI agents",
|
|
102
|
+
bindingKey: "agents",
|
|
103
|
+
to: `${basePath.value}/agents`,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: "analytics",
|
|
107
|
+
name: "Edge Analytics",
|
|
108
|
+
icon: "i-lucide-bar-chart-3",
|
|
109
|
+
desc: "Zero-cookie analytics engine",
|
|
110
|
+
bindingKey: "analytics",
|
|
111
|
+
to: `${basePath.value}/analytics`,
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
id: "logs",
|
|
115
|
+
name: "Tail Logs",
|
|
116
|
+
icon: "i-lucide-terminal",
|
|
117
|
+
desc: "Live worker execution logs",
|
|
118
|
+
bindingKey: null,
|
|
119
|
+
to: `${basePath.value}/logs`,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: "cms",
|
|
123
|
+
name: "CMS",
|
|
124
|
+
icon: "i-lucide-file-text",
|
|
125
|
+
desc: "Git-backed content management",
|
|
126
|
+
bindingKey: null,
|
|
127
|
+
to: "/cms",
|
|
128
|
+
},
|
|
129
|
+
])
|
|
130
|
+
|
|
131
|
+
onMounted(async () => {
|
|
132
|
+
await loadOverview()
|
|
133
|
+
runHealthCheck()
|
|
134
|
+
})
|
|
135
|
+
</script>
|
|
136
|
+
|
|
137
|
+
<template>
|
|
138
|
+
<UDashboardPanel id="devtools-overview">
|
|
139
|
+
<template #header>
|
|
140
|
+
<UDashboardNavbar>
|
|
141
|
+
<template #title>
|
|
142
|
+
<div class="flex items-center gap-2.5">
|
|
143
|
+
<UIcon name="i-lucide-layout-dashboard" class="w-4 h-4 text-primary" />
|
|
144
|
+
<span class="font-bold text-sm text-highlighted">System Overview</span>
|
|
145
|
+
<UBadge size="xs" color="primary" variant="subtle">Cloudflare Edge</UBadge>
|
|
146
|
+
<UBadge
|
|
147
|
+
v-if="overview?.environment"
|
|
148
|
+
size="xs"
|
|
149
|
+
:color="overview.environment === 'production' ? 'success' : 'neutral'"
|
|
150
|
+
variant="subtle"
|
|
151
|
+
>
|
|
152
|
+
{{ overview.environment }}
|
|
153
|
+
</UBadge>
|
|
154
|
+
</div>
|
|
155
|
+
</template>
|
|
156
|
+
|
|
157
|
+
<template #right>
|
|
158
|
+
<div class="flex items-center gap-2">
|
|
159
|
+
<UButton
|
|
160
|
+
label="Run Health Diagnostics"
|
|
161
|
+
icon="i-lucide-stethoscope"
|
|
162
|
+
size="xs"
|
|
163
|
+
color="primary"
|
|
164
|
+
variant="subtle"
|
|
165
|
+
:loading="checkingHealth"
|
|
166
|
+
@click="runHealthCheck"
|
|
167
|
+
/>
|
|
168
|
+
<UButton
|
|
169
|
+
icon="i-lucide-refresh-cw"
|
|
170
|
+
size="xs"
|
|
171
|
+
color="neutral"
|
|
172
|
+
variant="ghost"
|
|
173
|
+
title="Refresh overview"
|
|
174
|
+
:loading="overviewLoading"
|
|
175
|
+
@click="loadOverview"
|
|
176
|
+
/>
|
|
177
|
+
</div>
|
|
178
|
+
</template>
|
|
179
|
+
</UDashboardNavbar>
|
|
180
|
+
</template>
|
|
181
|
+
|
|
182
|
+
<template #body>
|
|
183
|
+
<!-- ── Top System Runtime KPI Cards ────────────────────────────── -->
|
|
184
|
+
<div v-if="overviewLoading" class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
|
|
185
|
+
<UCard v-for="i in 4" :key="i">
|
|
186
|
+
<div class="h-3 w-20 rounded bg-muted animate-pulse mb-2"></div>
|
|
187
|
+
<div class="h-6 w-32 rounded bg-muted animate-pulse mb-1"></div>
|
|
188
|
+
<div class="h-2 w-24 rounded bg-muted animate-pulse"></div>
|
|
189
|
+
</UCard>
|
|
190
|
+
</div>
|
|
191
|
+
|
|
192
|
+
<div v-else class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
|
|
193
|
+
<UCard>
|
|
194
|
+
<div class="text-xs text-muted">Platform Runtime</div>
|
|
195
|
+
<div class="text-base font-bold mt-1 text-highlighted">
|
|
196
|
+
{{ overview?.engine || "Nuxt 5 + Cloudflare Workers" }}
|
|
197
|
+
</div>
|
|
198
|
+
<div class="text-[11px] text-muted mt-0.5">Zero-config edge deployment</div>
|
|
199
|
+
</UCard>
|
|
200
|
+
|
|
201
|
+
<UCard>
|
|
202
|
+
<div class="text-xs text-muted">Environment</div>
|
|
203
|
+
<div class="text-base font-bold mt-1 text-success flex items-center gap-2">
|
|
204
|
+
<span class="w-2 h-2 rounded-full bg-success"></span>
|
|
205
|
+
{{ overview?.environment || "development" }}
|
|
206
|
+
</div>
|
|
207
|
+
<div class="text-[11px] text-muted mt-0.5">Local Miniflare / Workerd</div>
|
|
208
|
+
</UCard>
|
|
209
|
+
|
|
210
|
+
<UCard>
|
|
211
|
+
<div class="text-xs text-muted">Core Module Version</div>
|
|
212
|
+
<div class="text-base font-bold mt-1 font-mono text-primary">
|
|
213
|
+
v{{ overview?.version || "0.0.1" }}
|
|
214
|
+
</div>
|
|
215
|
+
<div class="text-[11px] text-muted mt-0.5">Compatibility: 2025-02-01</div>
|
|
216
|
+
</UCard>
|
|
217
|
+
|
|
218
|
+
<UCard>
|
|
219
|
+
<div class="text-xs text-muted">Edge Health</div>
|
|
220
|
+
<div class="text-base font-bold mt-1 text-success flex items-center gap-1.5">
|
|
221
|
+
<UIcon name="i-lucide-check-circle-2" class="w-4 h-4 text-success" />
|
|
222
|
+
<span>All Systems Nominal</span>
|
|
223
|
+
</div>
|
|
224
|
+
<div class="text-[11px] text-muted mt-0.5">D1, KV, and R2 connected</div>
|
|
225
|
+
</UCard>
|
|
226
|
+
</div>
|
|
227
|
+
|
|
228
|
+
<!-- ── Cloudflare Primitives & Tools Grid ─────────────────────── -->
|
|
229
|
+
<div>
|
|
230
|
+
<div class="flex items-center justify-between mb-3">
|
|
231
|
+
<span
|
|
232
|
+
class="text-xs font-semibold uppercase tracking-wider text-muted flex items-center gap-1.5"
|
|
233
|
+
>
|
|
234
|
+
<UIcon name="i-lucide-boxes" class="w-4 h-4 text-primary" />
|
|
235
|
+
Cloudflare Edge Primitives & Tools
|
|
236
|
+
</span>
|
|
237
|
+
<span class="text-xs text-muted font-mono">
|
|
238
|
+
{{ primitives.length }} tools available
|
|
239
|
+
</span>
|
|
240
|
+
</div>
|
|
241
|
+
|
|
242
|
+
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
|
|
243
|
+
<UCard
|
|
244
|
+
v-for="p in primitives"
|
|
245
|
+
:key="p.id"
|
|
246
|
+
class="hover:border-primary/40 transition-all flex flex-col justify-between"
|
|
247
|
+
>
|
|
248
|
+
<div class="space-y-2">
|
|
249
|
+
<div class="flex items-center justify-between">
|
|
250
|
+
<div
|
|
251
|
+
class="w-8 h-8 rounded-lg bg-primary/10 border border-primary/20 flex items-center justify-center text-primary"
|
|
252
|
+
>
|
|
253
|
+
<UIcon :name="p.icon" class="w-4.5 h-4.5" />
|
|
254
|
+
</div>
|
|
255
|
+
|
|
256
|
+
<!-- Health / Status Badge -->
|
|
257
|
+
<div v-if="p.bindingKey && healthResults[p.bindingKey]">
|
|
258
|
+
<UBadge
|
|
259
|
+
size="xs"
|
|
260
|
+
:color="healthResults[p.bindingKey].ok ? 'success' : 'error'"
|
|
261
|
+
variant="subtle"
|
|
262
|
+
class="font-mono"
|
|
263
|
+
>
|
|
264
|
+
{{
|
|
265
|
+
healthResults[p.bindingKey].ok
|
|
266
|
+
? `${healthResults[p.bindingKey].latencyMs}ms`
|
|
267
|
+
: "ERR"
|
|
268
|
+
}}
|
|
269
|
+
</UBadge>
|
|
270
|
+
</div>
|
|
271
|
+
<UBadge v-else size="xs" color="neutral" variant="subtle"> Active </UBadge>
|
|
272
|
+
</div>
|
|
273
|
+
|
|
274
|
+
<div>
|
|
275
|
+
<div class="font-bold text-sm text-highlighted">
|
|
276
|
+
{{ p.name }}
|
|
277
|
+
</div>
|
|
278
|
+
<div class="text-xs text-muted mt-0.5 line-clamp-1">
|
|
279
|
+
{{ p.desc }}
|
|
280
|
+
</div>
|
|
281
|
+
</div>
|
|
282
|
+
|
|
283
|
+
<div
|
|
284
|
+
v-if="p.bindingKey && overview?.bindings?.[p.bindingKey]"
|
|
285
|
+
class="text-[11px] font-mono text-muted"
|
|
286
|
+
>
|
|
287
|
+
Binding:
|
|
288
|
+
<span class="text-primary font-semibold">{{
|
|
289
|
+
overview.bindings[p.bindingKey]
|
|
290
|
+
}}</span>
|
|
291
|
+
</div>
|
|
292
|
+
</div>
|
|
293
|
+
|
|
294
|
+
<div class="pt-4 mt-2 border-t border-default/50">
|
|
295
|
+
<UButton
|
|
296
|
+
:to="p.to"
|
|
297
|
+
label="Open Tool"
|
|
298
|
+
trailing-icon="i-lucide-arrow-right"
|
|
299
|
+
size="xs"
|
|
300
|
+
color="neutral"
|
|
301
|
+
variant="subtle"
|
|
302
|
+
class="w-full justify-between"
|
|
303
|
+
/>
|
|
304
|
+
</div>
|
|
305
|
+
</UCard>
|
|
306
|
+
</div>
|
|
307
|
+
</div>
|
|
308
|
+
|
|
309
|
+
<!-- ── Configured Modules Matrix ──────────────────────────────── -->
|
|
310
|
+
<UCard>
|
|
311
|
+
<template #header>
|
|
312
|
+
<div class="flex items-center justify-between">
|
|
313
|
+
<span class="font-bold text-sm text-highlighted flex items-center gap-2">
|
|
314
|
+
<UIcon name="i-lucide-cpu" class="w-4 h-4 text-primary" />
|
|
315
|
+
Configured Features Matrix
|
|
316
|
+
</span>
|
|
317
|
+
<span class="text-xs text-muted font-mono"> Tier 1 & Tier 2 Solutions </span>
|
|
318
|
+
</div>
|
|
319
|
+
</template>
|
|
320
|
+
|
|
321
|
+
<div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-3">
|
|
322
|
+
<div
|
|
323
|
+
v-for="[name, enabled] in Object.entries(overview?.modules || {})"
|
|
324
|
+
:key="name"
|
|
325
|
+
class="flex items-center gap-2 p-2.5 rounded-md border border-default bg-muted/20"
|
|
326
|
+
>
|
|
327
|
+
<span
|
|
328
|
+
class="w-2 h-2 rounded-full shrink-0"
|
|
329
|
+
:class="enabled ? 'bg-success' : 'bg-muted'"
|
|
330
|
+
></span>
|
|
331
|
+
<span class="font-mono text-xs font-semibold capitalize text-default truncate">
|
|
332
|
+
{{ name }}
|
|
333
|
+
</span>
|
|
334
|
+
</div>
|
|
335
|
+
</div>
|
|
336
|
+
</UCard>
|
|
337
|
+
|
|
338
|
+
<!-- ── Worker Bindings Inspection Table ───────────────────────── -->
|
|
339
|
+
<UCard :ui="{ body: 'p-0 overflow-hidden' }">
|
|
340
|
+
<template #header>
|
|
341
|
+
<div class="flex items-center justify-between">
|
|
342
|
+
<span class="font-bold text-sm text-highlighted flex items-center gap-2">
|
|
343
|
+
<UIcon name="i-lucide-cable" class="w-4 h-4 text-primary" />
|
|
344
|
+
Environment Bindings
|
|
345
|
+
</span>
|
|
346
|
+
<span class="text-xs text-muted font-mono"> wrangler.json / runtimeConfig </span>
|
|
347
|
+
</div>
|
|
348
|
+
</template>
|
|
349
|
+
|
|
350
|
+
<table class="w-full text-left text-xs">
|
|
351
|
+
<thead>
|
|
352
|
+
<tr class="border-b border-default bg-muted/40 text-muted font-mono">
|
|
353
|
+
<th class="py-2.5 px-4 font-semibold">Primitive Type</th>
|
|
354
|
+
<th class="py-2.5 px-4 font-semibold">Environment Variable</th>
|
|
355
|
+
<th class="py-2.5 px-4 font-semibold">Diagnostic Latency</th>
|
|
356
|
+
</tr>
|
|
357
|
+
</thead>
|
|
358
|
+
<tbody class="divide-y divide-default font-mono">
|
|
359
|
+
<tr
|
|
360
|
+
v-for="[prim, varName] in Object.entries(overview?.bindings || {})"
|
|
361
|
+
:key="prim"
|
|
362
|
+
class="hover:bg-elevated/50 transition-colors"
|
|
363
|
+
>
|
|
364
|
+
<td class="py-2.5 px-4 text-primary font-bold uppercase">
|
|
365
|
+
{{ prim }}
|
|
366
|
+
</td>
|
|
367
|
+
<td class="py-2.5 px-4 text-default">
|
|
368
|
+
{{ varName }}
|
|
369
|
+
</td>
|
|
370
|
+
<td class="py-2.5 px-4">
|
|
371
|
+
<span
|
|
372
|
+
v-if="healthResults[prim]"
|
|
373
|
+
class="text-xs"
|
|
374
|
+
:class="healthResults[prim].ok ? 'text-success' : 'text-error'"
|
|
375
|
+
>
|
|
376
|
+
{{
|
|
377
|
+
healthResults[prim].ok
|
|
378
|
+
? `${healthResults[prim].latencyMs} ms`
|
|
379
|
+
: healthResults[prim].error
|
|
380
|
+
}}
|
|
381
|
+
</span>
|
|
382
|
+
<span v-else class="text-muted text-[11px]">—</span>
|
|
383
|
+
</td>
|
|
384
|
+
</tr>
|
|
385
|
+
</tbody>
|
|
386
|
+
</table>
|
|
387
|
+
</UCard>
|
|
388
|
+
</template>
|
|
389
|
+
</UDashboardPanel>
|
|
390
|
+
</template>
|