Refactored project to module structure
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using Moonlight.Api.Admin.Sys;
|
||||
using Moonlight.Api.Admin.Sys.Diagnose;
|
||||
using Moonlight.Api.Infrastructure.Hooks;
|
||||
|
||||
namespace Moonlight.Api.Infrastructure.Implementations;
|
||||
|
||||
public sealed class UpdateDiagnoseProvider : IDiagnoseProvider
|
||||
{
|
||||
private readonly ApplicationService ApplicationService;
|
||||
|
||||
public UpdateDiagnoseProvider(ApplicationService applicationService)
|
||||
{
|
||||
ApplicationService = applicationService;
|
||||
}
|
||||
|
||||
public Task<DiagnoseResult[]> DiagnoseAsync()
|
||||
{
|
||||
if (ApplicationService.IsUpToDate)
|
||||
return Task.FromResult<DiagnoseResult[]>([]);
|
||||
|
||||
return Task.FromResult<DiagnoseResult[]>([
|
||||
new DiagnoseResult(
|
||||
DiagnoseLevel.Warning,
|
||||
"Instance is not up-to-date",
|
||||
["Moonlight", "Update Check"],
|
||||
"Update your moonlight instance to receive bug fixes, new features and security patches. Update button can be found in the overview",
|
||||
null,
|
||||
"/admin",
|
||||
null
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user