Show extracted names in toast and new images

This commit is contained in:
Ryan
2025-03-27 05:11:40 -04:00
committed by GitHub
parent a8f5a6d3bc
commit 64d41af21b
16 changed files with 60 additions and 37 deletions

View File

@@ -143,17 +143,23 @@ FileRise is a lightweight, secure, self-hosted web application for uploading, sy
**Light mode:**
![Light Mode](https://raw.githubusercontent.com/error311/FileRise/refs/heads/master/resources/light-mode.png)
**Dark mode default:**
![Default Layout](https://raw.githubusercontent.com/error311/FileRise/refs/heads/master/resources/dark-mode-default.png)
**Dark editor:**
![dark-editor](https://raw.githubusercontent.com/error311/FileRise/refs/heads/master/resources/dark-editor.png)
**Dark preview**
![dark-preview](https://raw.githubusercontent.com/error311/FileRise/refs/heads/master/resources/dark-preview.png)
**Light preview**
![dark-preview](https://raw.githubusercontent.com/error311/FileRise/refs/heads/master/resources/light-preview.png)
**Restore or Delete Trash:**
![restore-delete](https://raw.githubusercontent.com/error311/FileRise/refs/heads/master/resources/restore-delete.png)
![restore-delete](https://raw.githubusercontent.com/error311/FileRise/refs/heads/master/resources/light-trash.png)
**Login page:**
![Login](https://raw.githubusercontent.com/error311/FileRise/refs/heads/master/resources/login-page.png)
**Dark Login page:**
![Login](https://raw.githubusercontent.com/error311/FileRise/refs/heads/master/resources/dark-login.png)
**Gallery view:**
![Login](https://raw.githubusercontent.com/error311/FileRise/refs/heads/master/resources/dark-gallery.png)
**iphone screenshots:**
<p align="center">

View File

@@ -80,8 +80,9 @@ $srcMetadata = file_exists($srcMetaFile) ? json_decode(file_get_contents($srcMet
$destMetadata = file_exists($destMetaFile) ? json_decode(file_get_contents($destMetaFile), true) : [];
$errors = [];
$safeFileNamePattern = '/^[A-Za-z0-9_\-\.\(\) ]+$/';
$allSuccess = true;
$extractedFiles = array(); // Array to collect names of extracted files
$safeFileNamePattern = '/^[A-Za-z0-9_\-\.\(\) ]+$/';
// ---------- Process Each File ----------
foreach ($files as $zipFileName) {
@@ -115,6 +116,14 @@ foreach ($files as $zipFileName) {
$errors[] = "Failed to extract $originalName.";
$allSuccess = false;
} else {
// Collect extracted file names from this zip.
for ($i = 0; $i < $zip->numFiles; $i++) {
$entryName = $zip->getNameIndex($i);
$extractedFileName = basename($entryName);
if ($extractedFileName) {
$extractedFiles[] = $extractedFileName;
}
}
// Update metadata for each extracted file if the zip file has metadata.
if (isset($srcMetadata[$originalName])) {
$zipMeta = $srcMetadata[$originalName];
@@ -138,7 +147,7 @@ if (file_put_contents($destMetaFile, json_encode($destMetadata, JSON_PRETTY_PRIN
}
if ($allSuccess) {
echo json_encode(["success" => true]);
echo json_encode(["success" => true, "extractedFiles" => $extractedFiles]);
} else {
echo json_encode(["success" => false, "error" => implode(" ", $errors)]);
}

View File

@@ -756,7 +756,12 @@ export function handleExtractZipSelected(e) {
.then(response => response.json())
.then(data => {
if (data.success) {
showToast("Zip file(s) extracted successfully!");
// If the server returned a list of extracted files, join them into a string.
let toastMessage = "Zip file(s) extracted successfully!";
if (data.extractedFiles && Array.isArray(data.extractedFiles) && data.extractedFiles.length) {
toastMessage = "Extracted: " + data.extractedFiles.join(", ");
}
showToast(toastMessage);
loadFileList(window.currentFolder);
} else {
showToast("Error extracting zip: " + (data.error || "Unknown error"));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 574 KiB

After

Width:  |  Height:  |  Size: 626 KiB

BIN
resources/dark-gallery.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 KiB

BIN
resources/dark-login.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 KiB

After

Width:  |  Height:  |  Size: 376 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 MiB

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 KiB

After

Width:  |  Height:  |  Size: 400 KiB

BIN
resources/light-preview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

BIN
resources/light-share.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 KiB

BIN
resources/light-trash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 416 KiB

View File

@@ -1051,30 +1051,6 @@ body.dark-mode .custom-prev-next-btn:hover:not(:disabled) {
background-color: #555;
}
.folder-option:hover {
background-color: #f0f0f0;
padding: 2px 4px;
}
.folder-option.selected {
background-color: #d0d0d0;
border-radius: 4px;
padding: 2px 4px;
}
body.dark-mode .folder-option.selected {
background-color: #444;
color: #fff;
border-radius: 4px;
padding: 2px 4px;
}
body.dark-mode .folder-option:hover {
background-color: #333;
color: #fff;
padding: 2px 4px;
}
#customToast {
position: fixed;
top: 20px;
@@ -1279,15 +1255,38 @@ body.dark-mode #fileListContainer {
width: 30px;
}
.folder-option {
cursor: pointer;
}
#folderTreeContainer {
display: block;
}
.folder-option {
cursor: pointer;
}
.folder-option:hover {
background-color: #f0f0f0;
padding: 2px 4px;
}
.folder-option.selected {
background-color: #d0d0d0;
border-radius: 4px;
padding: 2px 4px;
}
body.dark-mode .folder-option.selected {
background-color: #444;
color: #fff;
border-radius: 4px;
padding: 2px 4px;
}
body.dark-mode .folder-option:hover {
background-color: #333;
color: #fff;
padding: 2px 4px;
}
/* ===========================================================
FILE MANAGER INLINE STYLE REMOVAL - New Classes
=========================================================== */
@@ -1958,6 +1957,9 @@ body.dark-mode #folderContextMenu {
#uploadFolderRow {
background-color: transparent;
}
#sidebarDropArea {
display: none;
}
body.dark-mode #sidebarDropArea,
body.dark-mode #uploadFolderRow {
@@ -2009,4 +2011,5 @@ body.dark-mode .card {
.custom-folder-card-body {
padding-top: 5px !important;
padding-right: 0 !important;
}