Merge pull request #49 from Moonlight-Panel/ModifyUsageOfWingsFileAccess
Replaced legacy dependency resolve with server service function for w…
This commit is contained in:
commit
271f56e992
3 changed files with 8 additions and 27 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue