BlueGit

timfa filemanager

Files

filemanager / public / index.html

index.html

index.html 13.8 KiB Download Raw
1<!DOCTYPE html>
2<html lang="en">
3
4<head>
5 <meta charset="UTF-8" />
6 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7 <title>File Manager</title>
8 <link rel="stylesheet" href="style.css" />
9</head>
10
11<body>
12
13 <!-- =====================================================================
14 LOGIN / SETUP OVERLAY
15====================================================================== -->
16 <div id="auth-overlay" class="overlay hidden">
17 <div class="auth-card">
18 <h1 id="auth-title">Sign In</h1>
19 <p id="auth-subtitle" class="auth-subtitle hidden">
20 No accounts exist yet. Create the first admin account.
21 </p>
22 <form id="auth-form" autocomplete="off">
23 <label>
24 Username
25 <input id="auth-username" name="username" type="text" autocomplete="username" required />
26 </label>
27 <label>
28 Password
29 <input id="auth-password" name="password" type="password" autocomplete="current-password" required />
30 </label>
31 <p id="auth-error" class="error hidden"></p>
32 <button type="submit" id="auth-submit">Sign In</button>
33 </form>
34 </div>
35 </div>
36
37 <!-- =====================================================================
38 MAIN APP SHELL
39====================================================================== -->
40 <div id="app" class="hidden">
41
42 <!-- TOP BAR -->
43 <header id="topbar">
44 <div id="breadcrumb-wrap">
45 <nav id="breadcrumb" aria-label="Breadcrumb"></nav>
46 </div>
47 <div id="topbar-actions">
48 <button id="btn-refresh" class="icon-btn" title="Refresh page" aria-label="Refresh page">
49 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
50 stroke-linecap="round" stroke-linejoin="round">
51 <polyline points="23 4 23 10 17 10" />
52 <polyline points="1 20 1 14 7 14" />
53 <path d="M3.51 9a9 9 0 0 1 14.13-3.36L23 10M1 14l5.36 4.36A9 9 0 0 0 20.49 15" />
54 </svg>
55 Refresh
56 </button>
57
58 <div id="top-search" class="top-search" role="search">
59 <input id="top-search-input" type="text" placeholder="Search files" aria-label="Search files" />
60 <button id="btn-search" class="icon-btn" title="Search files" aria-label="Search files">
61 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
62 stroke-linecap="round" stroke-linejoin="round">
63 <circle cx="11" cy="11" r="8" />
64 <line x1="21" y1="21" x2="16.65" y2="16.65" />
65 </svg>
66 Search
67 </button>
68 </div>
69
70 <button id="btn-upload" class="icon-btn" title="Upload files" aria-label="Upload files">
71 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
72 stroke-linecap="round" stroke-linejoin="round">
73 <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
74 <polyline points="17 8 12 3 7 8" />
75 <line x1="12" y1="3" x2="12" y2="15" />
76 </svg>
77 Upload
78 </button>
79 <input id="file-input" type="file" multiple class="hidden" aria-hidden="true" />
80 <input id="folder-input" type="file" webkitdirectory directory multiple class="hidden" aria-hidden="true" />
81
82 <button id="btn-upload-folder" class="icon-btn" title="Upload folder" aria-label="Upload folder">
83 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
84 stroke-linecap="round" stroke-linejoin="round">
85 <path d="M3 7a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
86 <path d="M12 11v6" />
87 <path d="M9 14h6" />
88 </svg>
89 Folder
90 </button>
91
92 <button id="btn-new-folder" class="icon-btn" title="Create new folder" aria-label="Create new folder">
93 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
94 stroke-linecap="round" stroke-linejoin="round">
95 <path d="M3 7a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
96 <path d="M12 11v6" />
97 <path d="M9 14h6" />
98 </svg>
99 New Folder
100 </button>
101
102 <button id="btn-admin" class="icon-btn hidden" title="Admin panel" aria-label="Admin panel">
103 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
104 stroke-linecap="round" stroke-linejoin="round">
105 <circle cx="12" cy="8" r="4" />
106 <path d="M6 20v-2a6 6 0 0 1 12 0v2" />
107 </svg>
108 <span class="icon-btn-label">Admin</span>
109 <span id="admin-update-badge" class="topbar-badge hidden" aria-hidden="true"></span>
110 </button>
111
112 <button id="btn-global-favicon" class="icon-btn hidden" title="Set global favicon" aria-label="Set global favicon">
113 <span id="global-favicon-preview" class="global-favicon-preview" aria-hidden="true">
114 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
115 stroke-linecap="round" stroke-linejoin="round">
116 <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
117 <polyline points="14 2 14 8 20 8" />
118 </svg>
119 </span>
120 Favicon
121 </button>
122
123 <button id="btn-logout" class="icon-btn" title="Sign out" aria-label="Sign out">
124 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
125 stroke-linecap="round" stroke-linejoin="round">
126 <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
127 <polyline points="16 17 21 12 16 7" />
128 <line x1="21" y1="12" x2="9" y2="12" />
129 </svg>
130 Sign out
131 </button>
132 </div>
133 </header>
134
135 <!-- MAIN CONTENT AREA -->
136 <main id="main-content">
137 <p id="folder-stats" class="muted hidden"></p>
138
139 <!-- Drop zone hint shown when dragging files over the main area -->
140 <div id="drop-overlay" class="hidden">
141 <span>Drop files here to upload</span>
142 </div>
143
144 <!-- File / folder grid -->
145 <div id="file-grid"></div>
146
147 <!-- Empty directory notice -->
148 <p id="empty-notice" class="hidden muted">This folder is empty.</p>
149
150 </main>
151
152 <!-- SIDEBAR -->
153 <aside id="sidebar" class="hidden">
154 <button id="sidebar-close" aria-label="Fold sidebar">⌄</button>
155 <div id="sidebar-icon"></div>
156 <h2 id="sidebar-name"></h2>
157 <dl id="sidebar-meta"></dl>
158 <div id="sidebar-actions"></div>
159 <div id="sidebar-duplicates" class="hidden"></div>
160 </aside>
161
162 </div>
163
164 <!-- =====================================================================
165 ADMIN MODAL
166====================================================================== -->
167 <div id="admin-modal" class="modal-overlay hidden">
168 <div class="modal">
169 <button class="modal-close" id="admin-modal-close" aria-label="Close admin panel">✕</button>
170 <h2>Admin Panel</h2>
171
172 <section id="admin-userfolder-section">
173 <h3>User Folders</h3>
174 <label>User folder path
175 <input id="admin-user-path" type="text" placeholder="/data/userfolders" />
176 </label>
177 <label>Size limit per user
178 <input id="admin-user-size-limit" type="text" placeholder="e.g. 25 MB or 1 GB" />
179 </label>
180 <p id="admin-user-size-feedback" class="admin-size-feedback hidden"></p>
181 <button id="admin-save-userpath" class="primary">Save user folder settings</button>
182 </section>
183
184 <section>
185 <h3>Configured Paths</h3>
186 <div id="admin-paths"></div>
187 <div class="path-add-row">
188 <input id="admin-new-path" type="text" placeholder="/mnt/ssd/media" />
189 <button id="admin-add-path">Add</button>
190 </div>
191 <button id="admin-save-paths" class="primary">Save paths</button>
192 </section>
193
194 <section>
195 <h3>Users</h3>
196 <div id="admin-users-list"></div>
197 <button id="admin-new-user-btn" class="primary">+ New user</button>
198 </section>
199
200 <section>
201 <h3>Server</h3>
202 <button id="admin-shutdown-btn" class="danger">Shut down server</button>
203 </section>
204 </div>
205 </div>
206
207 <!-- NEW / EDIT USER MODAL -->
208 <div id="user-modal" class="modal-overlay hidden">
209 <div class="modal">
210 <button class="modal-close" id="user-modal-close" aria-label="Close">✕</button>
211 <h2 id="user-modal-title">New User</h2>
212 <form id="user-form">
213 <label>Username<input id="user-username" type="text" autocomplete="username" required /></label>
214 <label id="user-password-label">
215 Password<input id="user-password" type="password" placeholder="Min 8 characters"
216 autocomplete="new-password" />
217 </label>
218 <label class="checkbox-label">
219 <input id="user-is-admin" type="checkbox" />
220 Admin privileges
221 </label>
222 <div id="user-permissions"></div>
223 <p id="user-error" class="error hidden"></p>
224 <button type="submit" class="primary">Save</button>
225 </form>
226 </div>
227 </div>
228
229 <!-- RENAME MODAL -->
230 <div id="rename-modal" class="modal-overlay hidden">
231 <div class="modal small">
232 <button class="modal-close" id="rename-modal-close" aria-label="Close">✕</button>
233 <h2>Rename</h2>
234 <form id="rename-form">
235 <label>New name<input id="rename-input" type="text" required /></label>
236 <p id="rename-error" class="error hidden"></p>
237 <button type="submit" class="primary">Rename</button>
238 </form>
239 </div>
240 </div>
241
242 <!-- CONFIRM MODAL -->
243 <div id="confirm-modal" class="modal-overlay hidden" role="dialog" aria-modal="true"
244 aria-labelledby="confirm-modal-title">
245 <div class="modal small">
246 <h2 id="confirm-modal-title"></h2>
247 <p id="confirm-modal-message" class="dialog-message"></p>
248 <div class="dialog-actions">
249 <button id="confirm-modal-cancel">Cancel</button>
250 <button id="confirm-modal-ok" class="primary">OK</button>
251 </div>
252 </div>
253 </div>
254
255 <!-- PROMPT MODAL -->
256 <div id="prompt-modal" class="modal-overlay hidden" role="dialog" aria-modal="true"
257 aria-labelledby="prompt-modal-title">
258 <div class="modal small">
259 <h2 id="prompt-modal-title"></h2>
260 <p id="prompt-modal-message" class="dialog-message"></p>
261 <form id="prompt-modal-form">
262 <label id="prompt-modal-label"><input id="prompt-modal-input" type="text" /></label>
263 <p id="prompt-modal-error" class="error hidden"></p>
264 <div class="dialog-actions">
265 <button type="button" id="prompt-modal-cancel">Cancel</button>
266 <button type="submit" class="primary">OK</button>
267 </div>
268 </form>
269 </div>
270 </div>
271
272 <!-- OVERWRITE MODAL -->
273 <div id="overwrite-modal" class="modal-overlay hidden" role="dialog" aria-modal="true"
274 aria-labelledby="overwrite-modal-title">
275 <div class="modal small">
276 <h2 id="overwrite-modal-title">File already exists</h2>
277 <p class="dialog-message">
278 <strong id="overwrite-modal-filename"></strong> already exists in the destination folder.
279 What would you like to do?
280 </p>
281 <div class="dialog-actions dialog-actions--overwrite">
282 <button id="overwrite-modal-skip-all">Skip all</button>
283 <button id="overwrite-modal-no">Skip</button>
284 <button id="overwrite-modal-all" class="primary">Overwrite all</button>
285 <button id="overwrite-modal-yes" class="primary">Overwrite</button>
286 </div>
287 </div>
288 </div>
289
290 <!-- FILE CONFLICT MODAL (single upload/move) -->
291 <div id="file-conflict-modal" class="modal-overlay hidden" role="dialog" aria-modal="true"
292 aria-labelledby="file-conflict-title">
293 <div class="modal small">
294 <h2 id="file-conflict-title">File conflict</h2>
295 <p class="dialog-message">
296 <strong id="file-conflict-filename"></strong> already exists in the destination folder.
297 </p>
298 <p class="dialog-message">
299 Rename to <strong id="file-conflict-rename"></strong>?
300 </p>
301 <div class="dialog-actions">
302 <button id="file-conflict-cancel">Cancel</button>
303 <button id="file-conflict-overwrite" class="primary">Overwrite</button>
304 <button id="file-conflict-rename-btn" class="primary">Rename</button>
305 </div>
306 </div>
307 </div>
308
309 <!-- FILE PREVIEW OVERLAY -->
310 <!-- TOAST -->
311 <div id="toast" aria-live="assertive" aria-atomic="true"></div>
312
313 <!-- SHARE MODAL -->
314 <div id="share-modal" class="modal-overlay hidden" role="dialog" aria-modal="true"
315 aria-labelledby="share-modal-title">
316 <div class="modal small">
317 <button class="modal-close" id="share-modal-close" aria-label="Close">✕</button>
318 <h2 id="share-modal-title">Share</h2>
319 <p class="dialog-message" id="share-modal-msg">This link is valid for 24 hours.</p>
320 <div id="share-url-row" style="display:flex;gap:0.5rem;margin:0.8rem 0">
321 <input id="share-url-input" type="text" readonly
322 style="flex:1;font-size:0.82rem;background:var(--surface2);border:1px solid var(--border);border-radius:6px;padding:0.45rem 0.65rem;color:var(--text);min-width:0" />
323 <button id="share-copy-btn" title="Copy link">Copy</button>
324 </div>
325 <div class="dialog-actions">
326 <button class="primary" id="share-modal-ok">OK</button>
327 </div>
328 </div>
329 </div>
330
331 <link rel="stylesheet" href="drag-move.css" />
332 <script type="importmap">
333 {
334 "imports": {
335 "three": "/vendor/three/three.module.js",
336 "three/addons/": "/vendor/three/addons/"
337 }
338 }
339 </script>
340 <script src="drag-move.js"></script>
341 <script src="app.js"></script>
342</body>
343
344</html>