Reimplemented the file manager with a cleaner ui, a base path protection from the core and modular and expandable

This commit is contained in:
Marcel Baumgartner
2024-03-30 00:18:40 +01:00
parent 44b2d07fdb
commit 49077e7023
28 changed files with 1986 additions and 41 deletions

View File

@@ -210,7 +210,7 @@
@code
{
[Parameter] public IFileAccess FileAccess { get; set; }
[Parameter] public BaseFileAccess FileAccess { get; set; }
[Parameter] public Func<FileEntry, bool>? Filter { get; set; }
[Parameter] public bool ShowSize { get; set; } = true;
@@ -297,7 +297,7 @@
{
await ToastService.ModifyProgress(toastId, $"[{i + 1}/{entries.Length}] Deleting '{entry.Name}'");
await FileAccess.Delete(entry.Name);
await FileAccess.Delete(entry);
i++;
}
@@ -315,7 +315,7 @@
if (string.IsNullOrEmpty(name))
return;
await FileAccess.Move(fileEntry.Name, await FileAccess.GetCurrentDirectory() + name);
await FileAccess.Move(fileEntry, await FileAccess.GetCurrentDirectory() + name);
await LazyLoader.Reload();
}
@@ -332,12 +332,12 @@
{
try
{
await SharedFileAccessService.Register(FileAccess);
var token = await SharedFileAccessService.GenerateToken(FileAccess);
var url = $"/api/download?token={token}&name={fileEntry.Name}";
//await SharedFileAccessService.Register(FileAccess);
//var token = await SharedFileAccessService.GenerateToken(FileAccess);
//var url = $"/api/download?token={token}&name={fileEntry.Name}";
await ToastService.Info("Starting download...");
Navigation.NavigateTo(url, true);
//Navigation.NavigateTo(url, true);
}
catch (Exception e)
{
@@ -429,6 +429,6 @@
public async void Dispose()
{
await SharedFileAccessService.Unregister(FileAccess);
//await SharedFileAccessService.Unregister(FileAccess);
}
}