From 23aa3e94ef4471fb0efb8aa0070682e17650a433 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sat, 23 May 2020 21:19:01 +0000 Subject: [PATCH] --- .../AyaNova/Controllers/LogFilesController.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/server/AyaNova/Controllers/LogFilesController.cs b/server/AyaNova/Controllers/LogFilesController.cs index 981dcc72..58581384 100644 --- a/server/AyaNova/Controllers/LogFilesController.cs +++ b/server/AyaNova/Controllers/LogFilesController.cs @@ -92,7 +92,7 @@ namespace AyaNova.Api.Controllers [HttpGet()] public ActionResult ListLogs() { - if (serverState.IsClosed) + if (serverState.IsClosed) return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason)); if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.LogFile)) @@ -109,21 +109,21 @@ namespace AyaNova.Api.Controllers //Iterate all log files and build return var files = System.IO.Directory.GetFiles(ServerBootConfig.AYANOVA_LOG_PATH, "log-ayanova*.txt"); - Newtonsoft.Json.Linq.JObject o = Newtonsoft.Json.Linq.JObject.FromObject(new - { - logs = - from f in files - orderby f - select new - { - logName = System.IO.Path.GetFileName(f) - } - }); + // Newtonsoft.Json.Linq.JObject o = Newtonsoft.Json.Linq.JObject.FromObject(new + // { + // logs = + // from f in files + // orderby f + // select new + // { + // logName = System.IO.Path.GetFileName(f) + // } + // }); - return Ok(ApiOkResponse.Response(o)); + return Ok(ApiOkResponse.Response(files.OrderByDescending(z => z).Select(z => System.IO.Path.GetFileName(z)).ToList())); }