BlueGit

timfa filemanager

Files

filemanager / public / index.html

index.html

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