admindb 1.0.1 → 1.0.3
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 +20 -20
- package/README.md +333 -325
- package/dist/db/database.d.ts +3 -2
- package/dist/db/database.js +12 -9
- package/dist/db/database.js.map +1 -1
- package/dist/db/manager.js +1 -1
- package/dist/db/manager.js.map +1 -1
- package/dist/public/css/input.css +179 -179
- package/dist/public/js/api.js +47 -47
- package/dist/public/js/app.js +120 -120
- package/dist/public/js/browse.js +123 -123
- package/dist/public/js/databases.js +45 -45
- package/dist/public/js/designer.js +205 -205
- package/dist/public/js/forms.js +244 -244
- package/dist/public/js/query.js +232 -232
- package/dist/public/js/schema.js +314 -314
- package/dist/public/js/triggers.js +155 -155
- package/dist/public/js/views.js +176 -176
- package/dist/views/layouts/main.hbs +49 -49
- package/dist/views/pages/databases.hbs +102 -102
- package/dist/views/pages/designer.hbs +81 -81
- package/dist/views/pages/error.hbs +12 -12
- package/dist/views/pages/form.hbs +62 -62
- package/dist/views/pages/home.hbs +123 -123
- package/dist/views/pages/query.hbs +94 -94
- package/dist/views/pages/schema.hbs +290 -290
- package/dist/views/pages/table.hbs +203 -203
- package/dist/views/pages/triggers.hbs +162 -162
- package/dist/views/pages/views.hbs +134 -134
- package/dist/views/partials/navbar.hbs +50 -50
- package/dist/views/partials/sidebar.hbs +128 -128
- package/package.json +66 -62
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
<div class="sticky top-0 z-30 border-b border-base-300/80 bg-base-100/85 backdrop-blur-md">
|
|
2
|
-
<div class="navbar mx-auto w-full max-w-[1500px] px-4 sm:px-6 lg:px-8">
|
|
3
|
-
<div class="flex-none lg:hidden">
|
|
4
|
-
<label for="sidebar-toggle" class="btn btn-square btn-ghost" aria-label="open sidebar">
|
|
5
|
-
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
6
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h16" />
|
|
7
|
-
</svg>
|
|
8
|
-
</label>
|
|
9
|
-
</div>
|
|
10
|
-
<div class="flex-1">
|
|
11
|
-
<a href="{{basePath}}/" class="flex items-center gap-2.5">
|
|
12
|
-
<span class="grid h-9 w-9 place-items-center rounded-xl bg-gradient-to-br from-primary to-secondary text-white shadow-soft">
|
|
13
|
-
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
14
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M4 7v10c0 1.1.9 2 2 2h12a2 2 0 002-2V7M4 7c0-1.1.9-2 2-2h12a2 2 0 012 2M4 7c0 1.1.9 2 2 2h12a2 2 0 002-2" />
|
|
15
|
-
</svg>
|
|
16
|
-
</span>
|
|
17
|
-
<span class="text-lg font-bold tracking-tight">DB<span class="text-primary">Admin</span></span>
|
|
18
|
-
</a>
|
|
19
|
-
</div>
|
|
20
|
-
<div class="flex items-center gap-1.5">
|
|
21
|
-
{{#unless databasesMode}}
|
|
22
|
-
{{#if databasesUrl}}
|
|
23
|
-
<a href="{{databasesUrl}}" class="btn btn-ghost btn-sm hidden gap-1.5 sm:inline-flex">
|
|
24
|
-
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 7v10c0 1.1.9 2 2 2h12a2 2 0 002-2V7M4 7c0-1.1.9-2 2-2h12a2 2 0 012 2M4 7c0 1.1.9 2 2 2h12a2 2 0 002-2" /></svg>
|
|
25
|
-
Databases
|
|
26
|
-
</a>
|
|
27
|
-
{{/if}}
|
|
28
|
-
<a href="{{basePath}}/query" class="btn btn-ghost btn-sm hidden gap-1.5 sm:inline-flex">
|
|
29
|
-
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M13 10V3L4 14h7v7l9-11h-7z" /></svg>
|
|
30
|
-
Query
|
|
31
|
-
</a>
|
|
32
|
-
{{#unless readonly}}
|
|
33
|
-
<a href="{{basePath}}/designer" class="btn btn-ghost btn-sm hidden gap-1.5 sm:inline-flex">
|
|
34
|
-
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4v16m8-8H4" /></svg>
|
|
35
|
-
New table
|
|
36
|
-
</a>
|
|
37
|
-
{{/unless}}
|
|
38
|
-
<a href="{{basePath}}/export" class="btn btn-ghost btn-sm hidden gap-1.5 md:inline-flex">
|
|
39
|
-
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" /></svg>
|
|
40
|
-
Export
|
|
41
|
-
</a>
|
|
42
|
-
{{/unless}}
|
|
43
|
-
<button id="theme-toggle" type="button" class="btn btn-square btn-ghost btn-sm" aria-label="Toggle dark mode" title="Toggle dark mode">
|
|
44
|
-
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
45
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" />
|
|
46
|
-
</svg>
|
|
47
|
-
</button>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
1
|
+
<div class="sticky top-0 z-30 border-b border-base-300/80 bg-base-100/85 backdrop-blur-md">
|
|
2
|
+
<div class="navbar mx-auto w-full max-w-[1500px] px-4 sm:px-6 lg:px-8">
|
|
3
|
+
<div class="flex-none lg:hidden">
|
|
4
|
+
<label for="sidebar-toggle" class="btn btn-square btn-ghost" aria-label="open sidebar">
|
|
5
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
6
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h16" />
|
|
7
|
+
</svg>
|
|
8
|
+
</label>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="flex-1">
|
|
11
|
+
<a href="{{basePath}}/" class="flex items-center gap-2.5">
|
|
12
|
+
<span class="grid h-9 w-9 place-items-center rounded-xl bg-gradient-to-br from-primary to-secondary text-white shadow-soft">
|
|
13
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
14
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M4 7v10c0 1.1.9 2 2 2h12a2 2 0 002-2V7M4 7c0-1.1.9-2 2-2h12a2 2 0 012 2M4 7c0 1.1.9 2 2 2h12a2 2 0 002-2" />
|
|
15
|
+
</svg>
|
|
16
|
+
</span>
|
|
17
|
+
<span class="text-lg font-bold tracking-tight">DB<span class="text-primary">Admin</span></span>
|
|
18
|
+
</a>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="flex items-center gap-1.5">
|
|
21
|
+
{{#unless databasesMode}}
|
|
22
|
+
{{#if databasesUrl}}
|
|
23
|
+
<a href="{{databasesUrl}}" class="btn btn-ghost btn-sm hidden gap-1.5 sm:inline-flex">
|
|
24
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 7v10c0 1.1.9 2 2 2h12a2 2 0 002-2V7M4 7c0-1.1.9-2 2-2h12a2 2 0 012 2M4 7c0 1.1.9 2 2 2h12a2 2 0 002-2" /></svg>
|
|
25
|
+
Databases
|
|
26
|
+
</a>
|
|
27
|
+
{{/if}}
|
|
28
|
+
<a href="{{basePath}}/query" class="btn btn-ghost btn-sm hidden gap-1.5 sm:inline-flex">
|
|
29
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M13 10V3L4 14h7v7l9-11h-7z" /></svg>
|
|
30
|
+
Query
|
|
31
|
+
</a>
|
|
32
|
+
{{#unless readonly}}
|
|
33
|
+
<a href="{{basePath}}/designer" class="btn btn-ghost btn-sm hidden gap-1.5 sm:inline-flex">
|
|
34
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4v16m8-8H4" /></svg>
|
|
35
|
+
New table
|
|
36
|
+
</a>
|
|
37
|
+
{{/unless}}
|
|
38
|
+
<a href="{{basePath}}/export" class="btn btn-ghost btn-sm hidden gap-1.5 md:inline-flex">
|
|
39
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" /></svg>
|
|
40
|
+
Export
|
|
41
|
+
</a>
|
|
42
|
+
{{/unless}}
|
|
43
|
+
<button id="theme-toggle" type="button" class="btn btn-square btn-ghost btn-sm" aria-label="Toggle dark mode" title="Toggle dark mode">
|
|
44
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
45
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" />
|
|
46
|
+
</svg>
|
|
47
|
+
</button>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
<aside class="flex h-full min-h-full w-72 flex-col bg-neutral text-neutral-content">
|
|
2
|
-
<div class="flex items-center gap-2.5 px-5 pb-4 pt-5">
|
|
3
|
-
<span class="grid h-9 w-9 shrink-0 place-items-center rounded-xl bg-gradient-to-br from-primary to-secondary text-white shadow-soft">
|
|
4
|
-
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
5
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M4 7v10c0 1.1.9 2 2 2h12a2 2 0 002-2V7M4 7c0-1.1.9-2 2-2h12a2 2 0 012 2M4 7c0 1.1.9 2 2 2h12a2 2 0 002-2" />
|
|
6
|
-
</svg>
|
|
7
|
-
</span>
|
|
8
|
-
<div>
|
|
9
|
-
<div class="text-base font-bold leading-tight">AdminDB</div>
|
|
10
|
-
<div class="text-[11px] text-neutral-content/50">{{#if databasesMode}}Database manager{{else}}Database: {{dbId}}{{/if}}</div>
|
|
11
|
-
</div>
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
{{#if databasesMode}}
|
|
15
|
-
<nav class="flex-1 overflow-y-auto px-3 py-2">
|
|
16
|
-
<ul class="space-y-0.5">
|
|
17
|
-
<li>
|
|
18
|
-
<a href="{{basePath}}/" class="side-link active">
|
|
19
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 7v10c0 1.1.9 2 2 2h12a2 2 0 002-2V7M4 7c0-1.1.9-2 2-2h12a2 2 0 012 2M4 7c0 1.1.9 2 2 2h12a2 2 0 002-2" /></svg>
|
|
20
|
-
Databases
|
|
21
|
-
</a>
|
|
22
|
-
</li>
|
|
23
|
-
</ul>
|
|
24
|
-
</nav>
|
|
25
|
-
{{else}}
|
|
26
|
-
<div class="px-4 pb-2">
|
|
27
|
-
<label class="relative block">
|
|
28
|
-
<svg xmlns="http://www.w3.org/2000/svg" class="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-content/40" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
29
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
|
|
30
|
-
</svg>
|
|
31
|
-
<input id="table-search" type="search" placeholder="Filter tables…" autocomplete="off"
|
|
32
|
-
class="w-full rounded-lg border border-white/10 bg-white/[0.06] py-2 pl-9 pr-3 text-sm text-neutral-content outline-none transition placeholder:text-neutral-content/40 focus:border-primary/70 focus:ring-4 focus:ring-primary/20" />
|
|
33
|
-
</label>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<nav class="flex-1 overflow-y-auto px-3 py-2">
|
|
37
|
-
<ul class="space-y-0.5">
|
|
38
|
-
{{#if databasesUrl}}
|
|
39
|
-
<li>
|
|
40
|
-
<a href="{{databasesUrl}}" class="side-link">
|
|
41
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 7v10c0 1.1.9 2 2 2h12a2 2 0 002-2V7M4 7c0-1.1.9-2 2-2h12a2 2 0 012 2M4 7c0 1.1.9 2 2 2h12a2 2 0 002-2" /></svg>
|
|
42
|
-
Databases
|
|
43
|
-
</a>
|
|
44
|
-
</li>
|
|
45
|
-
{{/if}}
|
|
46
|
-
<li>
|
|
47
|
-
<a href="{{basePath}}/" class="side-link {{#if (eq currentPath '/')}}active{{/if}}">
|
|
48
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" /></svg>
|
|
49
|
-
Home
|
|
50
|
-
</a>
|
|
51
|
-
</li>
|
|
52
|
-
<li>
|
|
53
|
-
<a href="{{basePath}}/query" class="side-link {{#if (startsWith currentPath '/query')}}active{{/if}}">
|
|
54
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M13 10V3L4 14h7v7l9-11h-7z" /></svg>
|
|
55
|
-
Query editor
|
|
56
|
-
</a>
|
|
57
|
-
</li>
|
|
58
|
-
<li>
|
|
59
|
-
<a href="{{basePath}}/views" class="side-link {{#if (startsWith currentPath '/views')}}active{{/if}}">
|
|
60
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /><path stroke-linecap="round" stroke-linejoin="round" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" /></svg>
|
|
61
|
-
Views
|
|
62
|
-
</a>
|
|
63
|
-
</li>
|
|
64
|
-
<li>
|
|
65
|
-
<a href="{{basePath}}/triggers" class="side-link {{#if (startsWith currentPath '/triggers')}}active{{/if}}">
|
|
66
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M13 10V3L4 14h7v7l9-11h-7z" /></svg>
|
|
67
|
-
Triggers
|
|
68
|
-
</a>
|
|
69
|
-
</li>
|
|
70
|
-
{{#unless readonly}}
|
|
71
|
-
<li>
|
|
72
|
-
<a href="{{basePath}}/designer" class="side-link {{#if (startsWith currentPath '/designer')}}active{{/if}}">
|
|
73
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4v16m8-8H4" /></svg>
|
|
74
|
-
New table
|
|
75
|
-
</a>
|
|
76
|
-
</li>
|
|
77
|
-
{{/unless}}
|
|
78
|
-
</ul>
|
|
79
|
-
|
|
80
|
-
<div class="mb-2 mt-6 flex items-center justify-between px-3">
|
|
81
|
-
<span class="text-[11px] font-semibold uppercase tracking-wider text-neutral-content/40">Tables</span>
|
|
82
|
-
<span id="table-count" class="rounded-md bg-white/[0.06] px-1.5 py-0.5 text-[10px] font-semibold text-neutral-content/50">{{tables.length}}</span>
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<ul id="table-list" class="space-y-0.5">
|
|
86
|
-
{{#each tables}}
|
|
87
|
-
<li class="table-item" data-name="{{this}}">
|
|
88
|
-
<a href="{{../basePath}}/tables/{{this}}" class="side-link {{#if (eq ../currentTable this)}}active{{/if}}">
|
|
89
|
-
<span class="table-icon">
|
|
90
|
-
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z" /></svg>
|
|
91
|
-
</span>
|
|
92
|
-
<span class="truncate">{{this}}</span>
|
|
93
|
-
</a>
|
|
94
|
-
</li>
|
|
95
|
-
{{else}}
|
|
96
|
-
<li class="px-3 py-2 text-xs text-neutral-content/40">No tables yet</li>
|
|
97
|
-
{{/each}}
|
|
98
|
-
</ul>
|
|
99
|
-
|
|
100
|
-
{{#if internalTables.length}}
|
|
101
|
-
<div class="mb-2 mt-6 px-3 text-[11px] font-semibold uppercase tracking-wider text-neutral-content/40">Internal</div>
|
|
102
|
-
<ul class="space-y-0.5">
|
|
103
|
-
{{#each internalTables}}
|
|
104
|
-
<li>
|
|
105
|
-
<a href="{{../basePath}}/tables/{{this}}" class="side-link {{#if (eq ../currentTable this)}}active{{/if}}">
|
|
106
|
-
<span class="table-icon">
|
|
107
|
-
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253" /></svg>
|
|
108
|
-
</span>
|
|
109
|
-
<span class="truncate">{{this}}</span>
|
|
110
|
-
</a>
|
|
111
|
-
</li>
|
|
112
|
-
{{/each}}
|
|
113
|
-
</ul>
|
|
114
|
-
{{/if}}
|
|
115
|
-
</nav>
|
|
116
|
-
{{/if}}
|
|
117
|
-
|
|
118
|
-
<div class="border-t border-white/10 px-5 py-3">
|
|
119
|
-
<div class="text-[11px] font-medium uppercase tracking-wider text-neutral-content/40">{{#if databasesMode}}Directory{{else}}Database{{/if}}</div>
|
|
120
|
-
<div class="mt-0.5 truncate font-mono text-[11px] text-neutral-content/60" title="{{dbPath}}">{{dbPath}}</div>
|
|
121
|
-
{{#if readonly}}
|
|
122
|
-
<div class="mt-2 inline-flex items-center gap-1 rounded-md bg-warning/20 px-2 py-1 text-[10px] font-bold uppercase tracking-wider text-warning">
|
|
123
|
-
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 15v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" /></svg>
|
|
124
|
-
Read-only
|
|
125
|
-
</div>
|
|
126
|
-
{{/if}}
|
|
127
|
-
</div>
|
|
128
|
-
</aside>
|
|
1
|
+
<aside class="flex h-full min-h-full w-72 flex-col bg-neutral text-neutral-content">
|
|
2
|
+
<div class="flex items-center gap-2.5 px-5 pb-4 pt-5">
|
|
3
|
+
<span class="grid h-9 w-9 shrink-0 place-items-center rounded-xl bg-gradient-to-br from-primary to-secondary text-white shadow-soft">
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
5
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M4 7v10c0 1.1.9 2 2 2h12a2 2 0 002-2V7M4 7c0-1.1.9-2 2-2h12a2 2 0 012 2M4 7c0 1.1.9 2 2 2h12a2 2 0 002-2" />
|
|
6
|
+
</svg>
|
|
7
|
+
</span>
|
|
8
|
+
<div>
|
|
9
|
+
<div class="text-base font-bold leading-tight">AdminDB</div>
|
|
10
|
+
<div class="text-[11px] text-neutral-content/50">{{#if databasesMode}}Database manager{{else}}Database: {{dbId}}{{/if}}</div>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
{{#if databasesMode}}
|
|
15
|
+
<nav class="flex-1 overflow-y-auto px-3 py-2">
|
|
16
|
+
<ul class="space-y-0.5">
|
|
17
|
+
<li>
|
|
18
|
+
<a href="{{basePath}}/" class="side-link active">
|
|
19
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 7v10c0 1.1.9 2 2 2h12a2 2 0 002-2V7M4 7c0-1.1.9-2 2-2h12a2 2 0 012 2M4 7c0 1.1.9 2 2 2h12a2 2 0 002-2" /></svg>
|
|
20
|
+
Databases
|
|
21
|
+
</a>
|
|
22
|
+
</li>
|
|
23
|
+
</ul>
|
|
24
|
+
</nav>
|
|
25
|
+
{{else}}
|
|
26
|
+
<div class="px-4 pb-2">
|
|
27
|
+
<label class="relative block">
|
|
28
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-content/40" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
29
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
|
|
30
|
+
</svg>
|
|
31
|
+
<input id="table-search" type="search" placeholder="Filter tables…" autocomplete="off"
|
|
32
|
+
class="w-full rounded-lg border border-white/10 bg-white/[0.06] py-2 pl-9 pr-3 text-sm text-neutral-content outline-none transition placeholder:text-neutral-content/40 focus:border-primary/70 focus:ring-4 focus:ring-primary/20" />
|
|
33
|
+
</label>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<nav class="flex-1 overflow-y-auto px-3 py-2">
|
|
37
|
+
<ul class="space-y-0.5">
|
|
38
|
+
{{#if databasesUrl}}
|
|
39
|
+
<li>
|
|
40
|
+
<a href="{{databasesUrl}}" class="side-link">
|
|
41
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 7v10c0 1.1.9 2 2 2h12a2 2 0 002-2V7M4 7c0-1.1.9-2 2-2h12a2 2 0 012 2M4 7c0 1.1.9 2 2 2h12a2 2 0 002-2" /></svg>
|
|
42
|
+
Databases
|
|
43
|
+
</a>
|
|
44
|
+
</li>
|
|
45
|
+
{{/if}}
|
|
46
|
+
<li>
|
|
47
|
+
<a href="{{basePath}}/" class="side-link {{#if (eq currentPath '/')}}active{{/if}}">
|
|
48
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" /></svg>
|
|
49
|
+
Home
|
|
50
|
+
</a>
|
|
51
|
+
</li>
|
|
52
|
+
<li>
|
|
53
|
+
<a href="{{basePath}}/query" class="side-link {{#if (startsWith currentPath '/query')}}active{{/if}}">
|
|
54
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M13 10V3L4 14h7v7l9-11h-7z" /></svg>
|
|
55
|
+
Query editor
|
|
56
|
+
</a>
|
|
57
|
+
</li>
|
|
58
|
+
<li>
|
|
59
|
+
<a href="{{basePath}}/views" class="side-link {{#if (startsWith currentPath '/views')}}active{{/if}}">
|
|
60
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /><path stroke-linecap="round" stroke-linejoin="round" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" /></svg>
|
|
61
|
+
Views
|
|
62
|
+
</a>
|
|
63
|
+
</li>
|
|
64
|
+
<li>
|
|
65
|
+
<a href="{{basePath}}/triggers" class="side-link {{#if (startsWith currentPath '/triggers')}}active{{/if}}">
|
|
66
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M13 10V3L4 14h7v7l9-11h-7z" /></svg>
|
|
67
|
+
Triggers
|
|
68
|
+
</a>
|
|
69
|
+
</li>
|
|
70
|
+
{{#unless readonly}}
|
|
71
|
+
<li>
|
|
72
|
+
<a href="{{basePath}}/designer" class="side-link {{#if (startsWith currentPath '/designer')}}active{{/if}}">
|
|
73
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4v16m8-8H4" /></svg>
|
|
74
|
+
New table
|
|
75
|
+
</a>
|
|
76
|
+
</li>
|
|
77
|
+
{{/unless}}
|
|
78
|
+
</ul>
|
|
79
|
+
|
|
80
|
+
<div class="mb-2 mt-6 flex items-center justify-between px-3">
|
|
81
|
+
<span class="text-[11px] font-semibold uppercase tracking-wider text-neutral-content/40">Tables</span>
|
|
82
|
+
<span id="table-count" class="rounded-md bg-white/[0.06] px-1.5 py-0.5 text-[10px] font-semibold text-neutral-content/50">{{tables.length}}</span>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<ul id="table-list" class="space-y-0.5">
|
|
86
|
+
{{#each tables}}
|
|
87
|
+
<li class="table-item" data-name="{{this}}">
|
|
88
|
+
<a href="{{../basePath}}/tables/{{this}}" class="side-link {{#if (eq ../currentTable this)}}active{{/if}}">
|
|
89
|
+
<span class="table-icon">
|
|
90
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z" /></svg>
|
|
91
|
+
</span>
|
|
92
|
+
<span class="truncate">{{this}}</span>
|
|
93
|
+
</a>
|
|
94
|
+
</li>
|
|
95
|
+
{{else}}
|
|
96
|
+
<li class="px-3 py-2 text-xs text-neutral-content/40">No tables yet</li>
|
|
97
|
+
{{/each}}
|
|
98
|
+
</ul>
|
|
99
|
+
|
|
100
|
+
{{#if internalTables.length}}
|
|
101
|
+
<div class="mb-2 mt-6 px-3 text-[11px] font-semibold uppercase tracking-wider text-neutral-content/40">Internal</div>
|
|
102
|
+
<ul class="space-y-0.5">
|
|
103
|
+
{{#each internalTables}}
|
|
104
|
+
<li>
|
|
105
|
+
<a href="{{../basePath}}/tables/{{this}}" class="side-link {{#if (eq ../currentTable this)}}active{{/if}}">
|
|
106
|
+
<span class="table-icon">
|
|
107
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253" /></svg>
|
|
108
|
+
</span>
|
|
109
|
+
<span class="truncate">{{this}}</span>
|
|
110
|
+
</a>
|
|
111
|
+
</li>
|
|
112
|
+
{{/each}}
|
|
113
|
+
</ul>
|
|
114
|
+
{{/if}}
|
|
115
|
+
</nav>
|
|
116
|
+
{{/if}}
|
|
117
|
+
|
|
118
|
+
<div class="border-t border-white/10 px-5 py-3">
|
|
119
|
+
<div class="text-[11px] font-medium uppercase tracking-wider text-neutral-content/40">{{#if databasesMode}}Directory{{else}}Database{{/if}}</div>
|
|
120
|
+
<div class="mt-0.5 truncate font-mono text-[11px] text-neutral-content/60" title="{{dbPath}}">{{dbPath}}</div>
|
|
121
|
+
{{#if readonly}}
|
|
122
|
+
<div class="mt-2 inline-flex items-center gap-1 rounded-md bg-warning/20 px-2 py-1 text-[10px] font-bold uppercase tracking-wider text-warning">
|
|
123
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 15v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" /></svg>
|
|
124
|
+
Read-only
|
|
125
|
+
</div>
|
|
126
|
+
{{/if}}
|
|
127
|
+
</div>
|
|
128
|
+
</aside>
|
package/package.json
CHANGED
|
@@ -1,62 +1,66 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "admindb",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Browser-based SQLite database administration tool — embed it in your Express app or run it standalone.",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"bin": {
|
|
8
|
-
"admindb": "dist/cli.js"
|
|
9
|
-
},
|
|
10
|
-
"homepage": "https://github.com/MIbnEKhalid/admindb#readme",
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/MIbnEKhalid/admindb.git"
|
|
14
|
-
},
|
|
15
|
-
"bugs": {
|
|
16
|
-
"url": "https://github.com/MIbnEKhalid/admindb/issues"
|
|
17
|
-
},
|
|
18
|
-
"author": "MIbnEKhalid",
|
|
19
|
-
"files": [
|
|
20
|
-
"dist",
|
|
21
|
-
"README.md",
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"build
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"dev
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "admindb",
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "Browser-based SQLite database administration tool — embed it in your Express app or run it standalone.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"admindb": "dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/MIbnEKhalid/admindb#readme",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/MIbnEKhalid/admindb.git"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/MIbnEKhalid/admindb/issues"
|
|
17
|
+
},
|
|
18
|
+
"author": "MIbnEKhalid",
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md",
|
|
22
|
+
"package.json",
|
|
23
|
+
"LICENSE"
|
|
24
|
+
],
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=20.0.0"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc -p tsconfig.json && node scripts/copy-assets.mjs && npm run build:css",
|
|
30
|
+
"build:css": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=1 tailwindcss -i ./src/public/css/input.css -o ./dist/public/css/app.css --minify",
|
|
31
|
+
"start": "node dist/cli.js",
|
|
32
|
+
"dev": "concurrently -k -n server,css \"tsx watch src/cli.ts\" \"npm run dev:css\"",
|
|
33
|
+
"dev:css": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=1 tailwindcss -i ./src/public/css/input.css -o ./src/public/css/app.css --watch",
|
|
34
|
+
"prepack": "npm run build",
|
|
35
|
+
"test": "npm run build && node --test dist/test/*.test.js"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"sqlite",
|
|
39
|
+
"admin",
|
|
40
|
+
"database",
|
|
41
|
+
"express",
|
|
42
|
+
"handlebars",
|
|
43
|
+
"tailwind",
|
|
44
|
+
"daisyui"
|
|
45
|
+
],
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"registry": "https://registry.npmjs.org/"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"better-sqlite3": "^11.9.1",
|
|
52
|
+
"express": "^5.1.0",
|
|
53
|
+
"express-handlebars": "^8.0.3"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/better-sqlite3": "^9.6.0",
|
|
57
|
+
"@types/express": "^4.17.21",
|
|
58
|
+
"@types/node": "^22.10.0",
|
|
59
|
+
"concurrently": "^9.1.0",
|
|
60
|
+
"cross-env": "^10.1.0",
|
|
61
|
+
"daisyui": "^4.12.0",
|
|
62
|
+
"tailwindcss": "^3.4.17",
|
|
63
|
+
"tsx": "^4.19.0",
|
|
64
|
+
"typescript": "^5.7.0"
|
|
65
|
+
}
|
|
66
|
+
}
|