event logging fix
This commit is contained in:
parent
72c7f4abb0
commit
af423edb99
|
@ -47,11 +47,11 @@ else
|
||||||
<th>Function</th>
|
<th>Function</th>
|
||||||
</Header>
|
</Header>
|
||||||
<Row>
|
<Row>
|
||||||
<td><ActionLink Action="Detail" Parameters="@($"id=" + context.LogId.ToString())" /></td>
|
<td class="@GetClass(context.Function)"><ActionLink Action="Detail" Parameters="@($"id=" + context.LogId.ToString())" /></td>
|
||||||
<td>@context.LogDate</td>
|
<td class="@GetClass(context.Function)">@context.LogDate</td>
|
||||||
<td>@context.Level</td>
|
<td class="@GetClass(context.Function)">@context.Level</td>
|
||||||
<td>@context.Feature</td>
|
<td class="@GetClass(context.Function)">@context.Feature</td>
|
||||||
<td>@context.Function</td>
|
<td class="@GetClass(context.Function)">@context.Function</td>
|
||||||
</Row>
|
</Row>
|
||||||
</Pager>
|
</Pager>
|
||||||
}
|
}
|
||||||
|
@ -132,4 +132,31 @@ else
|
||||||
{
|
{
|
||||||
Logs = await LogService.GetLogsAsync(PageState.Site.SiteId, ((level == "-") ? "" : level), ((function == "-") ? "" : function), int.Parse(rows));
|
Logs = await LogService.GetLogsAsync(PageState.Site.SiteId, ((level == "-") ? "" : level), ((function == "-") ? "" : function), int.Parse(rows));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetClass(string function)
|
||||||
|
{
|
||||||
|
string classname = "";
|
||||||
|
switch (function)
|
||||||
|
{
|
||||||
|
case "Create":
|
||||||
|
classname = "table-primary";
|
||||||
|
break;
|
||||||
|
case "Read":
|
||||||
|
classname = "table-secondary";
|
||||||
|
break;
|
||||||
|
case "Update":
|
||||||
|
classname = "table-success";
|
||||||
|
break;
|
||||||
|
case "Delete":
|
||||||
|
classname = "table-danger";
|
||||||
|
break;
|
||||||
|
case "Security":
|
||||||
|
classname = "table-warning";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
classname = "";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return classname;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -94,9 +94,8 @@ else
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task Upgrade()
|
private void Upgrade()
|
||||||
{
|
{
|
||||||
await InstallationService.Upgrade();
|
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Application));
|
NavigationManager.NavigateTo(NavigateUrl(Reload.Application));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<p>
|
<p>
|
||||||
@if(Format == "Table")
|
@if(Format == "Table")
|
||||||
{
|
{
|
||||||
<table class="table table-borderless">
|
<table class="@Class">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>@Header</tr>
|
<tr>@Header</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
}
|
}
|
||||||
@if(Format == "Grid")
|
@if(Format == "Grid")
|
||||||
{
|
{
|
||||||
<div class="container">
|
<div class="@Class">
|
||||||
<div class="row">@Header</div>
|
<div class="row">@Header</div>
|
||||||
@foreach (var item in ItemList)
|
@foreach (var item in ItemList)
|
||||||
{
|
{
|
||||||
|
@ -81,6 +81,9 @@
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string DisplayPages { get; set; }
|
public string DisplayPages { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public string Class { get; set; }
|
||||||
|
|
||||||
IEnumerable<TableItem> ItemList { get; set; }
|
IEnumerable<TableItem> ItemList { get; set; }
|
||||||
|
|
||||||
protected override void OnParametersSet()
|
protected override void OnParametersSet()
|
||||||
|
@ -89,6 +92,17 @@
|
||||||
{
|
{
|
||||||
Format = "Table";
|
Format = "Table";
|
||||||
}
|
}
|
||||||
|
if (string.IsNullOrEmpty(Class))
|
||||||
|
{
|
||||||
|
if (Format == "Table")
|
||||||
|
{
|
||||||
|
Class = "table table-borderless";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Class = "container";
|
||||||
|
}
|
||||||
|
}
|
||||||
if (string.IsNullOrEmpty(PageSize))
|
if (string.IsNullOrEmpty(PageSize))
|
||||||
{
|
{
|
||||||
MaxItems = 10;
|
MaxItems = 10;
|
||||||
|
|
24
Oqtane.Framework.nuspec
Normal file
24
Oqtane.Framework.nuspec
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
|
<metadata>
|
||||||
|
<id>Oqtane.Framework</id>
|
||||||
|
<version>0.0.1</version>
|
||||||
|
<authors>Shaun Walker</authors>
|
||||||
|
<owners>.NET Foundation</owners>
|
||||||
|
<title>Oqtane Framework</title>
|
||||||
|
<description>A modular application framework for Blazor</description>
|
||||||
|
<copyright>.NET Foundation</copyright>
|
||||||
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
|
<license type="expression">MIT</license>
|
||||||
|
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
||||||
|
<iconUrl>https://www.oqtane.org/Portals/0/icon.jpg</iconUrl>
|
||||||
|
<tags>oqtane framework</tags>
|
||||||
|
<releaseNotes>Initial Release</releaseNotes>
|
||||||
|
<summary>A modular application framework for Blazor</summary>
|
||||||
|
</metadata>
|
||||||
|
<files>
|
||||||
|
<file src="Oqtane.Client\bin\Release\netstandard2.0\Oqtane.Client.dll" target="lib" />
|
||||||
|
<file src="Oqtane.Server\bin\Release\netcoreapp3.0\Oqtane.Server.dll" target="lib" />
|
||||||
|
<file src="Oqtane.Shared\bin\Release\netstandard2.0\Oqtane.Shared.dll" target="lib" />
|
||||||
|
</files>
|
||||||
|
</package>
|
|
@ -47,15 +47,17 @@ namespace Oqtane.Infrastructure
|
||||||
log.Url = request.Scheme.ToString() + "://" + request.Host.ToString() + request.Path.ToString() + request.QueryString.ToString();
|
log.Url = request.Scheme.ToString() + "://" + request.Host.ToString() + request.Path.ToString() + request.QueryString.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Class.GetType() != null)
|
Type type = Type.GetType(Class.ToString());
|
||||||
|
if (type != null)
|
||||||
{
|
{
|
||||||
log.Category = Class.GetType().AssemblyQualifiedName;
|
log.Category = type.AssemblyQualifiedName;
|
||||||
|
log.Feature = Utilities.GetTypeNameLastSegment(log.Category, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log.Category = Class.ToString();
|
log.Category = Class.ToString();
|
||||||
|
log.Feature = log.Category;
|
||||||
}
|
}
|
||||||
log.Feature = Utilities.GetTypeNameLastSegment(log.Category, 0);
|
|
||||||
log.Function = Enum.GetName(typeof(LogFunction), Function);
|
log.Function = Enum.GetName(typeof(LogFunction), Function);
|
||||||
log.Level = Enum.GetName(typeof(LogLevel), Level);
|
log.Level = Enum.GetName(typeof(LogLevel), Level);
|
||||||
if (Exception != null)
|
if (Exception != null)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user