This commit is contained in:
@@ -92,7 +92,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
[HttpGet()]
|
[HttpGet()]
|
||||||
public ActionResult ListLogs()
|
public ActionResult ListLogs()
|
||||||
{
|
{
|
||||||
if (serverState.IsClosed)
|
if (serverState.IsClosed)
|
||||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||||
|
|
||||||
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.LogFile))
|
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.LogFile))
|
||||||
@@ -109,21 +109,21 @@ namespace AyaNova.Api.Controllers
|
|||||||
//Iterate all log files and build return
|
//Iterate all log files and build return
|
||||||
var files = System.IO.Directory.GetFiles(ServerBootConfig.AYANOVA_LOG_PATH, "log-ayanova*.txt");
|
var files = System.IO.Directory.GetFiles(ServerBootConfig.AYANOVA_LOG_PATH, "log-ayanova*.txt");
|
||||||
|
|
||||||
Newtonsoft.Json.Linq.JObject o = Newtonsoft.Json.Linq.JObject.FromObject(new
|
// Newtonsoft.Json.Linq.JObject o = Newtonsoft.Json.Linq.JObject.FromObject(new
|
||||||
{
|
// {
|
||||||
logs =
|
// logs =
|
||||||
from f in files
|
// from f in files
|
||||||
orderby f
|
// orderby f
|
||||||
select new
|
// select new
|
||||||
{
|
// {
|
||||||
logName = System.IO.Path.GetFileName(f)
|
// 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()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user