- Add media_folders_management config flag (enabled by default) - Guard folder CRUD endpoints with 403 when management disabled - Wire up frontend folder add/edit/delete in Settings tab - Add per-folder availability check (for network shares) - Show unavailable badge on offline folders in browser view - Expose management flag via /api/health endpoint - Add EN/RU locale keys for folder management UI
This commit is contained in:
@@ -57,6 +57,7 @@ import {
|
||||
onBrowserSearch, clearBrowserSearch, onItemsPerPageChanged,
|
||||
downloadFile, closeFolderDialog, saveFolder,
|
||||
showManageFoldersDialog,
|
||||
showAddFolderDialog, showEditFolderDialog, deleteFolderConfirm,
|
||||
} from './browser.js';
|
||||
|
||||
import {
|
||||
@@ -117,6 +118,7 @@ Object.assign(window, {
|
||||
onBrowserSearch, clearBrowserSearch, onItemsPerPageChanged,
|
||||
downloadFile, closeFolderDialog, saveFolder,
|
||||
showManageFoldersDialog,
|
||||
showAddFolderDialog, showEditFolderDialog, deleteFolderConfirm,
|
||||
// Links
|
||||
showAddLinkDialog, showEditLinkDialog, closeLinkDialog,
|
||||
saveLink, deleteLinkConfirm,
|
||||
@@ -323,6 +325,24 @@ window.addEventListener('DOMContentLoaded', async () => {
|
||||
else if (action === 'delete') deleteCallbackConfirm(name);
|
||||
});
|
||||
|
||||
// Folder dialog backdrop click to close
|
||||
const folderDialog = document.getElementById('folderDialog');
|
||||
folderDialog.addEventListener('click', (e) => {
|
||||
if (e.target === folderDialog) {
|
||||
closeFolderDialog();
|
||||
}
|
||||
});
|
||||
|
||||
// Delegated click handlers for folder table actions
|
||||
document.getElementById('foldersTableBody').addEventListener('click', (e) => {
|
||||
const btn = e.target.closest('[data-action]');
|
||||
if (!btn) return;
|
||||
const action = btn.dataset.action;
|
||||
const folderId = btn.dataset.folderId;
|
||||
if (action === 'edit') showEditFolderDialog(folderId);
|
||||
else if (action === 'delete') deleteFolderConfirm(folderId);
|
||||
});
|
||||
|
||||
// Link dialog backdrop click to close
|
||||
const linkDialog = document.getElementById('linkDialog');
|
||||
linkDialog.addEventListener('click', (e) => {
|
||||
@@ -352,7 +372,7 @@ window.addEventListener('DOMContentLoaded', async () => {
|
||||
|
||||
// Initialize browser toolbar and load folders
|
||||
initBrowserToolbar();
|
||||
if (token) {
|
||||
if (!authReq || token) {
|
||||
loadMediaFolders();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user