BlueGit

timfa filemanager

Files

filemanager / public / index.html

index.html

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