| 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8" /> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 6 | <title>File Manager</title> |
| 7 | <link rel="stylesheet" href="style.css" /> |
| 8 | </head> |
| 9 | <body> |
| 10 | |
| 11 | <!-- ===================================================================== |
| 12 | LOGIN / SETUP OVERLAY |
| 13 | ====================================================================== --> |
| 14 | <div id="auth-overlay" class="overlay hidden"> |
| 15 | <div class="auth-card"> |
| 16 | <h1 id="auth-title">Sign In</h1> |
| 17 | <p id="auth-subtitle" class="auth-subtitle hidden"> |
| 18 | No accounts exist yet. Create the first admin account. |
| 19 | </p> |
| 20 | <form id="auth-form" autocomplete="off"> |
| 21 | <label> |
| 22 | Username |
| 23 | <input id="auth-username" type="text" autocomplete="off" required /> |
| 24 | </label> |
| 25 | <label> |
| 26 | Password |
| 27 | <input id="auth-password" type="password" autocomplete="new-password" required /> |
| 28 | </label> |
| 29 | <p id="auth-error" class="error hidden"></p> |
| 30 | <button type="submit" id="auth-submit">Sign In</button> |
| 31 | </form> |
| 32 | </div> |
| 33 | </div> |
| 34 | |
| 35 | <!-- ===================================================================== |
| 36 | MAIN APP SHELL |
| 37 | ====================================================================== --> |
| 38 | <div id="app" class="hidden"> |
| 39 | |
| 40 | <!-- TOP BAR --> |
| 41 | <header id="topbar"> |
| 42 | <div id="breadcrumb-wrap"> |
| 43 | <nav id="breadcrumb" aria-label="Breadcrumb"></nav> |
| 44 | </div> |
| 45 | <div id="topbar-actions"> |
| 46 | <button id="btn-upload" class="icon-btn" title="Upload files" aria-label="Upload files"> |
| 47 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" |
| 48 | stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> |
| 49 | <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/> |
| 50 | <polyline points="17 8 12 3 7 8"/> |
| 51 | <line x1="12" y1="3" x2="12" y2="15"/> |
| 52 | </svg> |
| 53 | Upload |
| 54 | </button> |
| 55 | <input id="file-input" type="file" multiple class="hidden" aria-hidden="true" /> |
| 56 | |
| 57 | <button id="btn-admin" class="icon-btn hidden" title="Admin panel" aria-label="Admin panel"> |
| 58 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" |
| 59 | stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> |
| 60 | <circle cx="12" cy="8" r="4"/> |
| 61 | <path d="M6 20v-2a6 6 0 0 1 12 0v2"/> |
| 62 | </svg> |
| 63 | Admin |
| 64 | </button> |
| 65 | |
| 66 | <button id="btn-logout" class="icon-btn" title="Sign out" aria-label="Sign out"> |
| 67 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" |
| 68 | stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> |
| 69 | <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/> |
| 70 | <polyline points="16 17 21 12 16 7"/> |
| 71 | <line x1="21" y1="12" x2="9" y2="12"/> |
| 72 | </svg> |
| 73 | Sign out |
| 74 | </button> |
| 75 | </div> |
| 76 | </header> |
| 77 | |
| 78 | <!-- MAIN CONTENT AREA --> |
| 79 | <main id="main-content"> |
| 80 | |
| 81 | <!-- Drop zone hint shown when dragging files over the main area --> |
| 82 | <div id="drop-overlay" class="hidden"> |
| 83 | <span>Drop files here to upload</span> |
| 84 | </div> |
| 85 | |
| 86 | <!-- File / folder grid --> |
| 87 | <div id="file-grid"></div> |
| 88 | |
| 89 | <!-- Empty directory notice --> |
| 90 | <p id="empty-notice" class="hidden muted">This folder is empty.</p> |
| 91 | |
| 92 | </main> |
| 93 | |
| 94 | <!-- SIDEBAR --> |
| 95 | <aside id="sidebar" class="hidden"> |
| 96 | <button id="sidebar-close" aria-label="Close sidebar">✕</button> |
| 97 | <div id="sidebar-icon"></div> |
| 98 | <h2 id="sidebar-name"></h2> |
| 99 | <dl id="sidebar-meta"></dl> |
| 100 | <div id="sidebar-actions"></div> |
| 101 | </aside> |
| 102 | |
| 103 | </div> |
| 104 | |
| 105 | <!-- ===================================================================== |
| 106 | ADMIN MODAL |
| 107 | ====================================================================== --> |
| 108 | <div id="admin-modal" class="modal-overlay hidden"> |
| 109 | <div class="modal"> |
| 110 | <button class="modal-close" id="admin-modal-close" aria-label="Close admin panel">✕</button> |
| 111 | <h2>Admin Panel</h2> |
| 112 | |
| 113 | <section> |
| 114 | <h3>Configured Paths</h3> |
| 115 | <div id="admin-paths"></div> |
| 116 | <div class="path-add-row"> |
| 117 | <input id="admin-new-path" type="text" placeholder="/mnt/ssd/media" /> |
| 118 | <button id="admin-add-path">Add</button> |
| 119 | </div> |
| 120 | <button id="admin-save-paths" class="primary">Save paths</button> |
| 121 | </section> |
| 122 | |
| 123 | <section> |
| 124 | <h3>Users</h3> |
| 125 | <div id="admin-users-list"></div> |
| 126 | <button id="admin-new-user-btn" class="primary">+ New user</button> |
| 127 | </section> |
| 128 | |
| 129 | <section> |
| 130 | <h3>Server</h3> |
| 131 | <button id="admin-shutdown-btn" class="danger">Shut down server</button> |
| 132 | </section> |
| 133 | </div> |
| 134 | </div> |
| 135 | |
| 136 | <!-- NEW / EDIT USER MODAL --> |
| 137 | <div id="user-modal" class="modal-overlay hidden"> |
| 138 | <div class="modal"> |
| 139 | <button class="modal-close" id="user-modal-close" aria-label="Close">✕</button> |
| 140 | <h2 id="user-modal-title">New User</h2> |
| 141 | <form id="user-form"> |
| 142 | <label>Username<input id="user-username" type="text" required /></label> |
| 143 | <label id="user-password-label"> |
| 144 | Password<input id="user-password" type="password" placeholder="Min 8 characters" /> |
| 145 | </label> |
| 146 | <label class="checkbox-label"> |
| 147 | <input id="user-is-admin" type="checkbox" /> |
| 148 | Admin privileges |
| 149 | </label> |
| 150 | <div id="user-permissions"></div> |
| 151 | <p id="user-error" class="error hidden"></p> |
| 152 | <button type="submit" class="primary">Save</button> |
| 153 | </form> |
| 154 | </div> |
| 155 | </div> |
| 156 | |
| 157 | <!-- RENAME MODAL --> |
| 158 | <div id="rename-modal" class="modal-overlay hidden"> |
| 159 | <div class="modal small"> |
| 160 | <button class="modal-close" id="rename-modal-close" aria-label="Close">✕</button> |
| 161 | <h2>Rename</h2> |
| 162 | <form id="rename-form"> |
| 163 | <label>New name<input id="rename-input" type="text" required /></label> |
| 164 | <p id="rename-error" class="error hidden"></p> |
| 165 | <button type="submit" class="primary">Rename</button> |
| 166 | </form> |
| 167 | </div> |
| 168 | </div> |
| 169 | |
| 170 | <!-- TOAST --> |
| 171 | <div id="toast" aria-live="assertive" aria-atomic="true"></div> |
| 172 | |
| 173 | <script src="app.js"></script> |
| 174 | </body> |
| 175 | </html> |