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>

View File

@ -37,6 +37,13 @@ namespace Oqtane.Controllers
return PageModules.GetPageModule(id);
}
// GET: api/<controller>/pageid/moduleid
[HttpGet("{pageid}/{moduleid}")]
public PageModule Get(int pageid, int moduleid)
{
return PageModules.GetPageModule(pageid, moduleid);
}
// POST api/<controller>
[HttpPost]
[Authorize(Roles = Constants.AdminRole)]

View File

@ -22,6 +22,7 @@ namespace Oqtane.Controllers
// GET: api/<controller>
[HttpGet]
[Authorize(Roles = Constants.HostRole)]
public IEnumerable<Tenant> Get()
{
return Tenants.GetTenants();
@ -29,6 +30,7 @@ namespace Oqtane.Controllers
// GET api/<controller>/5
[HttpGet("{id}")]
[Authorize(Roles = Constants.HostRole)]
public Tenant Get(int id)
{
return Tenants.GetTenant(id);