Replaced legacy dependency resolve with server service function for wingsfileaccess

This commit is contained in:
Marcel Baumgartner 2023-04-06 19:33:34 +02:00
parent e483bb7ed8
commit c18d683fb8
3 changed files with 8 additions and 27 deletions

View file

@ -2,13 +2,12 @@
@using Moonlight.App.Repositories.Servers
@using Moonlight.Shared.Components.FileManagerPartials
@using Moonlight.App.Database.Entities
@using Moonlight.App.Helpers
@using Moonlight.App.Helpers.Files
@using Moonlight.App.Services
@inject ServerRepository ServerRepository
@inject WingsApiHelper WingsApiHelper
@inject SmartTranslateService SmartTranslateService
@inject ServerService ServerService
<div class="col">
<div class="card card-body">
@ -42,14 +41,9 @@
private FileSelectModal FileSelectModal;
private LazyLoader LazyLoader;
protected override void OnInitialized()
protected override async Task OnInitializedAsync()
{
Access = new WingsFileAccess(WingsApiHelper,
null!,
CurrentServer,
null!,
null!
);
Access = await ServerService.CreateFileAccess(CurrentServer, null!);
}
private async Task Load(LazyLoader lazyLoader)

View file

@ -7,7 +7,7 @@
@using Moonlight.App.Services
@inject ServerRepository ServerRepository
@inject WingsApiHelper WingsApiHelper
@inject ServerService ServerService
@inject SmartTranslateService SmartTranslateService
<div class="col">
@ -42,14 +42,9 @@
private FileSelectModal FileSelectModal;
private LazyLoader LazyLoader;
protected override void OnInitialized()
protected override async Task OnInitializedAsync()
{
Access = new WingsFileAccess(WingsApiHelper,
null!,
CurrentServer,
null!,
null!
);
Access = await ServerService.CreateFileAccess(CurrentServer, null!);
}
private async Task Load(LazyLoader lazyLoader)

View file

@ -7,8 +7,6 @@
@inject SmartTranslateService SmartTranslateService
@inject AlertService AlertService
@inject ToastService ToastService
@inject WingsApiHelper WingsApiHelper
@inject ConfigService ConfigService
@inject ServerService ServerService
<WButton Text="@(SmartTranslateService.Translate("Reset"))"
@ -34,14 +32,8 @@
if (b)
{
await ToastService.CreateProcessToast("serverReset", SmartTranslateService.Translate("Resetting server"));
var access = new WingsFileAccess(
WingsApiHelper,
null!,
CurrentServer,
ConfigService,
null!
);
var access = await ServerService.CreateFileAccess(CurrentServer, null!);
var files = await access.Ls();