BlueGit

timfa filemanager

Merge fix: admin modal favicon button

timfa Tim Falken · pushed by timfa

Authored 2026-05-17 · 6 months ago

Hash
4756368abcc11282b87853b8a686afba18f3b30d
4 files changed +45 −15
.github/technical-reference.md +2 −1
@@ -132,7 +132,8 @@
132 132
133 133 ## public/index.html
134 134 - Auth form - Login/setup form uses username plus mode-specific password autocomplete tokens so browser password managers behave correctly.
135 - Top bar - Includes global file search input/button controls plus an admin-only global favicon button.
135 - Top bar - Includes global file search input/button controls.
136 - Admin panel - Includes an icon-only global favicon button that opens the shared icon picker modal.
136 137 - Admin modal - Includes User Folders controls (user path + per-user size limit) and a dedicated save action for that config.
137 138 - Import map - Maps `three` and `three/addons/` to local vendored modules for client-side STL/OBJ previews.
138 139
@@ -132,7 +132,8 @@
132
132
133## public/index.html
133## public/index.html
134- Auth form - Login/setup form uses username plus mode-specific password autocomplete tokens so browser password managers behave correctly.
134- Auth form - Login/setup form uses username plus mode-specific password autocomplete tokens so browser password managers behave correctly.
135- Top bar - Includes global file search input/button controls plus an admin-only global favicon button.
135- Top bar - Includes global file search input/button controls.
136- Admin panel - Includes an icon-only global favicon button that opens the shared icon picker modal.
136- Admin modal - Includes User Folders controls (user path + per-user size limit) and a dedicated save action for that config.
137- Admin modal - Includes User Folders controls (user path + per-user size limit) and a dedicated save action for that config.
137- Import map - Maps `three` and `three/addons/` to local vendored modules for client-side STL/OBJ previews.
138- Import map - Maps `three` and `three/addons/` to local vendored modules for client-side STL/OBJ previews.
138
139
public/app.js +6 −3
@@ -1542,7 +1542,6 @@ function showApp ()
1542 1542 openFolderSidebar();
1543 1543 }
1544 1544 document.getElementById('btn-admin').classList.toggle('hidden', !STATE.isAdmin);
1545 document.getElementById('btn-global-favicon').classList.toggle('hidden', !STATE.isAdmin);
1546 1545 void refreshGlobalFavicon();
1547 1546 if (STATE.isAdmin)
1548 1547 {
@@ -3215,7 +3214,10 @@ async function openGlobalFaviconPicker ()
3215 3214 return;
3216 3215 }
3217 3216
3218 const dirPath = STATE.currentDir || (STATE.currentRoot ? STATE.currentRoot.path : null);
3217 const rootFallback = STATE.currentRoot
3218 ? STATE.currentRoot.path
3219 : (STATE.roots[0] ? STATE.roots[0].path : null);
3220 const dirPath = STATE.currentDir || rootFallback;
3219 3221 await openIconPickerModal({
3220 3222 dirPath,
3221 3223 titleText: 'Set global favicon',
@@ -4847,6 +4849,7 @@ function pulseAdminUpdateButton ()
4847 4849 async function openAdminModal ()
4848 4850 {
4849 4851 document.getElementById('admin-modal').classList.remove('hidden');
4852 await refreshGlobalFavicon();
4850 4853 await refreshAdminConfig();
4851 4854 await refreshAdminUsers();
4852 4855 await refreshAdminUpdateStatus({ pulseIfUpdateAvailable: true });
@@ -5827,7 +5830,7 @@ function wireEvents ()
5827 5830
5828 5831 // Admin panel
5829 5832 document.getElementById('btn-admin').addEventListener('click', openAdminModal);
5830 document.getElementById('btn-global-favicon').addEventListener('click', () =>
5833 document.getElementById('btn-admin-favicon').addEventListener('click', () =>
5831 5834 {
5832 5835 void openGlobalFaviconPicker();
5833 5836 });
@@ -1542,7 +1542,6 @@ function showApp ()
1542 openFolderSidebar();
1542 openFolderSidebar();
1543 }
1543 }
1544 document.getElementById('btn-admin').classList.toggle('hidden', !STATE.isAdmin);
1544 document.getElementById('btn-admin').classList.toggle('hidden', !STATE.isAdmin);
1545 document.getElementById('btn-global-favicon').classList.toggle('hidden', !STATE.isAdmin);
1546 void refreshGlobalFavicon();
1545 void refreshGlobalFavicon();
1547 if (STATE.isAdmin)
1546 if (STATE.isAdmin)
1548 {
1547 {
@@ -3215,7 +3214,10 @@ async function openGlobalFaviconPicker ()
3215 return;
3214 return;
3216 }
3215 }
3217
3216
3218 const dirPath = STATE.currentDir || (STATE.currentRoot ? STATE.currentRoot.path : null);
3217 const rootFallback = STATE.currentRoot
3218 ? STATE.currentRoot.path
3219 : (STATE.roots[0] ? STATE.roots[0].path : null);
3220 const dirPath = STATE.currentDir || rootFallback;
3219 await openIconPickerModal({
3221 await openIconPickerModal({
3220 dirPath,
3222 dirPath,
3221 titleText: 'Set global favicon',
3223 titleText: 'Set global favicon',
@@ -4847,6 +4849,7 @@ function pulseAdminUpdateButton ()
4847async function openAdminModal ()
4849async function openAdminModal ()
4848{
4850{
4849 document.getElementById('admin-modal').classList.remove('hidden');
4851 document.getElementById('admin-modal').classList.remove('hidden');
4852 await refreshGlobalFavicon();
4850 await refreshAdminConfig();
4853 await refreshAdminConfig();
4851 await refreshAdminUsers();
4854 await refreshAdminUsers();
4852 await refreshAdminUpdateStatus({ pulseIfUpdateAvailable: true });
4855 await refreshAdminUpdateStatus({ pulseIfUpdateAvailable: true });
@@ -5827,7 +5830,7 @@ function wireEvents ()
5827
5830
5828 // Admin panel
5831 // Admin panel
5829 document.getElementById('btn-admin').addEventListener('click', openAdminModal);
5832 document.getElementById('btn-admin').addEventListener('click', openAdminModal);
5830 document.getElementById('btn-global-favicon').addEventListener('click', () =>
5833 document.getElementById('btn-admin-favicon').addEventListener('click', () =>
5831 {
5834 {
5832 void openGlobalFaviconPicker();
5835 void openGlobalFaviconPicker();
5833 });
5836 });
public/index.html +12 −11
@@ -109,17 +109,6 @@
109 109 <span id="admin-update-badge" class="topbar-badge hidden" aria-hidden="true"></span>
110 110 </button>
111 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 112 <button id="btn-logout" class="icon-btn" title="Sign out" aria-label="Sign out">
124 113 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
125 114 stroke-linecap="round" stroke-linejoin="round">
@@ -199,6 +188,18 @@
199 188
200 189 <section>
201 190 <h3>Server</h3>
191 <div class="admin-favicon-row">
192 <span>Global favicon</span>
193 <button id="btn-admin-favicon" class="icon-btn icon-only" title="Set global favicon" aria-label="Set global favicon">
194 <span id="global-favicon-preview" class="global-favicon-preview" aria-hidden="true">
195 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
196 stroke-linecap="round" stroke-linejoin="round">
197 <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
198 <polyline points="14 2 14 8 20 8" />
199 </svg>
200 </span>
201 </button>
202 </div>
202 203 <button id="admin-shutdown-btn" class="danger">Shut down server</button>
203 204 </section>
204 205 </div>
@@ -109,17 +109,6 @@
109 <span id="admin-update-badge" class="topbar-badge hidden" aria-hidden="true"></span>
109 <span id="admin-update-badge" class="topbar-badge hidden" aria-hidden="true"></span>
110 </button>
110 </button>
111
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">
112 <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"
113 <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">
114 stroke-linecap="round" stroke-linejoin="round">
@@ -199,6 +188,18 @@
199
188
200 <section>
189 <section>
201 <h3>Server</h3>
190 <h3>Server</h3>
191 <div class="admin-favicon-row">
192 <span>Global favicon</span>
193 <button id="btn-admin-favicon" class="icon-btn icon-only" title="Set global favicon" aria-label="Set global favicon">
194 <span id="global-favicon-preview" class="global-favicon-preview" aria-hidden="true">
195 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
196 stroke-linecap="round" stroke-linejoin="round">
197 <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
198 <polyline points="14 2 14 8 20 8" />
199 </svg>
200 </span>
201 </button>
202 </div>
202 <button id="admin-shutdown-btn" class="danger">Shut down server</button>
203 <button id="admin-shutdown-btn" class="danger">Shut down server</button>
203 </section>
204 </section>
204 </div>
205 </div>
public/style.css +25 −0
@@ -317,6 +317,13 @@ button.danger.admin-update-highlight {
317 317 object-fit: cover;
318 318 }
319 319
320 .icon-btn.icon-only {
321 width: 2rem;
322 height: 2rem;
323 padding: 0;
324 justify-content: center;
325 }
326
320 327 /* =========================================================
321 328 MAIN + SIDEBAR LAYOUT
322 329 ========================================================= */
@@ -825,6 +832,24 @@ button.danger.admin-update-highlight {
825 832 background: var(--border);
826 833 }
827 834
835 .admin-favicon-row {
836 display: flex;
837 align-items: center;
838 justify-content: space-between;
839 margin: 0.35rem 0 0.6rem;
840 font-size: 0.88rem;
841 color: var(--text-muted);
842 }
843
844 .admin-favicon-row .icon-btn {
845 color: var(--text);
846 background: var(--surface2);
847 }
848
849 .admin-favicon-row .icon-btn:hover {
850 background: var(--border);
851 }
852
828 853 /* User list */
829 854 .user-row {
830 855 display: flex;
@@ -317,6 +317,13 @@ button.danger.admin-update-highlight {
317 object-fit: cover;
317 object-fit: cover;
318}
318}
319
319
320.icon-btn.icon-only {
321 width: 2rem;
322 height: 2rem;
323 padding: 0;
324 justify-content: center;
325}
326
320/* =========================================================
327/* =========================================================
321 MAIN + SIDEBAR LAYOUT
328 MAIN + SIDEBAR LAYOUT
322 ========================================================= */
329 ========================================================= */
@@ -825,6 +832,24 @@ button.danger.admin-update-highlight {
825 background: var(--border);
832 background: var(--border);
826}
833}
827
834
835.admin-favicon-row {
836 display: flex;
837 align-items: center;
838 justify-content: space-between;
839 margin: 0.35rem 0 0.6rem;
840 font-size: 0.88rem;
841 color: var(--text-muted);
842}
843
844.admin-favicon-row .icon-btn {
845 color: var(--text);
846 background: var(--surface2);
847}
848
849.admin-favicon-row .icon-btn:hover {
850 background: var(--border);
851}
852
828/* User list */
853/* User list */
829.user-row {
854.user-row {
830 display: flex;
855 display: flex;