event log UI improvements

This commit is contained in:
Shaun Walker
2019-10-23 10:13:58 -04:00
parent e710fd61ca
commit 7f9e47edb6
13 changed files with 314 additions and 19 deletions

View File

@ -3,6 +3,8 @@ using Oqtane.Models;
using System.Collections.Generic;
using Oqtane.Repository;
using Oqtane.Infrastructure;
using Microsoft.AspNetCore.Authorization;
using Oqtane.Shared;
namespace Oqtane.Controllers
{
@ -19,11 +21,20 @@ namespace Oqtane.Controllers
this.Logs = Logs;
}
// GET: api/<controller>?siteid=x
// GET: api/<controller>?siteid=x&level=y
[HttpGet]
public IEnumerable<Log> Get(string siteid)
[Authorize(Roles = Constants.AdminRole)]
public IEnumerable<Log> Get(string siteid, string level, string rows)
{
return Logs.GetLogs(int.Parse(siteid));
return Logs.GetLogs(int.Parse(siteid), level, int.Parse(rows));
}
// GET api/<controller>/5
[HttpGet("{id}")]
[Authorize(Roles = Constants.AdminRole)]
public Log Get(int id)
{
return Logs.GetLog(id);
}
// POST api/<controller>