Added hangfire. Implemented hangfire statistics. Updated lucide icons

This commit is contained in:
2025-04-09 20:24:31 +02:00
parent 7fa46ef245
commit 55bc825cb7
12 changed files with 1157 additions and 9 deletions

View File

@@ -0,0 +1,40 @@
using Hangfire;
using Microsoft.AspNetCore.Mvc;
using MoonCore.Extended.PermFilter;
using Moonlight.Shared.Http.Responses.Admin.Hangfire;
namespace Moonlight.ApiServer.Http.Controllers.Admin.Sys;
[ApiController]
[Route("api/admin/system/hangfire")]
[RequirePermission("admin.system.hangfire")]
public class HangfireController : Controller
{
private readonly JobStorage JobStorage;
public HangfireController(JobStorage jobStorage)
{
JobStorage = jobStorage;
}
[HttpGet("stats")]
public Task<HangfireStatsResponse> GetStats()
{
var statistics = JobStorage.GetMonitoringApi().GetStatistics();
return Task.FromResult(new HangfireStatsResponse()
{
Awaiting = statistics.Awaiting,
Deleted = statistics.Deleted,
Enqueued = statistics.Enqueued,
Failed = statistics.Failed,
Processing = statistics.Processing,
Queues = statistics.Queues,
Recurring = statistics.Recurring,
Retries = statistics.Retries,
Scheduled = statistics.Scheduled,
Servers = statistics.Servers,
Succeeded = statistics.Succeeded
});
}
}