@powersync/nuxt 0.0.0-dev-20260827080125 → 0.0.0-dev-20261015114518

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.
Files changed (55) hide show
  1. package/README.md +36 -59
  2. package/dist/module.d.mts +4 -3
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +74 -64
  5. package/dist/runtime/assets/devtools-theme.d.ts +1 -0
  6. package/dist/runtime/assets/devtools-theme.js +33 -0
  7. package/dist/runtime/options.d.ts +13 -0
  8. package/dist/runtime/options.js +0 -0
  9. package/dist/runtime/plugin.client.js +8 -8
  10. package/package.json +12 -13
  11. package/dist/runtime/components/BucketsInspectorTab.d.vue.ts +0 -3
  12. package/dist/runtime/components/BucketsInspectorTab.vue +0 -544
  13. package/dist/runtime/components/BucketsInspectorTab.vue.d.ts +0 -3
  14. package/dist/runtime/components/ConfigInspectorTab.d.vue.ts +0 -3
  15. package/dist/runtime/components/ConfigInspectorTab.vue +0 -84
  16. package/dist/runtime/components/ConfigInspectorTab.vue.d.ts +0 -3
  17. package/dist/runtime/components/DataInspectorTab.d.vue.ts +0 -3
  18. package/dist/runtime/components/DataInspectorTab.vue +0 -564
  19. package/dist/runtime/components/DataInspectorTab.vue.d.ts +0 -3
  20. package/dist/runtime/components/LoadingSpinner.d.vue.ts +0 -3
  21. package/dist/runtime/components/LoadingSpinner.vue +0 -12
  22. package/dist/runtime/components/LoadingSpinner.vue.d.ts +0 -3
  23. package/dist/runtime/components/LogsTab.d.vue.ts +0 -3
  24. package/dist/runtime/components/LogsTab.vue +0 -273
  25. package/dist/runtime/components/LogsTab.vue.d.ts +0 -3
  26. package/dist/runtime/components/PowerSyncInstanceTab.d.vue.ts +0 -3
  27. package/dist/runtime/components/PowerSyncInstanceTab.vue +0 -7
  28. package/dist/runtime/components/PowerSyncInstanceTab.vue.d.ts +0 -3
  29. package/dist/runtime/components/SyncStatusTab.d.vue.ts +0 -3
  30. package/dist/runtime/components/SyncStatusTab.vue +0 -161
  31. package/dist/runtime/components/SyncStatusTab.vue.d.ts +0 -3
  32. package/dist/runtime/composables/usePowerSyncInspector.d.ts +0 -39
  33. package/dist/runtime/composables/usePowerSyncInspector.js +0 -17
  34. package/dist/runtime/composables/usePowerSyncInspectorDiagnostics.d.ts +0 -153
  35. package/dist/runtime/composables/usePowerSyncInspectorDiagnostics.js +0 -216
  36. package/dist/runtime/layouts/powersync-inspector-layout.d.vue.ts +0 -13
  37. package/dist/runtime/layouts/powersync-inspector-layout.vue +0 -63
  38. package/dist/runtime/layouts/powersync-inspector-layout.vue.d.ts +0 -13
  39. package/dist/runtime/pages/__powersync-inspector.d.vue.ts +0 -3
  40. package/dist/runtime/pages/__powersync-inspector.vue +0 -119
  41. package/dist/runtime/pages/__powersync-inspector.vue.d.ts +0 -3
  42. package/dist/runtime/utils/AppSchema.d.ts +0 -27
  43. package/dist/runtime/utils/AppSchema.js +0 -23
  44. package/dist/runtime/utils/DynamicSchemaManager.d.ts +0 -16
  45. package/dist/runtime/utils/DynamicSchemaManager.js +0 -82
  46. package/dist/runtime/utils/JsSchemaGenerator.d.ts +0 -8
  47. package/dist/runtime/utils/JsSchemaGenerator.js +0 -28
  48. package/dist/runtime/utils/NuxtPowerSyncDatabase.d.ts +0 -42
  49. package/dist/runtime/utils/NuxtPowerSyncDatabase.js +0 -97
  50. package/dist/runtime/utils/RustClientInterceptor.d.ts +0 -24
  51. package/dist/runtime/utils/RustClientInterceptor.js +0 -90
  52. package/dist/runtime/utils/TokenConnector.d.ts +0 -14
  53. package/dist/runtime/utils/TokenConnector.js +0 -57
  54. package/dist/runtime/utils/index.d.ts +0 -1
  55. package/dist/runtime/utils/index.js +0 -1
@@ -1,544 +0,0 @@
1
- <template>
2
- <TooltipProvider :delay-duration="100">
3
- <div border="t" border-color="gray-100" relative n-bg="base" flex="~ col" h="screen" overflow="hidden">
4
- <SplitterGroup id="buckets-splitter-group" class="h-full" direction="horizontal">
5
- <!-- Buckets List Panel -->
6
- <SplitterPanel
7
- id="buckets-list-panel"
8
- :min-size="30"
9
- :default-size="40"
10
- class="border-r border-gray-200 flex flex-col overflow-hidden"
11
- >
12
- <div class="flex-1 flex flex-col overflow-hidden">
13
- <!-- Header -->
14
- <div class="p-3 border-b border-gray-200 dark:border-neutral-700">
15
- <div class="flex items-center justify-between mb-2">
16
- <h2 class="text-lg font-semibold text-gray-900 dark:text-gray-100">Buckets</h2>
17
- <NBadge n="slate xs">
18
- {{ filteredBuckets.length }}
19
- </NBadge>
20
- </div>
21
-
22
- <!-- Search Bar -->
23
- <NTextInput
24
- v-model="searchQuery"
25
- n="xs"
26
- class="w-full"
27
- placeholder="Search buckets..."
28
- icon="carbon:search"
29
- @input="onSearchInput"
30
- />
31
- </div>
32
-
33
- <!-- Buckets List -->
34
- <div class="flex-1 overflow-y-auto">
35
- <div
36
- v-if="filteredBuckets.length === 0 && !isLoading"
37
- class="flex-1 flex items-center justify-center text-gray-500 dark:text-gray-400 text-sm mt-3"
38
- >
39
- <div class="text-center">
40
- <NIcon icon="carbon:data-error" class="text-2xl mb-2" />
41
- <div>No buckets found</div>
42
- </div>
43
- </div>
44
-
45
- <div v-else-if="isLoading" class="flex-1 flex items-center justify-center">
46
- <NLoading />
47
- </div>
48
-
49
- <div v-else class="p-2 space-y-1">
50
- <div
51
- v-for="bucket in filteredBuckets"
52
- :key="bucket.name"
53
- class="bucket-item p-3 rounded-lg border border-gray-200 dark:border-neutral-700 cursor-pointer transition-all hover:bg-gray-50 dark:hover:bg-neutral-800"
54
- :class="{
55
- 'bg-gray-100 dark:bg-neutral-400/20 border-gray-300 dark:border-blue-700': selectedBucket?.name === bucket.name
56
- }"
57
- @click="selectBucket(bucket)"
58
- >
59
- <div class="flex items-start justify-between">
60
- <div class="flex-1 min-w-0 flex flex-col gap-1">
61
- <div class="flex items-center gap-2 mb-1">
62
- <NIcon icon="carbon:db2-database" class="text-blue-500 flex-shrink-0" />
63
- <span class="font-medium text-gray-900 dark:text-gray-100 truncate">
64
- {{ bucket.name }}
65
- </span>
66
- </div>
67
-
68
- <!-- Bucket Details - Two Lines -->
69
- <div class="grid grid-cols-4 gap-2 text-xs text-gray-600 dark:text-gray-400">
70
- <!-- Data Size -->
71
- <TooltipRoot>
72
- <TooltipTrigger as-child>
73
- <div class="flex items-center gap-1">
74
- <NIcon icon="carbon:data-volume" class="text-xs" />
75
- <span>{{ formatBytes(bucket.data_size || 0) }}</span>
76
- </div>
77
- </TooltipTrigger>
78
- <TooltipContent
79
- side="bottom"
80
- class="text-xs bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700 rounded-md p-2"
81
- >
82
- Data Size: {{ formatBytes(bucket.data_size || 0) }}
83
- </TooltipContent>
84
- </TooltipRoot>
85
-
86
- <!-- Row Count -->
87
- <TooltipRoot>
88
- <TooltipTrigger as-child>
89
- <div class="flex items-center gap-1">
90
- <NIcon icon="carbon:data-2" class="text-xs" />
91
- <span>{{ bucket.row_count || 0 }} rows</span>
92
- </div>
93
- </TooltipTrigger>
94
- <TooltipContent
95
- side="bottom"
96
- class="text-xs bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700 rounded-md p-2"
97
- >
98
- Row Count: {{ bucket.row_count || 0 }} rows
99
- </TooltipContent>
100
- </TooltipRoot>
101
-
102
- <!-- Metadata Size -->
103
- <TooltipRoot>
104
- <TooltipTrigger as-child>
105
- <div class="flex items-center gap-1">
106
- <NIcon icon="carbon:array-objects" class="text-xs" />
107
- <span>{{ formatBytes(bucket.metadata_size || 0) }}</span>
108
- </div>
109
- </TooltipTrigger>
110
- <TooltipContent
111
- side="bottom"
112
- class="text-xs bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700 rounded-md p-2"
113
- >
114
- Metadata Size: {{ formatBytes(bucket.metadata_size || 0) }}
115
- </TooltipContent>
116
- </TooltipRoot>
117
-
118
- <!-- Download Size -->
119
- <TooltipRoot>
120
- <TooltipTrigger as-child>
121
- <div class="flex items-center gap-1">
122
- <NIcon icon="carbon:download" class="text-xs" />
123
- <span>{{ formatBytes(bucket.download_size || 0) }}</span>
124
- </div>
125
- </TooltipTrigger>
126
- <TooltipContent
127
- side="bottom"
128
- class="text-xs bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700 rounded-md p-2"
129
- >
130
- Download Size: {{ formatBytes(bucket.download_size || 0) }}
131
- </TooltipContent>
132
- </TooltipRoot>
133
- </div>
134
-
135
- <!-- Status Line -->
136
- <div class="flex items-center justify-between mt-1">
137
- <div class="flex items-center gap-1 flex-wrap">
138
- <span class="text-xs text-gray-500 dark:text-gray-400">Tables:</span>
139
- <template v-if="JSON.parse(bucket.tables) && JSON.parse(bucket.tables).length > 0">
140
- <template v-for="tableName in JSON.parse(bucket.tables).slice(0, 3)" :key="tableName">
141
- <NBadge n="gray xs" class="text-xs">
142
- {{ tableName }}
143
- </NBadge>
144
- </template>
145
- <TooltipRoot v-if="JSON.parse(bucket.tables).length > 3">
146
- <TooltipTrigger as-child>
147
- <NBadge n="gray xs" class="text-xs">
148
- +{{ JSON.parse(bucket.tables).length - 3 }}
149
- </NBadge>
150
- </TooltipTrigger>
151
- <TooltipContent
152
- side="bottom"
153
- class="text-xs bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700 rounded-md p-2"
154
- >
155
- All tables: {{ JSON.parse(bucket.tables).join(", ") }}
156
- </TooltipContent>
157
- </TooltipRoot>
158
- </template>
159
- <span v-else class="text-xs text-gray-500 dark:text-gray-400"> No tables </span>
160
- </div>
161
- <NBadge
162
- :n="bucket.downloading ? 'blue' : 'gray'"
163
- :icon="bucket.downloading ? 'carbon:arrow-down' : 'carbon:pause'"
164
- class="text-xs"
165
- >
166
- {{ bucket.downloading ? "Downloading" : "Idle" }}
167
- </NBadge>
168
- </div>
169
- </div>
170
- </div>
171
- </div>
172
- </div>
173
- </div>
174
- </div>
175
- </SplitterPanel>
176
-
177
- <SplitterResizeHandle
178
- id="buckets-resize-handle"
179
- class="w-[2px] bg-gray-200 hover:bg-indigo-300 dark:hover:bg-indigo-700"
180
- />
181
-
182
- <!-- Bucket Content Panel -->
183
- <SplitterPanel id="bucket-content-panel" :min-size="30" class="flex flex-col overflow-hidden">
184
- <div v-if="!selectedBucket" class="flex w-full h-full justify-center items-center">
185
- <div text="sm gray-500" flex="~ gap-2 items-center">
186
- <NIcon icon="carbon:data-base" />
187
- <span>Select a bucket to view its content</span>
188
- </div>
189
- </div>
190
-
191
- <div v-else class="flex-1 flex flex-col overflow-hidden">
192
- <!-- Bucket Header -->
193
- <div class="p-3 border-b border-gray-200 dark:border-neutral-700 bg-gray-50 dark:bg-neutral-800">
194
- <div class="flex items-center justify-between">
195
- <div class="flex items-center gap-2">
196
- <NIcon icon="carbon:data-base" class="text-blue-500" />
197
- <h3 class="font-semibold text-gray-900 dark:text-gray-100">
198
- {{ selectedBucket.name }}
199
- </h3>
200
- <NBadge n="blue xs"> {{ bucketContentRows?.length || 0 }} items </NBadge>
201
- </div>
202
-
203
- <div class="flex items-center gap-2">
204
- <NButton n="xs" icon="carbon:refresh" @click="refreshBucketContent"> Refresh </NButton>
205
- </div>
206
- </div>
207
- </div>
208
-
209
- <!-- Bucket Content Table -->
210
- <div class="flex-1 overflow-hidden">
211
- <div v-if="isLoadingContent" class="flex justify-center items-center h-full">
212
- <NLoading />
213
- </div>
214
-
215
- <div
216
- v-else-if="bucketContentError"
217
- class="p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded m-4"
218
- >
219
- <div class="text-red-800 dark:text-red-200 font-medium">Error loading bucket content:</div>
220
- <div class="text-red-700 dark:text-red-300 text-sm mt-1">
221
- {{ bucketContentError }}
222
- </div>
223
- </div>
224
-
225
- <div
226
- v-else-if="bucketContentRows && bucketContentRows.length > 0"
227
- class="flex-1 flex flex-col overflow-hidden"
228
- >
229
- <!-- Table Controls -->
230
- <div
231
- class="px-3 py-2 flex justify-between items-center bg-gray-50 dark:bg-neutral-800 border-b border-gray-200 dark:border-neutral-700 flex-shrink-0"
232
- >
233
- <div class="flex items-center gap-3">
234
- <div class="text-xs text-gray-600 dark:text-gray-400">
235
- {{ bucketContentRows.length }} row{{ bucketContentRows.length !== 1 ? "s" : "" }}
236
- </div>
237
- </div>
238
-
239
- <div class="flex items-center gap-1">
240
- <NButton
241
- n="xs"
242
- icon="carbon:chevron-left"
243
- :disabled="!table.getCanPreviousPage()"
244
- @click="table.previousPage()"
245
- />
246
-
247
- <!-- Page Jump Input -->
248
- <div class="flex items-center gap-1">
249
- <span class="text-xs text-gray-600 dark:text-gray-400">Page</span>
250
- <NTextInput
251
- v-model="currentPageInput"
252
- n="xs"
253
- class="w-12 text-center"
254
- type="number"
255
- min="1"
256
- :max="table.getPageCount()"
257
- @blur="jumpToPage"
258
- @keydown.enter="jumpToPage"
259
- />
260
- <span class="text-xs text-gray-600 dark:text-gray-400">of {{ table.getPageCount() }}</span>
261
- </div>
262
-
263
- <NButton
264
- n="xs"
265
- icon="carbon:chevron-right"
266
- :disabled="!table.getCanNextPage()"
267
- @click="table.nextPage()"
268
- />
269
- </div>
270
-
271
- <!-- Page Size Control -->
272
- <div class="flex items-center gap-1">
273
- <span class="text-xs text-gray-600 dark:text-gray-400">Show:</span>
274
- <NTextInput
275
- v-model="pageSizeInput"
276
- n="xs"
277
- class="w-16"
278
- type="number"
279
- min="1"
280
- max="1000"
281
- @blur="updatePageSize"
282
- @keydown.enter="updatePageSize"
283
- />
284
- <span class="text-xs text-gray-600 dark:text-gray-400">per page</span>
285
- </div>
286
- </div>
287
-
288
- <!-- Data Table -->
289
- <div class="flex-1 border border-gray-200 dark:border-neutral-700 rounded-b-lg overflow-auto">
290
- <table class="w-full min-w-max">
291
- <thead class="bg-gray-50 dark:bg-neutral-800 sticky top-0">
292
- <tr>
293
- <th
294
- v-for="header in table.getFlatHeaders()"
295
- :key="header.id"
296
- class="px-2 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 tracking-wider border-r border-gray-200 dark:border-neutral-700 last:border-r-0 relative overflow-hidden"
297
- :class="
298
- header.column.getCanSort() ? 'cursor-pointer hover:bg-gray-100 dark:hover:bg-neutral-700' : ''
299
- "
300
- :style="{
301
- width: `${header.getSize()}px`,
302
- maxWidth: `${header.getSize()}px`,
303
- minWidth: `${header.getSize()}px`
304
- }"
305
- @click="header.column.getToggleSortingHandler()?.($event)"
306
- >
307
- <div class="flex items-center gap-1 min-w-0">
308
- <div class="truncate flex-1 min-w-0">
309
- <FlexRender :render="header.column.columnDef.header" :props="header.getContext()" />
310
- </div>
311
- <span v-if="header.column.getIsSorted()" class="text-xs flex-shrink-0">
312
- {{ header.column.getIsSorted() === "asc" ? "\u25B2" : "\u25BC" }}
313
- </span>
314
- </div>
315
- <!-- Column Resize Handle -->
316
- <div
317
- v-if="header.column.getCanResize()"
318
- class="absolute top-0 right-0 h-full w-1 cursor-col-resize bg-transparent hover:bg-gray-500 hover:bg-opacity-50 group"
319
- @mousedown="header.getResizeHandler()?.($event)"
320
- @touchstart="header.getResizeHandler()?.($event)"
321
- @click.stop
322
- >
323
- <div class="w-full h-full group-hover:bg-gray-500 transition-colors duration-150" />
324
- </div>
325
- </th>
326
- </tr>
327
- </thead>
328
- <tbody class="bg-white dark:bg-neutral-900 border-t border-gray-200 dark:border-neutral-700">
329
- <tr
330
- v-for="row in table.getRowModel().rows"
331
- :key="row.id"
332
- class="hover:bg-gray-50 dark:hover:bg-neutral-800 border-b border-gray-200 dark:border-neutral-700"
333
- >
334
- <td
335
- v-for="cell in row.getVisibleCells()"
336
- :key="cell.id"
337
- class="px-2 py-3 text-sm text-gray-900 dark:text-gray-100 border-r border-gray-200 dark:border-neutral-700 last:border-r-0 overflow-hidden"
338
- :style="{
339
- width: `${cell.column.getSize()}px`,
340
- maxWidth: `${cell.column.getSize()}px`,
341
- minWidth: `${cell.column.getSize()}px`
342
- }"
343
- >
344
- <div class="truncate w-full" :title="String(cell.getValue())">
345
- <FlexRender :render="cell.column.columnDef.cell" :props="cell.getContext()" />
346
- </div>
347
- </td>
348
- </tr>
349
- </tbody>
350
- </table>
351
- </div>
352
- </div>
353
-
354
- <div v-else class="text-center py-8">
355
- <div class="text-gray-500 dark:text-gray-400">No content found in this bucket</div>
356
- </div>
357
- </div>
358
- </div>
359
- </SplitterPanel>
360
- </SplitterGroup>
361
- </div>
362
- </TooltipProvider>
363
- </template>
364
-
365
- <script setup>
366
- import { ref, computed, watch, onMounted } from "vue";
367
- import { usePowerSyncInspectorDiagnostics } from "#imports";
368
- import {
369
- SplitterGroup,
370
- SplitterPanel,
371
- SplitterResizeHandle,
372
- TooltipContent,
373
- TooltipProvider,
374
- TooltipRoot,
375
- TooltipTrigger
376
- } from "reka-ui";
377
- import {
378
- FlexRender,
379
- getCoreRowModel,
380
- useVueTable,
381
- getSortedRowModel,
382
- getPaginationRowModel
383
- } from "@tanstack/vue-table";
384
- import Fuse from "fuse.js";
385
- const { db, bucketRows, formatBytes } = usePowerSyncInspectorDiagnostics();
386
- const searchQuery = ref("");
387
- const selectedBucket = ref(null);
388
- const isLoading = ref(false);
389
- const fuse = ref();
390
- const bucketContentRows = ref(null);
391
- const isLoadingContent = ref(false);
392
- const bucketContentError = ref(null);
393
- const currentPageInput = ref("1");
394
- const pageSizeInput = ref("50");
395
- const initializeFuse = () => {
396
- if (!bucketRows.value) return;
397
- const fuseOptions = {
398
- keys: ["name"],
399
- threshold: 0.3,
400
- includeScore: true,
401
- includeMatches: true
402
- };
403
- fuse.value = new Fuse(bucketRows.value, fuseOptions);
404
- };
405
- const filteredBuckets = computed(() => {
406
- if (!bucketRows.value) return [];
407
- if (!searchQuery.value || !fuse.value) {
408
- return bucketRows.value;
409
- }
410
- const searchResults = fuse.value.search(searchQuery.value);
411
- return searchResults.map((result) => result.item);
412
- });
413
- const onSearchInput = () => {
414
- };
415
- const selectBucket = async (bucket) => {
416
- selectedBucket.value = bucket;
417
- await loadBucketContent(bucket);
418
- };
419
- const loadBucketContent = async (bucket) => {
420
- if (!db.value) return;
421
- isLoadingContent.value = true;
422
- bucketContentError.value = null;
423
- try {
424
- const query = `
425
- SELECT * FROM ps_oplog WHERE bucket = ?
426
- ORDER BY op_id DESC
427
- `;
428
- const result = await db.value.getAll(query, [bucket.id]);
429
- bucketContentRows.value = result;
430
- } catch (error) {
431
- bucketContentError.value = error instanceof Error ? error.message : "Unknown error occurred";
432
- bucketContentRows.value = null;
433
- } finally {
434
- isLoadingContent.value = false;
435
- }
436
- };
437
- const refreshBucketContent = async () => {
438
- if (selectedBucket.value) {
439
- await loadBucketContent(selectedBucket.value);
440
- }
441
- };
442
- const columns = computed(() => {
443
- if (!bucketContentRows.value || bucketContentRows.value.length === 0) return [];
444
- const firstRow = bucketContentRows.value[0];
445
- const dataColumns = Object.keys(firstRow);
446
- const columnsArray = [
447
- // Row number column
448
- {
449
- id: "rowNumber",
450
- header: "",
451
- cell: ({ row }) => row.index + 1,
452
- size: 60,
453
- enableSorting: false,
454
- enableResizing: false
455
- },
456
- // Data columns
457
- ...dataColumns.map((key) => ({
458
- accessorKey: key,
459
- header: key,
460
- size: 150,
461
- minSize: 20,
462
- maxSize: 800,
463
- enableResizing: true,
464
- cell: ({ getValue }) => {
465
- const value = getValue();
466
- if (value === null) return "NULL";
467
- if (value === void 0) return "UNDEFINED";
468
- if (typeof value === "object") return JSON.stringify(value);
469
- return String(value);
470
- }
471
- }))
472
- ];
473
- return columnsArray;
474
- });
475
- const table = useVueTable({
476
- get data() {
477
- return bucketContentRows.value || [];
478
- },
479
- get columns() {
480
- return columns.value;
481
- },
482
- getCoreRowModel: getCoreRowModel(),
483
- getSortedRowModel: getSortedRowModel(),
484
- getPaginationRowModel: getPaginationRowModel(),
485
- enableColumnResizing: true,
486
- columnResizeMode: "onChange",
487
- defaultColumn: {
488
- size: 150,
489
- minSize: 20,
490
- maxSize: 800
491
- },
492
- initialState: {
493
- pagination: {
494
- pageSize: 50
495
- }
496
- }
497
- });
498
- const jumpToPage = () => {
499
- const pageNumber = Number.parseInt(currentPageInput.value, 10);
500
- if (pageNumber >= 1 && pageNumber <= table.getPageCount()) {
501
- table.setPageIndex(pageNumber - 1);
502
- } else {
503
- currentPageInput.value = String(table.getState().pagination.pageIndex + 1);
504
- }
505
- };
506
- const updatePageSize = () => {
507
- const pageSize = Number.parseInt(pageSizeInput.value, 10);
508
- if (pageSize >= 1 && pageSize <= 1e3) {
509
- table.setPageSize(pageSize);
510
- } else {
511
- pageSizeInput.value = String(table.getState().pagination.pageSize);
512
- }
513
- };
514
- watch(
515
- () => table.getState().pagination.pageIndex,
516
- (newPageIndex) => {
517
- currentPageInput.value = String(newPageIndex + 1);
518
- }
519
- );
520
- watch(
521
- () => table.getState().pagination.pageSize,
522
- (newPageSize) => {
523
- pageSizeInput.value = String(newPageSize);
524
- }
525
- );
526
- watch(
527
- bucketRows,
528
- () => {
529
- if (bucketRows.value) {
530
- initializeFuse();
531
- }
532
- },
533
- { immediate: true }
534
- );
535
- onMounted(async () => {
536
- if (bucketRows.value) {
537
- initializeFuse();
538
- }
539
- });
540
- </script>
541
-
542
- <style scoped>
543
- .bucket-item{transition:all .2s ease}.bucket-item:hover{box-shadow:0 2px 4px rgba(0,0,0,.1);transform:translateY(-1px)}
544
- </style>
@@ -1,3 +0,0 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
- declare const _default: typeof __VLS_export;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
- declare const _default: typeof __VLS_export;
3
- export default _default;
@@ -1,84 +0,0 @@
1
- <template>
2
- <div border="t" border-color="gray-100" relative n-bg="base" flex="~ col">
3
- <div flex="~ col gap-2" class="h-full">
4
- <NSectionBlock icon="carbon:connection-signal" text="Connection Options">
5
- <div class="text-sm schema-code-block h-full overflow-auto" v-html="connectionOptionsHtml" />
6
- </NSectionBlock>
7
-
8
- <span border="b" border-color="gray-100" />
9
-
10
- <NSectionBlock icon="carbon:cics-db2-connection" text="Database Options">
11
- <div class="text-sm schema-code-block h-full overflow-auto" v-html="dbOptionsHtml" />
12
- </NSectionBlock>
13
-
14
- <span border="b" border-color="gray-100" />
15
-
16
- <NSectionBlock icon="carbon:prompt-template" text="Schema" class="flex-1 overflow-hidden">
17
- <div class="text-sm schema-code-block h-full overflow-auto" v-html="schemaHtml" />
18
- </NSectionBlock>
19
- </div>
20
- </div>
21
- </template>
22
-
23
- <script setup>
24
- import { usePowerSyncInspectorDiagnostics, usePowerSyncInspector } from "#imports";
25
- import { computed, onMounted } from "vue";
26
- import { codeToHtml } from "shiki";
27
- import { asyncComputed } from "@vueuse/core";
28
- const { db, connectionOptions } = usePowerSyncInspectorDiagnostics();
29
- const { getCurrentSchemaManager } = usePowerSyncInspector();
30
- const schemaManager = getCurrentSchemaManager();
31
- const currentConnectionOptions = computed(() => {
32
- const { serializedSchema: _, ...options } = connectionOptions.value;
33
- return options;
34
- });
35
- const dbOptions = computed(() => {
36
- const { logger: _, schema: __, ...dbOptions2 } = db.value.dbOptions;
37
- return dbOptions2;
38
- });
39
- const schema = computed(() => {
40
- return `/**
41
- * This is the inferred schema of the data received by the diagnostics app.
42
- * Because this schema is generated on-the-fly based on the data received by the app, it can
43
- * be incomplete and should NOT be relied upon as a source of truth for your app schema.
44
- * If a table is empty, it will not be shown here.
45
- * If a column contains only NULL values, the column will not be shown here.
46
- * Tables and columns are only added here. Nothing is removed until the database is cleared.
47
- */
48
- ${schemaManager.schemaToString()}`;
49
- });
50
- const connectionOptionsHtml = asyncComputed(
51
- async () => await codeToHtml(JSON.stringify(currentConnectionOptions.value, null, 2), {
52
- lang: "json",
53
- themes: {
54
- light: "min-light",
55
- dark: "min-dark"
56
- }
57
- })
58
- );
59
- const dbOptionsHtml = asyncComputed(
60
- async () => await codeToHtml(JSON.stringify(dbOptions.value, null, 2), {
61
- lang: "json",
62
- themes: {
63
- light: "min-light",
64
- dark: "min-dark"
65
- }
66
- })
67
- );
68
- const schemaHtml = asyncComputed(
69
- async () => await codeToHtml(schema.value, {
70
- lang: "typescript",
71
- themes: {
72
- light: "min-light",
73
- dark: "min-dark"
74
- }
75
- })
76
- );
77
- onMounted(async () => {
78
- await db.value?.waitForFirstSync();
79
- });
80
- </script>
81
-
82
- <style>
83
- .schema-code-block{font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:12px;line-height:1.4}.schema-code-block pre{background:transparent!important;height:100%;overflow:visible}.schema-code-block code,.schema-code-block pre{font-family:inherit;font-size:inherit;line-height:inherit;margin:0;padding:0}.schema-code-block code{counter-increment:step 0;counter-reset:step;display:block}.schema-code-block code .line:before{color:rgba(115,138,148,.4);content:counter(step);counter-increment:step;display:inline-block;margin-right:1.5rem;text-align:right;width:1rem}.dark .schema-code-block code .line:before{color:#858080}
84
- </style>
@@ -1,3 +0,0 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
- declare const _default: typeof __VLS_export;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
- declare const _default: typeof __VLS_export;
3
- export default _default;