admindb 2.3.1 → 2.4.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.
@@ -33,7 +33,7 @@
33
33
  </div>
34
34
  </div>
35
35
  <div id="table-cards-list" class="p-3 sm:p-4 space-y-2 max-h-[480px] overflow-y-auto">
36
- {{#each tables}}
36
+ {{#each (or seedTables tables)}}
37
37
  <label class="table-option-card block cursor-pointer select-none rounded-xl border p-3 transition-all {{#if (eq this.name ../defaultTable)}}border-primary bg-primary/[0.04] shadow-sm{{else}}border-base-200 bg-base-100 hover:border-base-300 hover:bg-base-200/40{{/if}}"
38
38
  data-table="{{this.name}}">
39
39
  <div class="flex items-center justify-between gap-3">
@@ -140,11 +140,11 @@
140
140
  <p class="text-sm font-medium text-base-content/70">No tables available in the database</p>
141
141
  <p class="text-xs text-base-content/50 mt-1 max-w-sm">Create a table using the visual designer or run SQL migrations before generating seed data.</p>
142
142
  <div class="mt-4 flex gap-2">
143
- <a href="{{basePath}}/designer" class="btn btn-primary btn-sm gap-1.5">
143
+ <a href="{{basePath}}/designer/{{encodeUri dbId}}" class="btn btn-primary btn-sm gap-1.5">
144
144
  {{{icon "plus" class="h-4 w-4"}}}
145
145
  Create table
146
146
  </a>
147
- <a href="{{basePath}}/query" class="btn btn-outline btn-sm gap-1.5">
147
+ <a href="{{basePath}}/query/{{encodeUri dbId}}" class="btn btn-outline btn-sm gap-1.5">
148
148
  {{{icon "query" class="h-4 w-4"}}}
149
149
  Query editor
150
150
  </a>
@@ -155,6 +155,7 @@
155
155
  <script>
156
156
  document.addEventListener('DOMContentLoaded', () => {
157
157
  const BASE = '{{basePath}}';
158
+ const DB_ID = '{{dbId}}';
158
159
  let selectedTable = '{{defaultTable}}';
159
160
  let selectedMode = '{{defaultMode}}' || 'single';
160
161
  const tableCards = document.querySelectorAll('.table-option-card');
@@ -221,7 +222,7 @@ document.addEventListener('DOMContentLoaded', () => {
221
222
  const table = btn.dataset.table;
222
223
  const mode = btn.dataset.mode || 'single';
223
224
  if (table) {
224
- window.location.href = `${BASE}/seed/${encodeURIComponent(table)}?mode=${encodeURIComponent(mode)}`;
225
+ window.location.href = `${BASE}/seed/${encodeURIComponent(DB_ID)}/${encodeURIComponent(table)}?mode=${encodeURIComponent(mode)}`;
225
226
  }
226
227
  });
227
228
  });
@@ -229,7 +230,7 @@ document.addEventListener('DOMContentLoaded', () => {
229
230
  if (launchBtn) {
230
231
  launchBtn.addEventListener('click', () => {
231
232
  if (!selectedTable) return;
232
- window.location.href = `${BASE}/seed/${encodeURIComponent(selectedTable)}?mode=${encodeURIComponent(selectedMode)}`;
233
+ window.location.href = `${BASE}/seed/${encodeURIComponent(DB_ID)}/${encodeURIComponent(selectedTable)}?mode=${encodeURIComponent(selectedMode)}`;
233
234
  });
234
235
  }
235
236
  // Real-time table search filter
@@ -1,12 +1,12 @@
1
1
  <div class="space-y-4 pb-20">
2
2
  <div class="app-card p-3.5 flex flex-wrap items-center justify-between gap-4">
3
3
  <div class="flex items-center gap-3 min-w-0">
4
- <a href="{{basePath}}/seed" class="btn btn-sm btn-ghost btn-square text-base-content/70 hover:text-base-content" title="Choose table & mode">
4
+ <a href="{{basePath}}/seed/{{encodeUri dbId}}" class="btn btn-sm btn-ghost btn-square text-base-content/70 hover:text-base-content" title="Choose table & mode">
5
5
  {{{icon "arrowLeft" class="h-4 w-4"}}}
6
6
  </a>
7
7
  <div class="h-4 w-px bg-base-300"></div>
8
8
  <div class="flex items-center gap-2 flex-wrap">
9
- <a href="{{basePath}}/seed" class="text-xs font-semibold text-base-content/50 hover:text-primary transition-colors">Seed Data</a>
9
+ <a href="{{basePath}}/seed/{{encodeUri dbId}}" class="text-xs font-semibold text-base-content/50 hover:text-primary transition-colors">Seed Data</a>
10
10
  <span class="text-xs text-base-content/30">/</span>
11
11
  {{#if allTables.length}}
12
12
  <div class="dropdown dropdown-bottom">
@@ -17,7 +17,7 @@
17
17
  <ul tabindex="0" class="dropdown-content z-30 menu p-1 shadow-lg bg-base-100 border border-base-300 rounded-box w-52 max-h-60 overflow-y-auto">
18
18
  {{#each allTables}}
19
19
  <li>
20
- <a href="{{../basePath}}/seed/{{this}}" class="{{#if (eq this ../table)}}active font-bold{{/if}} font-mono text-xs">
20
+ <a href="{{../basePath}}/seed/{{encodeUri ../dbId}}/{{encodeUri this}}" class="{{#if (eq this ../table)}}active font-bold{{/if}} font-mono text-xs">
21
21
  {{{icon "table" class="h-3.5 w-3.5"}}}
22
22
  {{this}}
23
23
  </a>