mirror of
https://github.com/C9Glax/tranga.git
synced 2025-02-23 15:50:13 +01:00
API GET LogMessages new optional parameter count
This commit is contained in:
parent
28fa85f05c
commit
a4a49d40f0
@ -419,6 +419,19 @@ public class Server : GlobalBase
|
||||
SendResponse(HttpStatusCode.NotFound, response);
|
||||
break;
|
||||
}
|
||||
|
||||
if (requestVariables.TryGetValue("count", out string? count))
|
||||
{
|
||||
try
|
||||
{
|
||||
uint messageCount = uint.Parse(count);
|
||||
SendResponse(HttpStatusCode.OK, response, logger.Tail(messageCount));
|
||||
}
|
||||
catch (FormatException f)
|
||||
{
|
||||
SendResponse(HttpStatusCode.InternalServerError, response, f);
|
||||
}
|
||||
}else
|
||||
SendResponse(HttpStatusCode.OK, response, logger.GetLog());
|
||||
break;
|
||||
case "LogFile":
|
||||
|
Loading…
x
Reference in New Issue
Block a user