33 lines
1019 B
C#
33 lines
1019 B
C#
using Moonlight.Api.Interfaces;
|
|
using Moonlight.Api.Models;
|
|
using Moonlight.Api.Services;
|
|
|
|
namespace Moonlight.Api.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
|
|
)
|
|
]);
|
|
}
|
|
} |