@powersync/nuxt 0.0.0-dev-20260128023420 → 0.0.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/{README → README.md} +46 -30
- package/dist/module.d.mts +2 -2
- package/dist/module.json +2 -2
- package/dist/module.mjs +22 -24
- package/dist/runtime/components/BucketsInspectorTab.d.vue.ts +1 -1
- package/dist/runtime/components/BucketsInspectorTab.vue +47 -149
- package/dist/runtime/components/BucketsInspectorTab.vue.d.ts +1 -1
- package/dist/runtime/components/ConfigInspectorTab.d.vue.ts +1 -1
- package/dist/runtime/components/ConfigInspectorTab.vue +11 -48
- package/dist/runtime/components/ConfigInspectorTab.vue.d.ts +1 -1
- package/dist/runtime/components/DataInspectorTab.d.vue.ts +1 -1
- package/dist/runtime/components/DataInspectorTab.vue +35 -149
- package/dist/runtime/components/DataInspectorTab.vue.d.ts +1 -1
- package/dist/runtime/components/LoadingSpinner.d.vue.ts +1 -1
- package/dist/runtime/components/LoadingSpinner.vue.d.ts +1 -1
- package/dist/runtime/components/LogsTab.d.vue.ts +1 -1
- package/dist/runtime/components/LogsTab.vue +42 -94
- package/dist/runtime/components/LogsTab.vue.d.ts +1 -1
- package/dist/runtime/components/PowerSyncInstanceTab.d.vue.ts +1 -1
- package/dist/runtime/components/PowerSyncInstanceTab.vue +1 -3
- package/dist/runtime/components/PowerSyncInstanceTab.vue.d.ts +1 -1
- package/dist/runtime/components/SyncStatusTab.d.vue.ts +1 -1
- package/dist/runtime/components/SyncStatusTab.vue +57 -168
- package/dist/runtime/components/SyncStatusTab.vue.d.ts +1 -1
- package/dist/runtime/composables/useDiagnosticsLogger.d.ts +1 -1
- package/dist/runtime/composables/useDiagnosticsLogger.js +16 -24
- package/dist/runtime/composables/usePowerSyncInspectorDiagnostics.js +13 -53
- package/dist/runtime/index.d.ts +3 -3
- package/dist/runtime/layouts/powersync-inspector-layout.d.vue.ts +1 -1
- package/dist/runtime/layouts/powersync-inspector-layout.vue +9 -36
- package/dist/runtime/layouts/powersync-inspector-layout.vue.d.ts +1 -1
- package/dist/runtime/pages/__powersync-inspector.d.vue.ts +1 -1
- package/dist/runtime/pages/__powersync-inspector.vue +8 -42
- package/dist/runtime/pages/__powersync-inspector.vue.d.ts +1 -1
- package/dist/runtime/utils/DynamicSchemaManager.js +3 -10
- package/dist/runtime/utils/RecordingStorageAdapter.js +4 -22
- package/dist/runtime/utils/TokenConnector.js +2 -7
- package/package.json +12 -10
package/{README → README.md}
RENAMED
|
@@ -23,23 +23,25 @@ PowerSync Nuxt module integrated with the [Nuxt Devtools](https://github.com/nux
|
|
|
23
23
|
|
|
24
24
|
## Installation
|
|
25
25
|
|
|
26
|
-
This module
|
|
26
|
+
This module re-exports all `@powersync/vue` composables. With **npm** (v7+), installing `@powersync/nuxt` is enough; with **pnpm**, install peer dependencies explicitly.
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
# Using pnpm
|
|
30
|
-
pnpm add -D @powersync/nuxt vite-plugin-top-level-await vite-plugin-wasm
|
|
31
|
-
|
|
32
|
-
# Using yarn
|
|
33
|
-
yarn add --dev @powersync/nuxt vite-plugin-top-level-await vite-plugin-wasm
|
|
34
|
-
|
|
35
29
|
# Using npm
|
|
36
|
-
npm install
|
|
30
|
+
npm install @powersync/nuxt
|
|
31
|
+
npm install --save-dev vite-plugin-top-level-await vite-plugin-wasm
|
|
32
|
+
|
|
33
|
+
# Using pnpm (peer deps are not auto-installed)
|
|
34
|
+
pnpm add @powersync/nuxt @powersync/vue @powersync/web
|
|
35
|
+
pnpm add -D vite-plugin-top-level-await vite-plugin-wasm
|
|
37
36
|
```
|
|
37
|
+
|
|
38
38
|
> [!NOTE]
|
|
39
39
|
> This module works with `Nuxt 4` and should work with `Nuxt 3` but has not been tested. Support for Nuxt 2 is not guaranteed or planned.
|
|
40
40
|
|
|
41
41
|
## Quick Start
|
|
42
42
|
|
|
43
|
+
For a complete working app, see the [Nuxt + Supabase Todo List demo](https://github.com/powersync-ja/powersync-js/tree/main/demos/nuxt-supabase-todolist). To set up from scratch:
|
|
44
|
+
|
|
43
45
|
1. Add `@powersync/nuxt` to the `modules` section of `nuxt.config.ts`:
|
|
44
46
|
|
|
45
47
|
```typescript
|
|
@@ -207,7 +209,35 @@ export default defineNuxtPlugin({
|
|
|
207
209
|
|
|
208
210
|
### Kysely ORM (Optional)
|
|
209
211
|
|
|
210
|
-
You can use Kysely as your ORM to interact with the database. The module provides a `usePowerSyncKysely()` composable
|
|
212
|
+
You can use Kysely as your ORM to interact with the database. The module optionally provides a `usePowerSyncKysely()` composable. To keep the bundle small, you must install the driver yourself and enable it in config.
|
|
213
|
+
|
|
214
|
+
Install the driver:
|
|
215
|
+
|
|
216
|
+
```
|
|
217
|
+
pnpm add @powersync/kysely-driver
|
|
218
|
+
```
|
|
219
|
+
In your existing `nuxt.config.ts`, set:
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
export default defineNuxtConfig({
|
|
223
|
+
modules: ['@powersync/nuxt'],
|
|
224
|
+
powersync: {
|
|
225
|
+
kysely: true // <- opt-in
|
|
226
|
+
},
|
|
227
|
+
vite: {
|
|
228
|
+
optimizeDeps: {
|
|
229
|
+
exclude: ['@journeyapps/wa-sqlite', '@powersync/web'],
|
|
230
|
+
include: ['@powersync/web > js-logger'],
|
|
231
|
+
},
|
|
232
|
+
worker: {
|
|
233
|
+
format: 'es',
|
|
234
|
+
plugins: () => [wasm()],
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
})
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
When enabled, the module exposes `usePowerSyncKysely`. Use your schema’s `Database` type to get proper typings:
|
|
211
241
|
|
|
212
242
|
```typescript
|
|
213
243
|
import { usePowerSyncKysely } from '@powersync/nuxt'
|
|
@@ -256,8 +286,8 @@ When `useDiagnostics: true` is set, `NuxtPowerSyncDatabase` automatically:
|
|
|
256
286
|
|
|
257
287
|
Once diagnostics are enabled, you can access the [PowerSync Inspector](#powersync-inspector):
|
|
258
288
|
|
|
289
|
+
- **Via Nuxt Devtools**: Open Devtools and look for the PowerSync tab
|
|
259
290
|
- **Direct URL**: `http://localhost:3000/__powersync-inspector`
|
|
260
|
-
- **Via Nuxt Devtools**: Open Devtools and look for the PowerSync tab (Instable until proper multitab support for diagnostics in implemented)
|
|
261
291
|
|
|
262
292
|
|
|
263
293
|
|
|
@@ -265,6 +295,10 @@ Once diagnostics are enabled, you can access the [PowerSync Inspector](#powersyn
|
|
|
265
295
|
|
|
266
296
|
PowerSync Inspector is a tool that helps inspect and diagnose the state of your PowerSync client directly from your app in real-time.
|
|
267
297
|
|
|
298
|
+
<div align="center">
|
|
299
|
+
<img src="./img/inspector.png" alt="PowerSync Logo" />
|
|
300
|
+
</div>
|
|
301
|
+
|
|
268
302
|
### Setup
|
|
269
303
|
|
|
270
304
|
To setup the PowerSync inspector, you need to follow the steps in the [Enabling Diagnostics](#enabling-diagnostics) section.
|
|
@@ -297,34 +331,16 @@ Real-time logging of PowerSync operations with syntax highlighting and search fu
|
|
|
297
331
|
|
|
298
332
|
The inspector is also available in the Nuxt Devtools as a tab, providing seamless integration with your development workflow.
|
|
299
333
|
|
|
300
|
-
> [!WARNING]
|
|
301
|
-
> Multitab support is still not fully supported when diagnostics are enabled which causes the inspector to malfunction in the devtool. see [Known Issues section](#known-issues)
|
|
302
|
-
|
|
303
334
|
## Known Issues
|
|
304
335
|
|
|
305
|
-
1.
|
|
306
|
-
|
|
307
|
-
2. PowerSync Inspector relies on `unocss` as a transitive dependency. It might clash with your existing setup, for example if you use Tailwind CSS.
|
|
336
|
+
1. PowerSync Inspector relies on `unocss` as a transitive dependency. It might clash with your existing setup, for example if you use Tailwind CSS.
|
|
308
337
|
|
|
309
338
|
To fix this, you can add the following to your `nuxt.config.ts`:
|
|
310
339
|
|
|
311
340
|
```typescript
|
|
312
341
|
export default defineNuxtConfig({
|
|
313
342
|
unocss: {
|
|
314
|
-
|
|
315
|
-
blocklist: [/\$\{.*\}/],
|
|
316
|
-
content: {
|
|
317
|
-
pipeline: {
|
|
318
|
-
exclude: [
|
|
319
|
-
'./layouts/*/**',
|
|
320
|
-
'./pages/*/**',
|
|
321
|
-
'./components/*/**',
|
|
322
|
-
'./composables/*/**',
|
|
323
|
-
'./utils/*/**',
|
|
324
|
-
'./types/*/**',
|
|
325
|
-
],
|
|
326
|
-
},
|
|
327
|
-
},
|
|
343
|
+
autoImport: false
|
|
328
344
|
},
|
|
329
345
|
})
|
|
330
346
|
```
|
package/dist/module.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as nuxt_schema from 'nuxt/schema';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Configuration options for the PowerSync Nuxt module.
|
|
@@ -33,7 +33,7 @@ interface PowerSyncNuxtModuleOptions {
|
|
|
33
33
|
*/
|
|
34
34
|
kysely?: boolean;
|
|
35
35
|
}
|
|
36
|
-
declare const _default:
|
|
36
|
+
declare const _default: nuxt_schema.NuxtModule<PowerSyncNuxtModuleOptions, PowerSyncNuxtModuleOptions, false>;
|
|
37
37
|
|
|
38
38
|
export { _default as default };
|
|
39
39
|
export type { PowerSyncNuxtModuleOptions };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, findPath,
|
|
1
|
+
import { defineNuxtModule, createResolver, findPath, addPlugin, addImports, addComponentsDir, addLayout, extendPages } from '@nuxt/kit';
|
|
2
2
|
import { defu } from 'defu';
|
|
3
3
|
import { addImportsFrom } from '../dist/runtime/utils/addImportsFrom.js';
|
|
4
4
|
|
|
@@ -34,6 +34,10 @@ const module$1 = defineNuxtModule({
|
|
|
34
34
|
useDiagnostics: false,
|
|
35
35
|
kysely: false
|
|
36
36
|
},
|
|
37
|
+
moduleDependencies: {
|
|
38
|
+
"@nuxt/devtools-ui-kit": {},
|
|
39
|
+
"@vueuse/nuxt": {}
|
|
40
|
+
},
|
|
37
41
|
async setup(options, nuxt) {
|
|
38
42
|
const resolver = createResolver(import.meta.url);
|
|
39
43
|
nuxt.options.runtimeConfig.public.powerSyncModuleOptions = defu(
|
|
@@ -51,14 +55,10 @@ const module$1 = defineNuxtModule({
|
|
|
51
55
|
);
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
|
-
await installModule("@nuxt/devtools-ui-kit");
|
|
55
|
-
await installModule("@vueuse/nuxt");
|
|
56
58
|
addPlugin(resolver.resolve("./runtime/plugin.client"));
|
|
57
59
|
addImports({
|
|
58
60
|
name: "NuxtPowerSyncDatabase",
|
|
59
|
-
from: resolver.resolve(
|
|
60
|
-
"./runtime/utils/NuxtPowerSyncDatabase"
|
|
61
|
-
)
|
|
61
|
+
from: resolver.resolve("./runtime/utils/NuxtPowerSyncDatabase")
|
|
62
62
|
});
|
|
63
63
|
addImports({
|
|
64
64
|
name: "usePowerSyncInspector",
|
|
@@ -66,9 +66,7 @@ const module$1 = defineNuxtModule({
|
|
|
66
66
|
});
|
|
67
67
|
addImports({
|
|
68
68
|
name: "usePowerSyncInspectorDiagnostics",
|
|
69
|
-
from: resolver.resolve(
|
|
70
|
-
"./runtime/composables/usePowerSyncInspectorDiagnostics"
|
|
71
|
-
)
|
|
69
|
+
from: resolver.resolve("./runtime/composables/usePowerSyncInspectorDiagnostics")
|
|
72
70
|
});
|
|
73
71
|
if (options.kysely) {
|
|
74
72
|
addImports({
|
|
@@ -83,10 +81,7 @@ const module$1 = defineNuxtModule({
|
|
|
83
81
|
addComponentsDir({
|
|
84
82
|
path: resolver.resolve("runtime/components")
|
|
85
83
|
});
|
|
86
|
-
addLayout(
|
|
87
|
-
resolver.resolve("./runtime/layouts/powersync-inspector-layout.vue"),
|
|
88
|
-
"powersync-inspector-layout"
|
|
89
|
-
);
|
|
84
|
+
addLayout(resolver.resolve("./runtime/layouts/powersync-inspector-layout.vue"), "powersync-inspector-layout");
|
|
90
85
|
extendPages((pages) => {
|
|
91
86
|
pages.push({
|
|
92
87
|
path: "/__powersync-inspector",
|
|
@@ -95,17 +90,20 @@ const module$1 = defineNuxtModule({
|
|
|
95
90
|
name: "Powersync Inspector"
|
|
96
91
|
});
|
|
97
92
|
});
|
|
98
|
-
addImportsFrom(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
93
|
+
addImportsFrom(
|
|
94
|
+
[
|
|
95
|
+
"createPowerSyncPlugin",
|
|
96
|
+
"providePowerSync",
|
|
97
|
+
"usePowerSync",
|
|
98
|
+
"usePowerSyncQuery",
|
|
99
|
+
"usePowerSyncStatus",
|
|
100
|
+
"usePowerSyncWatchedQuery",
|
|
101
|
+
"useQuery",
|
|
102
|
+
"useStatus",
|
|
103
|
+
"useWatchedQuerySubscription"
|
|
104
|
+
],
|
|
105
|
+
"@powersync/vue"
|
|
106
|
+
);
|
|
109
107
|
nuxt.options.build.transpile = nuxt.options.build.transpile || [];
|
|
110
108
|
nuxt.options.build.transpile.push("reka-ui", "@tanstack/vue-table", "@powersync/web", "@journeyapps/wa-sqlite");
|
|
111
109
|
if (options.kysely) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
2
2
|
declare const _default: typeof __VLS_export;
|
|
3
3
|
export default _default;
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<TooltipProvider :delay-duration="100">
|
|
3
|
-
<div
|
|
4
|
-
|
|
5
|
-
border-color="gray-100"
|
|
6
|
-
relative
|
|
7
|
-
n-bg="base"
|
|
8
|
-
flex="~ col"
|
|
9
|
-
h="screen"
|
|
10
|
-
overflow="hidden"
|
|
11
|
-
>
|
|
12
|
-
<SplitterGroup
|
|
13
|
-
id="buckets-splitter-group"
|
|
14
|
-
class="h-full"
|
|
15
|
-
direction="horizontal"
|
|
16
|
-
>
|
|
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">
|
|
17
5
|
<!-- Buckets List Panel -->
|
|
18
6
|
<SplitterPanel
|
|
19
7
|
id="buckets-list-panel"
|
|
@@ -25,9 +13,7 @@
|
|
|
25
13
|
<!-- Header -->
|
|
26
14
|
<div class="p-3 border-b border-gray-200 dark:border-neutral-700">
|
|
27
15
|
<div class="flex items-center justify-between mb-2">
|
|
28
|
-
<h2 class="text-lg font-semibold text-gray-900 dark:text-gray-100">
|
|
29
|
-
Buckets
|
|
30
|
-
</h2>
|
|
16
|
+
<h2 class="text-lg font-semibold text-gray-900 dark:text-gray-100">Buckets</h2>
|
|
31
17
|
<NBadge n="slate xs">
|
|
32
18
|
{{ filteredBuckets.length }}
|
|
33
19
|
</NBadge>
|
|
@@ -51,25 +37,16 @@
|
|
|
51
37
|
class="flex-1 flex items-center justify-center text-gray-500 dark:text-gray-400 text-sm mt-3"
|
|
52
38
|
>
|
|
53
39
|
<div class="text-center">
|
|
54
|
-
<NIcon
|
|
55
|
-
icon="carbon:data-error"
|
|
56
|
-
class="text-2xl mb-2"
|
|
57
|
-
/>
|
|
40
|
+
<NIcon icon="carbon:data-error" class="text-2xl mb-2" />
|
|
58
41
|
<div>No buckets found</div>
|
|
59
42
|
</div>
|
|
60
43
|
</div>
|
|
61
44
|
|
|
62
|
-
<div
|
|
63
|
-
v-else-if="isLoading"
|
|
64
|
-
class="flex-1 flex items-center justify-center"
|
|
65
|
-
>
|
|
45
|
+
<div v-else-if="isLoading" class="flex-1 flex items-center justify-center">
|
|
66
46
|
<NLoading />
|
|
67
47
|
</div>
|
|
68
48
|
|
|
69
|
-
<div
|
|
70
|
-
v-else
|
|
71
|
-
class="p-2 space-y-1"
|
|
72
|
-
>
|
|
49
|
+
<div v-else class="p-2 space-y-1">
|
|
73
50
|
<div
|
|
74
51
|
v-for="bucket in filteredBuckets"
|
|
75
52
|
:key="bucket.name"
|
|
@@ -82,10 +59,7 @@
|
|
|
82
59
|
<div class="flex items-start justify-between">
|
|
83
60
|
<div class="flex-1 min-w-0 flex flex-col gap-1">
|
|
84
61
|
<div class="flex items-center gap-2 mb-1">
|
|
85
|
-
<NIcon
|
|
86
|
-
icon="carbon:db2-database"
|
|
87
|
-
class="text-blue-500 flex-shrink-0"
|
|
88
|
-
/>
|
|
62
|
+
<NIcon icon="carbon:db2-database" class="text-blue-500 flex-shrink-0" />
|
|
89
63
|
<span class="font-medium text-gray-900 dark:text-gray-100 truncate">
|
|
90
64
|
{{ bucket.name }}
|
|
91
65
|
</span>
|
|
@@ -97,10 +71,7 @@
|
|
|
97
71
|
<TooltipRoot>
|
|
98
72
|
<TooltipTrigger as-child>
|
|
99
73
|
<div class="flex items-center gap-1">
|
|
100
|
-
<NIcon
|
|
101
|
-
icon="carbon:data-volume"
|
|
102
|
-
class="text-xs"
|
|
103
|
-
/>
|
|
74
|
+
<NIcon icon="carbon:data-volume" class="text-xs" />
|
|
104
75
|
<span>{{ formatBytes(bucket.data_size || 0) }}</span>
|
|
105
76
|
</div>
|
|
106
77
|
</TooltipTrigger>
|
|
@@ -116,10 +87,7 @@
|
|
|
116
87
|
<TooltipRoot>
|
|
117
88
|
<TooltipTrigger as-child>
|
|
118
89
|
<div class="flex items-center gap-1">
|
|
119
|
-
<NIcon
|
|
120
|
-
icon="carbon:data-2"
|
|
121
|
-
class="text-xs"
|
|
122
|
-
/>
|
|
90
|
+
<NIcon icon="carbon:data-2" class="text-xs" />
|
|
123
91
|
<span>{{ bucket.row_count || 0 }} rows</span>
|
|
124
92
|
</div>
|
|
125
93
|
</TooltipTrigger>
|
|
@@ -135,10 +103,7 @@
|
|
|
135
103
|
<TooltipRoot>
|
|
136
104
|
<TooltipTrigger as-child>
|
|
137
105
|
<div class="flex items-center gap-1">
|
|
138
|
-
<NIcon
|
|
139
|
-
icon="carbon:array-objects"
|
|
140
|
-
class="text-xs"
|
|
141
|
-
/>
|
|
106
|
+
<NIcon icon="carbon:array-objects" class="text-xs" />
|
|
142
107
|
<span>{{ formatBytes(bucket.metadata_size || 0) }}</span>
|
|
143
108
|
</div>
|
|
144
109
|
</TooltipTrigger>
|
|
@@ -154,10 +119,7 @@
|
|
|
154
119
|
<TooltipRoot>
|
|
155
120
|
<TooltipTrigger as-child>
|
|
156
121
|
<div class="flex items-center gap-1">
|
|
157
|
-
<NIcon
|
|
158
|
-
icon="carbon:download"
|
|
159
|
-
class="text-xs"
|
|
160
|
-
/>
|
|
122
|
+
<NIcon icon="carbon:download" class="text-xs" />
|
|
161
123
|
<span>{{ formatBytes(bucket.download_size || 0) }}</span>
|
|
162
124
|
</div>
|
|
163
125
|
</TooltipTrigger>
|
|
@@ -175,23 +137,14 @@
|
|
|
175
137
|
<div class="flex items-center gap-1 flex-wrap">
|
|
176
138
|
<span class="text-xs text-gray-500 dark:text-gray-400">Tables:</span>
|
|
177
139
|
<template v-if="JSON.parse(bucket.tables) && JSON.parse(bucket.tables).length > 0">
|
|
178
|
-
<template
|
|
179
|
-
|
|
180
|
-
:key="tableName"
|
|
181
|
-
>
|
|
182
|
-
<NBadge
|
|
183
|
-
n="gray xs"
|
|
184
|
-
class="text-xs"
|
|
185
|
-
>
|
|
140
|
+
<template v-for="tableName in JSON.parse(bucket.tables).slice(0, 3)" :key="tableName">
|
|
141
|
+
<NBadge n="gray xs" class="text-xs">
|
|
186
142
|
{{ tableName }}
|
|
187
143
|
</NBadge>
|
|
188
144
|
</template>
|
|
189
145
|
<TooltipRoot v-if="JSON.parse(bucket.tables).length > 3">
|
|
190
146
|
<TooltipTrigger as-child>
|
|
191
|
-
<NBadge
|
|
192
|
-
n="gray xs"
|
|
193
|
-
class="text-xs"
|
|
194
|
-
>
|
|
147
|
+
<NBadge n="gray xs" class="text-xs">
|
|
195
148
|
+{{ JSON.parse(bucket.tables).length - 3 }}
|
|
196
149
|
</NBadge>
|
|
197
150
|
</TooltipTrigger>
|
|
@@ -203,12 +156,7 @@
|
|
|
203
156
|
</TooltipContent>
|
|
204
157
|
</TooltipRoot>
|
|
205
158
|
</template>
|
|
206
|
-
<span
|
|
207
|
-
v-else
|
|
208
|
-
class="text-xs text-gray-500 dark:text-gray-400"
|
|
209
|
-
>
|
|
210
|
-
No tables
|
|
211
|
-
</span>
|
|
159
|
+
<span v-else class="text-xs text-gray-500 dark:text-gray-400"> No tables </span>
|
|
212
160
|
</div>
|
|
213
161
|
<NBadge
|
|
214
162
|
:n="bucket.downloading ? 'blue' : 'gray'"
|
|
@@ -232,62 +180,35 @@
|
|
|
232
180
|
/>
|
|
233
181
|
|
|
234
182
|
<!-- Bucket Content Panel -->
|
|
235
|
-
<SplitterPanel
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
class="flex flex-col overflow-hidden"
|
|
239
|
-
>
|
|
240
|
-
<div
|
|
241
|
-
v-if="!selectedBucket"
|
|
242
|
-
class="flex w-full h-full justify-center items-center"
|
|
243
|
-
>
|
|
244
|
-
<div
|
|
245
|
-
text="sm gray-500"
|
|
246
|
-
flex="~ gap-2 items-center"
|
|
247
|
-
>
|
|
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">
|
|
248
186
|
<NIcon icon="carbon:data-base" />
|
|
249
187
|
<span>Select a bucket to view its content</span>
|
|
250
188
|
</div>
|
|
251
189
|
</div>
|
|
252
190
|
|
|
253
|
-
<div
|
|
254
|
-
v-else
|
|
255
|
-
class="flex-1 flex flex-col overflow-hidden"
|
|
256
|
-
>
|
|
191
|
+
<div v-else class="flex-1 flex flex-col overflow-hidden">
|
|
257
192
|
<!-- Bucket Header -->
|
|
258
193
|
<div class="p-3 border-b border-gray-200 dark:border-neutral-700 bg-gray-50 dark:bg-neutral-800">
|
|
259
194
|
<div class="flex items-center justify-between">
|
|
260
195
|
<div class="flex items-center gap-2">
|
|
261
|
-
<NIcon
|
|
262
|
-
icon="carbon:data-base"
|
|
263
|
-
class="text-blue-500"
|
|
264
|
-
/>
|
|
196
|
+
<NIcon icon="carbon:data-base" class="text-blue-500" />
|
|
265
197
|
<h3 class="font-semibold text-gray-900 dark:text-gray-100">
|
|
266
198
|
{{ selectedBucket.name }}
|
|
267
199
|
</h3>
|
|
268
|
-
<NBadge n="blue xs">
|
|
269
|
-
{{ bucketContentRows?.length || 0 }} items
|
|
270
|
-
</NBadge>
|
|
200
|
+
<NBadge n="blue xs"> {{ bucketContentRows?.length || 0 }} items </NBadge>
|
|
271
201
|
</div>
|
|
272
202
|
|
|
273
203
|
<div class="flex items-center gap-2">
|
|
274
|
-
<NButton
|
|
275
|
-
n="xs"
|
|
276
|
-
icon="carbon:refresh"
|
|
277
|
-
@click="refreshBucketContent"
|
|
278
|
-
>
|
|
279
|
-
Refresh
|
|
280
|
-
</NButton>
|
|
204
|
+
<NButton n="xs" icon="carbon:refresh" @click="refreshBucketContent"> Refresh </NButton>
|
|
281
205
|
</div>
|
|
282
206
|
</div>
|
|
283
207
|
</div>
|
|
284
208
|
|
|
285
209
|
<!-- Bucket Content Table -->
|
|
286
210
|
<div class="flex-1 overflow-hidden">
|
|
287
|
-
<div
|
|
288
|
-
v-if="isLoadingContent"
|
|
289
|
-
class="flex justify-center items-center h-full"
|
|
290
|
-
>
|
|
211
|
+
<div v-if="isLoadingContent" class="flex justify-center items-center h-full">
|
|
291
212
|
<NLoading />
|
|
292
213
|
</div>
|
|
293
214
|
|
|
@@ -295,9 +216,7 @@
|
|
|
295
216
|
v-else-if="bucketContentError"
|
|
296
217
|
class="p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded m-4"
|
|
297
218
|
>
|
|
298
|
-
<div class="text-red-800 dark:text-red-200 font-medium">
|
|
299
|
-
Error loading bucket content:
|
|
300
|
-
</div>
|
|
219
|
+
<div class="text-red-800 dark:text-red-200 font-medium">Error loading bucket content:</div>
|
|
301
220
|
<div class="text-red-700 dark:text-red-300 text-sm mt-1">
|
|
302
221
|
{{ bucketContentError }}
|
|
303
222
|
</div>
|
|
@@ -308,12 +227,12 @@
|
|
|
308
227
|
class="flex-1 flex flex-col overflow-hidden"
|
|
309
228
|
>
|
|
310
229
|
<!-- Table Controls -->
|
|
311
|
-
<div
|
|
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
|
+
>
|
|
312
233
|
<div class="flex items-center gap-3">
|
|
313
234
|
<div class="text-xs text-gray-600 dark:text-gray-400">
|
|
314
|
-
{{ bucketContentRows.length }} row{{
|
|
315
|
-
bucketContentRows.length !== 1 ? "s" : ""
|
|
316
|
-
}}
|
|
235
|
+
{{ bucketContentRows.length }} row{{ bucketContentRows.length !== 1 ? "s" : "" }}
|
|
317
236
|
</div>
|
|
318
237
|
</div>
|
|
319
238
|
|
|
@@ -383,24 +302,14 @@
|
|
|
383
302
|
maxWidth: `${header.getSize()}px`,
|
|
384
303
|
minWidth: `${header.getSize()}px`
|
|
385
304
|
}"
|
|
386
|
-
@click="
|
|
387
|
-
header.column.getToggleSortingHandler()?.($event)
|
|
388
|
-
"
|
|
305
|
+
@click="header.column.getToggleSortingHandler()?.($event)"
|
|
389
306
|
>
|
|
390
307
|
<div class="flex items-center gap-1 min-w-0">
|
|
391
308
|
<div class="truncate flex-1 min-w-0">
|
|
392
|
-
<FlexRender
|
|
393
|
-
:render="header.column.columnDef.header"
|
|
394
|
-
:props="header.getContext()"
|
|
395
|
-
/>
|
|
309
|
+
<FlexRender :render="header.column.columnDef.header" :props="header.getContext()" />
|
|
396
310
|
</div>
|
|
397
|
-
<span
|
|
398
|
-
|
|
399
|
-
class="text-xs flex-shrink-0"
|
|
400
|
-
>
|
|
401
|
-
{{
|
|
402
|
-
header.column.getIsSorted() === "asc" ? "\u25B2" : "\u25BC"
|
|
403
|
-
}}
|
|
311
|
+
<span v-if="header.column.getIsSorted()" class="text-xs flex-shrink-0">
|
|
312
|
+
{{ header.column.getIsSorted() === "asc" ? "\u25B2" : "\u25BC" }}
|
|
404
313
|
</span>
|
|
405
314
|
</div>
|
|
406
315
|
<!-- Column Resize Handle -->
|
|
@@ -411,16 +320,12 @@
|
|
|
411
320
|
@touchstart="header.getResizeHandler()?.($event)"
|
|
412
321
|
@click.stop
|
|
413
322
|
>
|
|
414
|
-
<div
|
|
415
|
-
class="w-full h-full group-hover:bg-gray-500 transition-colors duration-150"
|
|
416
|
-
/>
|
|
323
|
+
<div class="w-full h-full group-hover:bg-gray-500 transition-colors duration-150" />
|
|
417
324
|
</div>
|
|
418
325
|
</th>
|
|
419
326
|
</tr>
|
|
420
327
|
</thead>
|
|
421
|
-
<tbody
|
|
422
|
-
class="bg-white dark:bg-neutral-900 border-t border-gray-200 dark:border-neutral-700"
|
|
423
|
-
>
|
|
328
|
+
<tbody class="bg-white dark:bg-neutral-900 border-t border-gray-200 dark:border-neutral-700">
|
|
424
329
|
<tr
|
|
425
330
|
v-for="row in table.getRowModel().rows"
|
|
426
331
|
:key="row.id"
|
|
@@ -436,14 +341,8 @@
|
|
|
436
341
|
minWidth: `${cell.column.getSize()}px`
|
|
437
342
|
}"
|
|
438
343
|
>
|
|
439
|
-
<div
|
|
440
|
-
|
|
441
|
-
:title="String(cell.getValue())"
|
|
442
|
-
>
|
|
443
|
-
<FlexRender
|
|
444
|
-
:render="cell.column.columnDef.cell"
|
|
445
|
-
:props="cell.getContext()"
|
|
446
|
-
/>
|
|
344
|
+
<div class="truncate w-full" :title="String(cell.getValue())">
|
|
345
|
+
<FlexRender :render="cell.column.columnDef.cell" :props="cell.getContext()" />
|
|
447
346
|
</div>
|
|
448
347
|
</td>
|
|
449
348
|
</tr>
|
|
@@ -452,13 +351,8 @@
|
|
|
452
351
|
</div>
|
|
453
352
|
</div>
|
|
454
353
|
|
|
455
|
-
<div
|
|
456
|
-
|
|
457
|
-
class="text-center py-8"
|
|
458
|
-
>
|
|
459
|
-
<div class="text-gray-500 dark:text-gray-400">
|
|
460
|
-
No content found in this bucket
|
|
461
|
-
</div>
|
|
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>
|
|
462
356
|
</div>
|
|
463
357
|
</div>
|
|
464
358
|
</div>
|
|
@@ -629,11 +523,15 @@ watch(
|
|
|
629
523
|
pageSizeInput.value = String(newPageSize);
|
|
630
524
|
}
|
|
631
525
|
);
|
|
632
|
-
watch(
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
526
|
+
watch(
|
|
527
|
+
bucketRows,
|
|
528
|
+
() => {
|
|
529
|
+
if (bucketRows.value) {
|
|
530
|
+
initializeFuse();
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
{ immediate: true }
|
|
534
|
+
);
|
|
637
535
|
onMounted(async () => {
|
|
638
536
|
if (bucketRows.value) {
|
|
639
537
|
initializeFuse();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
2
2
|
declare const _default: typeof __VLS_export;
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
2
2
|
declare const _default: typeof __VLS_export;
|
|
3
3
|
export default _default;
|