Reimplemented filemanager and fixed some bugs
This commit is contained in:
47
Moonlight/Features/Servers/UI/UserViews/Files.razor
Normal file
47
Moonlight/Features/Servers/UI/UserViews/Files.razor
Normal file
@@ -0,0 +1,47 @@
|
||||
@using Moonlight.Core.Configuration
|
||||
@using Moonlight.Core.Services.Utils
|
||||
@using Moonlight.Features.FileManager.Models.Abstractions.FileAccess
|
||||
@using Moonlight.Features.Servers.Entities
|
||||
@using Moonlight.Features.ServiceManagement.Entities
|
||||
@using MoonCore.Services
|
||||
@using Moonlight.Features.FileManager.UI.Components
|
||||
@using Moonlight.Features.Servers.Helpers
|
||||
|
||||
@inject JwtService JwtService
|
||||
@inject ConfigService<ConfigV1> ConfigService
|
||||
|
||||
@implements IDisposable
|
||||
|
||||
<LazyLoader Load="Load" ShowAsCard="true">
|
||||
<FileManager FileAccess="FileAccess" />
|
||||
</LazyLoader>
|
||||
|
||||
@code
|
||||
{
|
||||
[CascadingParameter] public Service Service { get; set; }
|
||||
|
||||
[CascadingParameter] public Server Server { get; set; }
|
||||
|
||||
private IFileAccess FileAccess;
|
||||
|
||||
private async Task Load(LazyLoader lazyLoader)
|
||||
{
|
||||
var ftpLoginJwt = await JwtService.Create(data =>
|
||||
{
|
||||
data.Add("ServerId", Server.Id.ToString());
|
||||
}, "FtpServerLogin", TimeSpan.FromMinutes(5));
|
||||
|
||||
FileAccess = new ServerFtpFileAccess(
|
||||
Server.Node.Fqdn,
|
||||
Server.Node.FtpPort,
|
||||
$"moonlight.{Server.Id}",
|
||||
ftpLoginJwt,
|
||||
ConfigService.Get().FileManager.OperationTimeout
|
||||
);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
FileAccess.Dispose();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user