From c8a02a8daa92f1fa34c5d4b044b51a84a5286f71 Mon Sep 17 00:00:00 2001 From: jpirnay Date: Mon, 20 Apr 2026 08:44:43 +0200 Subject: [PATCH] Folder move, multiple items move --- src/network/CrossPointWebServer.cpp | 23 ++-- src/network/html/FilesPage.html | 170 +++++++++++++++++++++------- src/network/html/SettingsPage.html | 21 ++++ 3 files changed, 159 insertions(+), 55 deletions(-) diff --git a/src/network/CrossPointWebServer.cpp b/src/network/CrossPointWebServer.cpp index 77049ff3..0fb9efb7 100644 --- a/src/network/CrossPointWebServer.cpp +++ b/src/network/CrossPointWebServer.cpp @@ -998,13 +998,6 @@ void CrossPointWebServer::handleMove() const { server->send(403, "text/plain", "Cannot move protected item"); return; } - if (destPath != "/") { - const String destName = destPath.substring(destPath.lastIndexOf('/') + 1); - if (isProtectedItemName(destName)) { - server->send(403, "text/plain", "Cannot move into protected folder"); - return; - } - } if (!Storage.exists(itemPath.c_str())) { server->send(404, "text/plain", "Item not found"); @@ -1210,9 +1203,9 @@ void CrossPointWebServer::handleSettingsPage() const { void CrossPointWebServer::handleGetSettings() const { const auto& settings = getSettingsList(); - server->setContentLength(CONTENT_LENGTH_UNKNOWN); - server->send(200, "application/json", ""); - server->sendContent("["); + String result; + result.reserve(4096); + result += "["; char output[512]; constexpr size_t outputSize = sizeof(output); @@ -1226,6 +1219,8 @@ void CrossPointWebServer::handleGetSettings() const { doc["key"] = s.key; doc["name"] = I18N.get(s.nameId); doc["category"] = I18N.get(s.category); + doc["subcategory"] = s.subcategory != StrId::STR_NONE_OPT ? I18N.get(s.subcategory) : ""; + doc["submenu"] = s.submenu != StrId::STR_NONE_OPT ? I18N.get(s.submenu) : ""; switch (s.type) { case SettingType::TOGGLE: { @@ -1278,15 +1273,15 @@ void CrossPointWebServer::handleGetSettings() const { } if (seenFirst) { - server->sendContent(","); + result += ","; } else { seenFirst = true; } - server->sendContent(output); + result += output; } - server->sendContent("]"); - server->sendContent(""); + result += "]"; + server->send(200, "application/json", result); LOG_DBG("WEB", "Served settings API"); } diff --git a/src/network/html/FilesPage.html b/src/network/html/FilesPage.html index 7b95966e..fc751eb3 100644 --- a/src/network/html/FilesPage.html +++ b/src/network/html/FilesPage.html @@ -159,6 +159,14 @@ background-color: #d68910; } + .move-action-btn { + background-color: #2980b9; + } + + .move-action-btn:hover { + background-color: #2471a3; + } + .delete-action-btn { background-color: #e74c3c; } @@ -167,6 +175,11 @@ background-color: #c0392b; } + .action-btn:disabled { + opacity: 0.35; + cursor: not-allowed; + } + /* Drag & drop overlay */ .drop-overlay { display: none; @@ -1786,7 +1799,8 @@
- + +
@@ -2042,12 +2056,10 @@