浏览代码

Added empty file list indicator. Removed dropzone.js

Masu Baumgartner 1 年之前
父节点
当前提交
406f7cad65

文件差异内容过多而无法显示
+ 0 - 0
Moonlight/Assets/FileManager/js/dropzone.js


+ 0 - 1
Moonlight/Features/FileManager/FileManagerFeature.cs

@@ -26,7 +26,6 @@ public class FileManagerFeature : MoonlightFeature
         var config = new ConfigService<CoreConfiguration>(PathBuilder.File("storage", "configs", "core.json"));
         var config = new ConfigService<CoreConfiguration>(PathBuilder.File("storage", "configs", "core.json"));
         context.Builder.Services.AddSingleton(new JwtService<FileManagerJwtType>(config.Get().Security.Token));
         context.Builder.Services.AddSingleton(new JwtService<FileManagerJwtType>(config.Get().Security.Token));
         
         
-        context.AddAsset("FileManager", "js/dropzone.js");
         context.AddAsset("FileManager", "js/filemanager.js");
         context.AddAsset("FileManager", "js/filemanager.js");
         context.AddAsset("FileManager", "editor/ace.css");
         context.AddAsset("FileManager", "editor/ace.css");
         context.AddAsset("FileManager", "editor/ace.js");
         context.AddAsset("FileManager", "editor/ace.js");

+ 5 - 1
Moonlight/Features/FileManager/Services/FileManagerInteropService.cs

@@ -30,7 +30,11 @@ public class FileManagerInteropService
 
 
     public async Task UpdateUrl(string urlId, string url)
     public async Task UpdateUrl(string urlId, string url)
     {
     {
-        await JsRuntime.InvokeVoidAsync("filemanager.updateUrl", urlId, url);
+        try
+        {
+            await JsRuntime.InvokeVoidAsync("filemanager.updateUrl", urlId, url);
+        }
+        catch (TaskCanceledException) { /* ignored */ }
     }
     }
 
 
     [JSInvokable]
     [JSInvokable]

+ 9 - 0
Moonlight/Features/FileManager/UI/Components/FileView.razor

@@ -209,6 +209,15 @@
         }
         }
         </tbody>
         </tbody>
     </table>
     </table>
+    
+    @if (Entries.Length == 0)
+    {
+        <div class="py-4">
+            <IconAlert Color="primary" Title="No files and folders found" Icon="bx-cloud-upload">
+                Drag and drop files and folders here to start uploading them or click on the upload button on the top
+            </IconAlert>
+        </div>
+    }
 </div>
 </div>
 
 
 @if (EnableContextMenu && ContextMenuTemplate != null)
 @if (EnableContextMenu && ContextMenuTemplate != null)

部分文件因为文件数量过多而无法显示