admindb 2.5.0 → 2.6.2
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/dist/app.js +13 -1
- package/dist/core/diff/data-differ.d.ts +1 -0
- package/dist/core/diff/data-differ.js +243 -0
- package/dist/core/diff/patch-generator.d.ts +1 -0
- package/dist/core/diff/patch-generator.js +77 -0
- package/dist/core/diff/schema-differ.d.ts +1 -0
- package/dist/core/diff/schema-differ.js +229 -0
- package/dist/core/router.d.ts +1 -1
- package/dist/core/transfer/dialect-mapper.d.ts +1 -0
- package/dist/core/transfer/dialect-mapper.js +303 -0
- package/dist/core/transfer/masking.d.ts +1 -0
- package/dist/core/transfer/masking.js +49 -0
- package/dist/core/transfer/sync-engine.d.ts +1 -0
- package/dist/core/transfer/sync-engine.js +234 -0
- package/dist/core/transfer/topological-sort.d.ts +1 -0
- package/dist/core/transfer/topological-sort.js +55 -0
- package/dist/db/dialects/postgres/introspector.js +71 -71
- package/dist/db/dialects/sqlite/introspector.js +6 -3
- package/dist/modules/index.d.ts +1 -1
- package/dist/modules/index.js +9 -1
- package/dist/modules/search/index.d.ts +1 -0
- package/dist/modules/search/index.js +19 -0
- package/dist/modules/search/search.routes.d.ts +1 -0
- package/dist/modules/search/search.routes.js +38 -0
- package/dist/modules/search/search.service.d.ts +1 -0
- package/dist/modules/search/search.service.js +458 -0
- package/dist/modules/search/search.types.d.ts +1 -0
- package/dist/modules/search/search.types.js +2 -0
- package/dist/modules/sync/index.d.ts +1 -0
- package/dist/modules/sync/index.js +18 -0
- package/dist/modules/sync/sync.routes.d.ts +1 -0
- package/dist/modules/sync/sync.routes.js +135 -0
- package/dist/modules/sync/sync.service.d.ts +1 -0
- package/dist/modules/sync/sync.service.js +41 -0
- package/dist/public/css/app.css +2 -1
- package/dist/public/js/browse.js +1 -1
- package/dist/public/js/search.js +1 -0
- package/dist/public/js/sync.js +1 -0
- package/dist/utils/icons.js +3 -0
- package/dist/views/layouts/main.hbs +1 -1
- package/dist/views/pages/error.hbs +1 -10
- package/dist/views/pages/seed-select.hbs +252 -1
- package/dist/views/pages/seed.hbs +307 -1
- package/dist/views/pages/sync.hbs +1 -0
- package/dist/views/pages/table.hbs +1 -1
- package/dist/views/partials/navbar.hbs +1 -1
- package/dist/views/partials/sidebar.hbs +1 -1
- package/docs/EXAMPLES.md +579 -579
- package/docs/SECURITY.md +265 -265
- package/package.json +14 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
<div class="sticky top-0 z-30 border-b border-base-300/80 bg-base-100/85 backdrop-blur-md">
|
|
2
1
|
<div class="navbar mx-auto w-full max-w-[1500px] px-4 sm:px-6 lg:px-8">
|
|
3
2
|
<div class="flex-none lg:hidden">
|
|
4
3
|
<label for="sidebar-toggle" class="btn btn-square btn-ghost" aria-label="open sidebar">
|
|
5
4
|
{{{icon "menu" class="h-5 w-5"}}}
|
|
6
5
|
</label>
|
|
7
6
|
</div>
|
|
8
7
|
<div class="flex flex-1 items-center gap-3">
|
|
9
8
|
<a href="{{basePath}}/" class="flex items-center gap-2.5">
|
|
10
9
|
<span class="font-headings text-lg font-bold tracking-tight text-base-content">Admin<span class="text-primary">DB</span></span>
|
|
11
10
|
</a>
|
|
12
11
|
{{#unless databasesMode}}
|
|
13
12
|
{{#if isPostgres}}
|
|
14
13
|
<span class="inline-flex items-center gap-1.5 rounded-lg border border-info/40 bg-info/10 px-2.5 py-0.5 text-xs font-semibold text-info" title="Engine: PostgreSQL ({{dbPath}})">
|
|
15
14
|
<span class="h-2 w-2 rounded-full bg-info animate-pulse"></span>
|
|
16
15
|
PostgreSQL
|
|
17
16
|
</span>
|
|
18
17
|
{{else}}
|
|
19
18
|
<span class="inline-flex items-center gap-1.5 rounded-lg border border-emerald-500/40 bg-emerald-500/10 px-2.5 py-0.5 text-xs font-semibold text-emerald-600 dark:text-emerald-400" title="Engine: SQLite ({{dbPath}})">
|
|
20
19
|
<span class="h-2 w-2 rounded-full bg-emerald-500 animate-pulse"></span>
|
|
21
20
|
SQLite
|
|
22
21
|
</span>
|
|
23
22
|
{{/if}}
|
|
24
23
|
{{/unless}}
|
|
25
24
|
</div>
|
|
26
25
|
<div class="flex items-center gap-1.5">
|
|
27
26
|
{{#unless noSidebar}}
|
|
28
27
|
{{#unless databasesMode}}
|
|
29
28
|
{{#if databasesUrl}}
|
|
30
29
|
<a href="{{databasesUrl}}" class="btn btn-ghost btn-sm hidden gap-1.5 sm:inline-flex">
|
|
31
30
|
{{{icon "database" class="h-4 w-4"}}}
|
|
32
31
|
Databases
|
|
33
32
|
</a>
|
|
34
33
|
{{/if}}
|
|
35
34
|
<a href="{{basePath}}/query/{{encodeUri dbId}}" class="btn btn-ghost btn-sm hidden gap-1.5 sm:inline-flex">
|
|
36
35
|
{{{icon "query" class="h-4 w-4"}}}
|
|
37
36
|
Query
|
|
38
37
|
</a>
|
|
39
38
|
{{#unless readonly}}
|
|
40
39
|
<a href="{{basePath}}/designer/{{encodeUri dbId}}" class="btn btn-ghost btn-sm hidden gap-1.5 sm:inline-flex">
|
|
41
40
|
{{{icon "plus" class="h-4 w-4"}}}
|
|
42
41
|
New table
|
|
43
42
|
</a>
|
|
44
43
|
{{/unless}}
|
|
45
44
|
<a href="{{basePath}}/export/{{encodeUri dbId}}" class="btn btn-ghost btn-sm hidden gap-1.5 md:inline-flex">
|
|
46
45
|
{{{icon "export" class="h-4 w-4"}}}
|
|
47
46
|
Export
|
|
48
47
|
</a>
|
|
49
48
|
{{/unless}}
|
|
50
49
|
{{/unless}}
|
|
51
50
|
{{#if authEnabled}}
|
|
52
51
|
{{#if authUser}}
|
|
53
52
|
<div class="dropdown dropdown-end">
|
|
54
53
|
<label tabindex="0" class="btn btn-ghost btn-sm gap-1.5 normal-case font-medium">
|
|
55
54
|
{{{icon "user" class="h-4 w-4 text-base-content/70"}}}
|
|
56
55
|
<span class="max-w-[120px] truncate text-xs">{{authUser}}</span>
|
|
57
56
|
</label>
|
|
58
57
|
<ul tabindex="0" class="dropdown-content menu p-2 shadow-soft bg-base-100 rounded-xl w-56 border border-base-300 z-50 mt-1 text-sm space-y-1">
|
|
59
58
|
<li class="menu-title px-2 py-1 text-xs text-base-content/50">Signed in as <strong class="text-base-content">{{authUser}}</strong></li>
|
|
60
59
|
{{#if isDefaultPassword}}
|
|
61
60
|
<li class="rounded-lg bg-warning/10 p-2 text-[11px] text-warning border border-warning/20">
|
|
62
61
|
<div class="flex items-center gap-1.5 font-semibold p-0">
|
|
63
62
|
{{{icon "warning" class="h-3.5 w-3.5 shrink-0"}}}
|
|
64
63
|
<span>Default pass active (admin)</span>
|
|
65
64
|
</div>
|
|
66
65
|
</li>
|
|
67
66
|
{{/if}}
|
|
68
67
|
<li>
|
|
69
68
|
<form method="POST" action="{{basePath}}/logout" class="p-0">
|
|
70
69
|
<button type="submit" class="w-full text-left flex items-center gap-2 px-3 py-2 text-error hover:bg-error/10 rounded-lg">
|
|
71
70
|
{{{icon "logout" class="h-4 w-4"}}}
|
|
72
71
|
Sign out
|
|
73
72
|
</button>
|
|
74
73
|
</form>
|
|
75
74
|
</li>
|
|
76
75
|
</ul>
|
|
77
76
|
</div>
|
|
78
77
|
{{/if}}
|
|
79
78
|
{{/if}}
|
|
80
79
|
<button id="theme-toggle" type="button" class="btn btn-square btn-ghost btn-sm" aria-label="Toggle dark mode" title="Toggle dark mode">
|
|
81
80
|
{{{icon "moon" class="h-5 w-5"}}}
|
|
82
81
|
</button>
|
|
83
82
|
</div>
|
|
84
83
|
</div>
|
|
84
|
+
<div class="sticky top-0 z-30 border-b border-base-300/80 bg-base-100/85 backdrop-blur-md">
|
|
85
85
|
<div class="navbar mx-auto w-full max-w-[1500px] px-4 sm:px-6 lg:px-8">
|
|
86
86
|
<div class="flex-none lg:hidden">
|
|
87
87
|
<label for="sidebar-toggle" class="btn btn-square btn-ghost" aria-label="open sidebar">
|
|
88
88
|
{{{icon "menu" class="h-5 w-5"}}}
|
|
89
89
|
</label>
|
|
90
90
|
</div>
|
|
91
91
|
<div class="flex flex-1 items-center gap-3">
|
|
92
92
|
<a href="{{basePath}}/" class="flex items-center gap-2.5">
|
|
93
93
|
<span class="font-headings text-lg font-bold tracking-tight text-base-content">Admin<span class="text-primary">DB</span></span>
|
|
94
94
|
</a>
|
|
95
95
|
{{#unless databasesMode}}
|
|
96
96
|
{{#if isPostgres}}
|
|
97
97
|
<span class="inline-flex items-center gap-1.5 rounded-lg border border-info/40 bg-info/10 px-2.5 py-0.5 text-xs font-semibold text-info" title="Engine: PostgreSQL ({{dbPath}})">
|
|
98
98
|
<span class="h-2 w-2 rounded-full bg-info animate-pulse"></span>
|
|
99
99
|
PostgreSQL
|
|
100
100
|
</span>
|
|
101
101
|
{{else}}
|
|
102
102
|
<span class="inline-flex items-center gap-1.5 rounded-lg border border-emerald-500/40 bg-emerald-500/10 px-2.5 py-0.5 text-xs font-semibold text-emerald-600 dark:text-emerald-400" title="Engine: SQLite ({{dbPath}})">
|
|
103
103
|
<span class="h-2 w-2 rounded-full bg-emerald-500 animate-pulse"></span>
|
|
104
104
|
SQLite
|
|
105
105
|
</span>
|
|
106
106
|
{{/if}}
|
|
107
107
|
<button id="global-search-trigger" type="button" class="btn btn-ghost btn-sm gap-2 border border-base-300 bg-base-200/60 hover:bg-base-200 text-base-content/70 hover:text-base-content font-normal text-xs rounded-xl px-3 py-1.5 h-auto transition-all shadow-xs sm:ml-2" title="Search tables, columns, commands (Ctrl+K)">
|
|
108
108
|
{{{icon "search" class="h-3.5 w-3.5 text-base-content/50"}}}
|
|
109
109
|
<span class="hidden md:inline font-medium text-base-content/70">Search tables, columns…</span>
|
|
110
110
|
<span class="inline md:hidden font-medium text-base-content/70">Search</span>
|
|
111
111
|
<kbd class="hidden sm:inline-flex items-center gap-0.5 rounded border border-base-300 bg-base-100 px-1.5 py-0.5 text-[10px] font-mono text-base-content/60 font-semibold shadow-xs">
|
|
112
112
|
<span class="text-[9px]">Ctrl</span> K
|
|
113
113
|
</kbd>
|
|
114
114
|
</button>
|
|
115
115
|
{{/unless}}
|
|
116
116
|
</div>
|
|
117
117
|
<div class="flex items-center gap-1.5">
|
|
118
118
|
{{#unless noSidebar}}
|
|
119
119
|
{{#unless databasesMode}}
|
|
120
120
|
{{#if databasesUrl}}
|
|
121
121
|
<a href="{{databasesUrl}}" class="btn btn-ghost btn-sm hidden gap-1.5 sm:inline-flex">
|
|
122
122
|
{{{icon "database" class="h-4 w-4"}}}
|
|
123
123
|
Databases
|
|
124
124
|
</a>
|
|
125
125
|
{{/if}}
|
|
126
126
|
<a href="{{basePath}}/query/{{encodeUri dbId}}" class="btn btn-ghost btn-sm hidden gap-1.5 sm:inline-flex">
|
|
127
127
|
{{{icon "query" class="h-4 w-4"}}}
|
|
128
128
|
Query
|
|
129
129
|
</a>
|
|
130
130
|
{{#unless readonly}}
|
|
131
131
|
<a href="{{basePath}}/designer/{{encodeUri dbId}}" class="btn btn-ghost btn-sm hidden gap-1.5 sm:inline-flex">
|
|
132
132
|
{{{icon "plus" class="h-4 w-4"}}}
|
|
133
133
|
New table
|
|
134
134
|
</a>
|
|
135
135
|
{{/unless}}
|
|
136
136
|
<a href="{{basePath}}/export/{{encodeUri dbId}}" class="btn btn-ghost btn-sm hidden gap-1.5 md:inline-flex">
|
|
137
137
|
{{{icon "export" class="h-4 w-4"}}}
|
|
138
138
|
Export
|
|
139
139
|
</a>
|
|
140
140
|
{{/unless}}
|
|
141
141
|
{{/unless}}
|
|
142
142
|
{{#if authEnabled}}
|
|
143
143
|
{{#if authUser}}
|
|
144
144
|
<div class="dropdown dropdown-end">
|
|
145
145
|
<label tabindex="0" class="btn btn-ghost btn-sm gap-1.5 normal-case font-medium">
|
|
146
146
|
{{{icon "user" class="h-4 w-4 text-base-content/70"}}}
|
|
147
147
|
<span class="max-w-[120px] truncate text-xs">{{authUser}}</span>
|
|
148
148
|
</label>
|
|
149
149
|
<ul tabindex="0" class="dropdown-content menu p-2 shadow-soft bg-base-100 rounded-xl w-56 border border-base-300 z-50 mt-1 text-sm space-y-1">
|
|
150
150
|
<li class="menu-title px-2 py-1 text-xs text-base-content/50">Signed in as <strong class="text-base-content">{{authUser}}</strong></li>
|
|
151
151
|
{{#if isDefaultPassword}}
|
|
152
152
|
<li class="rounded-lg bg-warning/10 p-2 text-[11px] text-warning border border-warning/20">
|
|
153
153
|
<div class="flex items-center gap-1.5 font-semibold p-0">
|
|
154
154
|
{{{icon "warning" class="h-3.5 w-3.5 shrink-0"}}}
|
|
155
155
|
<span>Default pass active (admin)</span>
|
|
156
156
|
</div>
|
|
157
157
|
</li>
|
|
158
158
|
{{/if}}
|
|
159
159
|
<li>
|
|
160
160
|
<form method="POST" action="{{basePath}}/logout" class="p-0">
|
|
161
161
|
<button type="submit" class="w-full text-left flex items-center gap-2 px-3 py-2 text-error hover:bg-error/10 rounded-lg">
|
|
162
162
|
{{{icon "logout" class="h-4 w-4"}}}
|
|
163
163
|
Sign out
|
|
164
164
|
</button>
|
|
165
165
|
</form>
|
|
166
166
|
</li>
|
|
167
167
|
</ul>
|
|
168
168
|
</div>
|
|
169
169
|
{{/if}}
|
|
170
170
|
{{/if}}
|
|
171
171
|
<button id="theme-toggle" type="button" class="btn btn-square btn-ghost btn-sm" aria-label="Toggle dark mode" title="Toggle dark mode">
|
|
172
172
|
{{{icon "moon" class="h-5 w-5"}}}
|
|
173
173
|
</button>
|
|
174
174
|
</div>
|
|
175
175
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<aside class="flex h-full min-h-full w-72 flex-col bg-neutral text-neutral-content">
|
|
2
1
|
<div class="flex items-center gap-2.5 px-5 pb-4 pt-5">
|
|
3
2
|
<div class="w-full">
|
|
4
3
|
<div class="flex items-center justify-between">
|
|
5
4
|
<div class="font-headings text-base font-bold leading-tight">AdminDB <span style="font-size: x-small" class="font-sans font-normal opacity-70">{{#if version}}v{{version}}{{/if}}</span></div>
|
|
6
5
|
{{#unless databasesMode}}
|
|
7
6
|
{{#if isPostgres}}
|
|
8
7
|
<span class="rounded bg-info/20 px-1.5 py-0.5 text-[10px] font-bold text-info">PostgreSQL</span>
|
|
9
8
|
{{else}}
|
|
10
9
|
<span class="rounded bg-emerald-500/20 px-1.5 py-0.5 text-[10px] font-bold text-emerald-400">SQLite</span>
|
|
11
10
|
{{/if}}
|
|
12
11
|
{{/unless}}
|
|
13
12
|
</div>
|
|
14
13
|
<div class="mt-0.5 text-[11px] text-neutral-content/50 truncate">{{#if databasesMode}}Database manager{{else}}{{dbId}}{{/if}}</div>
|
|
15
14
|
</div>
|
|
16
15
|
</div>
|
|
17
16
|
{{#if databasesMode}}
|
|
18
17
|
<nav class="flex-1 overflow-y-auto px-3 py-2">
|
|
19
18
|
<ul class="space-y-0.5">
|
|
20
19
|
<li>
|
|
21
20
|
<a href="{{basePath}}/" class="side-link active">
|
|
22
21
|
{{{icon "database" class="h-4 w-4"}}}
|
|
23
22
|
Databases
|
|
24
23
|
</a>
|
|
25
24
|
</li>
|
|
26
25
|
</ul>
|
|
27
26
|
</nav>
|
|
28
27
|
{{else}}
|
|
29
28
|
<div class="px-4 pb-2">
|
|
30
29
|
<label class="relative block">
|
|
31
30
|
<span class="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-neutral-content/40">
|
|
32
31
|
{{{icon "search" class="h-4 w-4"}}}
|
|
33
32
|
</span>
|
|
34
33
|
<input id="table-search" type="search" placeholder="Filter tables…" autocomplete="off"
|
|
35
34
|
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" />
|
|
36
35
|
</label>
|
|
37
36
|
</div>
|
|
38
37
|
<nav class="flex-1 overflow-y-auto px-3 py-2">
|
|
39
38
|
<ul class="space-y-0.5">
|
|
40
39
|
{{#if databasesUrl}}
|
|
41
40
|
<li>
|
|
42
41
|
<a href="{{databasesUrl}}" class="side-link">
|
|
43
42
|
{{{icon "database" class="h-4 w-4"}}}
|
|
44
43
|
Databases
|
|
45
44
|
</a>
|
|
46
45
|
</li>
|
|
47
46
|
{{/if}}
|
|
48
47
|
<li>
|
|
49
48
|
<a href="{{basePath}}/home/{{encodeUri dbId}}" class="side-link {{#if (startsWith currentPath '/home')}}active{{/if}}">
|
|
50
49
|
{{{icon "home" class="h-4 w-4"}}}
|
|
51
50
|
Home
|
|
52
51
|
</a>
|
|
53
52
|
</li>
|
|
54
53
|
<li>
|
|
55
54
|
<a href="{{basePath}}/query/{{encodeUri dbId}}" class="side-link {{#if (startsWith currentPath '/query')}}active{{/if}}">
|
|
56
55
|
{{{icon "query" class="h-4 w-4"}}}
|
|
57
56
|
Query editor
|
|
58
57
|
</a>
|
|
59
58
|
</li>
|
|
60
59
|
<li>
|
|
61
60
|
<a href="{{basePath}}/erd/{{encodeUri dbId}}" class="side-link {{#if (startsWith currentPath '/erd')}}active{{/if}}">
|
|
62
61
|
{{{icon "diagram" class="h-4 w-4"}}}
|
|
63
62
|
ER Diagram
|
|
64
63
|
</a>
|
|
65
64
|
</li>
|
|
66
65
|
<li>
|
|
67
66
|
<a href="{{basePath}}/seed/{{encodeUri dbId}}" class="side-link {{#if (startsWith currentPath '/seed')}}active{{/if}}">
|
|
68
67
|
{{{icon "seed" class="h-4 w-4"}}}
|
|
69
68
|
Seed generator
|
|
70
69
|
</a>
|
|
71
70
|
</li>
|
|
72
71
|
<li>
|
|
73
72
|
<a href="{{basePath}}/info/{{encodeUri dbId}}" class="side-link {{#if (startsWith currentPath '/info')}}active{{/if}}">
|
|
74
73
|
{{{icon "settings" class="h-4 w-4"}}}
|
|
75
74
|
Info & Settings
|
|
76
75
|
</a>
|
|
77
76
|
</li>
|
|
78
77
|
{{#unless readonly}}
|
|
79
78
|
<li>
|
|
80
79
|
<a href="{{basePath}}/designer/{{encodeUri dbId}}" class="side-link {{#if (startsWith currentPath '/designer')}}active{{/if}}">
|
|
81
80
|
{{{icon "plus" class="h-4 w-4"}}}
|
|
82
81
|
New table
|
|
83
82
|
</a>
|
|
84
83
|
</li>
|
|
85
84
|
{{/unless}}
|
|
86
85
|
</ul>
|
|
87
86
|
<div class="mb-2 mt-6 flex items-center justify-between px-3">
|
|
88
87
|
<span class="text-[11px] font-semibold uppercase tracking-wider text-neutral-content/40">Tables</span>
|
|
89
88
|
<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>
|
|
90
89
|
</div>
|
|
91
90
|
<ul id="table-list" class="space-y-0.5">
|
|
92
91
|
{{#each tables}}
|
|
93
92
|
<li class="table-item" data-name="{{tableName this}}">
|
|
94
93
|
<a href="{{../basePath}}/tables/{{encodeUri ../dbId}}/{{encodeUri (tableName this)}}" class="side-link {{#if (eq ../currentTable (tableName this))}}active{{/if}}">
|
|
95
94
|
<span class="table-icon">
|
|
96
95
|
{{{icon "table" class="h-4 w-4"}}}
|
|
97
96
|
</span>
|
|
98
97
|
<span class="truncate">{{tableName this}}</span>
|
|
99
98
|
</a>
|
|
100
99
|
</li>
|
|
101
100
|
{{else}}
|
|
102
101
|
<li class="px-3 py-2 text-xs text-neutral-content/40">No tables yet</li>
|
|
103
102
|
{{/each}}
|
|
104
103
|
</ul>
|
|
105
104
|
</nav>
|
|
106
105
|
{{/if}}
|
|
107
106
|
{{#if isDefaultPassword}}
|
|
108
107
|
<div class="border-t border-white/10 px-4 py-2 bg-warning/10">
|
|
109
108
|
<div class="flex items-center justify-between text-warning text-xs font-semibold">
|
|
110
109
|
<span class="flex items-center gap-1.5 font-mono text-[11px]">
|
|
111
110
|
{{{icon "warning" class="h-3.5 w-3.5 shrink-0"}}}
|
|
112
111
|
default pass active
|
|
113
112
|
</span>
|
|
114
113
|
<span class="badge badge-warning badge-xs font-mono font-bold">admin</span>
|
|
115
114
|
</div>
|
|
116
115
|
</div>
|
|
117
116
|
{{/if}}
|
|
118
117
|
<div class="border-t border-white/10 px-5 py-3">
|
|
119
118
|
<div class="flex items-center justify-between">
|
|
120
119
|
<div class="text-[11px] font-medium uppercase tracking-wider text-neutral-content/40">{{#if databasesMode}}Directory{{else}}Engine: {{dialectName}}{{/if}}</div>
|
|
121
120
|
{{#unless databasesMode}}
|
|
122
121
|
{{#if readonly}}
|
|
123
122
|
<span class="rounded bg-warning/20 px-1.5 py-0.5 text-[9px] font-bold uppercase text-warning">Read-only</span>
|
|
124
123
|
{{else}}
|
|
125
124
|
<span class="rounded bg-success/20 px-1.5 py-0.5 text-[9px] font-bold uppercase text-success">Writable</span>
|
|
126
125
|
{{/if}}
|
|
127
126
|
{{/unless}}
|
|
128
127
|
</div>
|
|
129
128
|
<div class="mt-0.5 truncate font-mono text-[11px] text-neutral-content/60" title="{{dbPath}}">{{dbPath}}</div>
|
|
130
129
|
</div>
|
|
130
|
+
<aside class="flex h-full min-h-full w-72 flex-col bg-neutral text-neutral-content">
|
|
131
131
|
<div class="flex items-center gap-2.5 px-5 pb-4 pt-5">
|
|
132
132
|
<div class="w-full">
|
|
133
133
|
<div class="flex items-center justify-between">
|
|
134
134
|
<div class="font-headings text-base font-bold leading-tight">AdminDB <span style="font-size: x-small" class="font-sans font-normal opacity-70">{{#if version}}v{{version}}{{/if}}</span></div>
|
|
135
135
|
{{#unless databasesMode}}
|
|
136
136
|
{{#if isPostgres}}
|
|
137
137
|
<span class="rounded bg-info/20 px-1.5 py-0.5 text-[10px] font-bold text-info">PostgreSQL</span>
|
|
138
138
|
{{else}}
|
|
139
139
|
<span class="rounded bg-emerald-500/20 px-1.5 py-0.5 text-[10px] font-bold text-emerald-400">SQLite</span>
|
|
140
140
|
{{/if}}
|
|
141
141
|
{{/unless}}
|
|
142
142
|
</div>
|
|
143
143
|
<div class="mt-0.5 text-[11px] text-neutral-content/50 truncate">{{#if databasesMode}}Database manager{{else}}{{dbId}}{{/if}}</div>
|
|
144
144
|
</div>
|
|
145
145
|
</div>
|
|
146
146
|
{{#if databasesMode}}
|
|
147
147
|
<nav class="flex-1 overflow-y-auto px-3 py-2">
|
|
148
148
|
<ul class="space-y-0.5">
|
|
149
149
|
<li>
|
|
150
150
|
<a href="{{basePath}}/" class="side-link {{#if (eq currentPath '/')}}active{{/if}}">
|
|
151
151
|
{{{icon "database" class="h-4 w-4"}}}
|
|
152
152
|
Databases
|
|
153
153
|
</a>
|
|
154
154
|
</li>
|
|
155
155
|
<li>
|
|
156
156
|
<a href="{{basePath}}/diff" class="side-link {{#if (startsWith currentPath '/diff')}}active{{else}}{{#if (startsWith currentPath '/sync')}}active{{/if}}{{/if}}">
|
|
157
157
|
{{{icon "diff" class="h-4 w-4"}}}
|
|
158
158
|
Diff & Replicate
|
|
159
159
|
</a>
|
|
160
160
|
</li>
|
|
161
161
|
</ul>
|
|
162
162
|
</nav>
|
|
163
163
|
{{else}}
|
|
164
164
|
<div class="px-4 pb-2">
|
|
165
165
|
<label class="relative block">
|
|
166
166
|
<span class="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-neutral-content/40">
|
|
167
167
|
{{{icon "search" class="h-4 w-4"}}}
|
|
168
168
|
</span>
|
|
169
169
|
<input id="table-search" type="search" placeholder="Filter tables…" autocomplete="off"
|
|
170
170
|
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" />
|
|
171
171
|
</label>
|
|
172
172
|
</div>
|
|
173
173
|
<nav class="flex-1 overflow-y-auto px-3 py-2">
|
|
174
174
|
<ul class="space-y-0.5">
|
|
175
175
|
{{#if databasesUrl}}
|
|
176
176
|
<li>
|
|
177
177
|
<a href="{{databasesUrl}}" class="side-link">
|
|
178
178
|
{{{icon "database" class="h-4 w-4"}}}
|
|
179
179
|
Databases
|
|
180
180
|
</a>
|
|
181
181
|
</li>
|
|
182
182
|
{{/if}}
|
|
183
183
|
<li>
|
|
184
184
|
<a href="{{basePath}}/home/{{encodeUri dbId}}" class="side-link {{#if (startsWith currentPath '/home')}}active{{/if}}">
|
|
185
185
|
{{{icon "home" class="h-4 w-4"}}}
|
|
186
186
|
Home
|
|
187
187
|
</a>
|
|
188
188
|
</li>
|
|
189
189
|
<li>
|
|
190
190
|
<a href="{{basePath}}/query/{{encodeUri dbId}}" class="side-link {{#if (startsWith currentPath '/query')}}active{{/if}}">
|
|
191
191
|
{{{icon "query" class="h-4 w-4"}}}
|
|
192
192
|
Query editor
|
|
193
193
|
</a>
|
|
194
194
|
</li>
|
|
195
195
|
<li>
|
|
196
196
|
<a href="{{basePath}}/erd/{{encodeUri dbId}}" class="side-link {{#if (startsWith currentPath '/erd')}}active{{/if}}">
|
|
197
197
|
{{{icon "diagram" class="h-4 w-4"}}}
|
|
198
198
|
ER Diagram
|
|
199
199
|
</a>
|
|
200
200
|
</li>
|
|
201
201
|
<li>
|
|
202
202
|
<a href="{{basePath}}/seed/{{encodeUri dbId}}" class="side-link {{#if (startsWith currentPath '/seed')}}active{{/if}}">
|
|
203
203
|
{{{icon "seed" class="h-4 w-4"}}}
|
|
204
204
|
Seed generator
|
|
205
205
|
</a>
|
|
206
206
|
</li>
|
|
207
207
|
<li>
|
|
208
208
|
<a href="{{basePath}}/diff/{{encodeUri dbId}}" class="side-link {{#if (startsWith currentPath '/diff')}}active{{else}}{{#if (startsWith currentPath '/sync')}}active{{/if}}{{/if}}">
|
|
209
209
|
{{{icon "diff" class="h-4 w-4"}}}
|
|
210
210
|
Diff & Replicate
|
|
211
211
|
</a>
|
|
212
212
|
</li>
|
|
213
213
|
<li>
|
|
214
214
|
<a href="{{basePath}}/info/{{encodeUri dbId}}" class="side-link {{#if (startsWith currentPath '/info')}}active{{/if}}">
|
|
215
215
|
{{{icon "settings" class="h-4 w-4"}}}
|
|
216
216
|
Info & Settings
|
|
217
217
|
</a>
|
|
218
218
|
</li>
|
|
219
219
|
{{#unless readonly}}
|
|
220
220
|
<li>
|
|
221
221
|
<a href="{{basePath}}/designer/{{encodeUri dbId}}" class="side-link {{#if (startsWith currentPath '/designer')}}active{{/if}}">
|
|
222
222
|
{{{icon "plus" class="h-4 w-4"}}}
|
|
223
223
|
New table
|
|
224
224
|
</a>
|
|
225
225
|
</li>
|
|
226
226
|
{{/unless}}
|
|
227
227
|
</ul>
|
|
228
228
|
<div class="mb-2 mt-6 flex items-center justify-between px-3">
|
|
229
229
|
<span class="text-[11px] font-semibold uppercase tracking-wider text-neutral-content/40">Tables</span>
|
|
230
230
|
<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>
|
|
231
231
|
</div>
|
|
232
232
|
<ul id="table-list" class="space-y-0.5">
|
|
233
233
|
{{#each tables}}
|
|
234
234
|
<li class="table-item" data-name="{{tableName this}}">
|
|
235
235
|
<a href="{{../basePath}}/tables/{{encodeUri ../dbId}}/{{encodeUri (tableName this)}}" class="side-link {{#if (eq ../currentTable (tableName this))}}active{{/if}}">
|
|
236
236
|
<span class="table-icon">
|
|
237
237
|
{{{icon "table" class="h-4 w-4"}}}
|
|
238
238
|
</span>
|
|
239
239
|
<span class="truncate">{{tableName this}}</span>
|
|
240
240
|
</a>
|
|
241
241
|
</li>
|
|
242
242
|
{{else}}
|
|
243
243
|
<li class="px-3 py-2 text-xs text-neutral-content/40">No tables yet</li>
|
|
244
244
|
{{/each}}
|
|
245
245
|
</ul>
|
|
246
246
|
</nav>
|
|
247
247
|
{{/if}}
|
|
248
248
|
{{#if isDefaultPassword}}
|
|
249
249
|
<div class="border-t border-white/10 px-4 py-2 bg-warning/10">
|
|
250
250
|
<div class="flex items-center justify-between text-warning text-xs font-semibold">
|
|
251
251
|
<span class="flex items-center gap-1.5 font-mono text-[11px]">
|
|
252
252
|
{{{icon "warning" class="h-3.5 w-3.5 shrink-0"}}}
|
|
253
253
|
default pass active
|
|
254
254
|
</span>
|
|
255
255
|
<span class="badge badge-warning badge-xs font-mono font-bold">admin</span>
|
|
256
256
|
</div>
|
|
257
257
|
</div>
|
|
258
258
|
{{/if}}
|
|
259
259
|
<div class="border-t border-white/10 px-5 py-3">
|
|
260
260
|
<div class="flex items-center justify-between">
|
|
261
261
|
<div class="text-[11px] font-medium uppercase tracking-wider text-neutral-content/40">{{#if databasesMode}}Directory{{else}}Engine: {{dialectName}}{{/if}}</div>
|
|
262
262
|
{{#unless databasesMode}}
|
|
263
263
|
{{#if readonly}}
|
|
264
264
|
<span class="rounded bg-warning/20 px-1.5 py-0.5 text-[9px] font-bold uppercase text-warning">Read-only</span>
|
|
265
265
|
{{else}}
|
|
266
266
|
<span class="rounded bg-success/20 px-1.5 py-0.5 text-[9px] font-bold uppercase text-success">Writable</span>
|
|
267
267
|
{{/if}}
|
|
268
268
|
{{/unless}}
|
|
269
269
|
</div>
|
|
270
270
|
<div class="mt-0.5 truncate font-mono text-[11px] text-neutral-content/60" title="{{dbPath}}">{{dbPath}}</div>
|
|
271
271
|
</div>
|