event logging fix

This commit is contained in:
Shaun Walker
2019-10-28 09:02:11 -04:00
parent 72c7f4abb0
commit af423edb99
6 changed files with 83 additions and 14 deletions

View File

@ -36,8 +36,8 @@ else
<option value="100">100</option>
</select>
</div>
@if(Logs.Any())
{
@if (Logs.Any())
{
<Pager Items="@Logs">
<Header>
<th>&nbsp;</th>
@ -47,11 +47,11 @@ else
<th>Function</th>
</Header>
<Row>
<td><ActionLink Action="Detail" Parameters="@($"id=" + context.LogId.ToString())" /></td>
<td>@context.LogDate</td>
<td>@context.Level</td>
<td>@context.Feature</td>
<td>@context.Function</td>
<td class="@GetClass(context.Function)"><ActionLink Action="Detail" Parameters="@($"id=" + context.LogId.ToString())" /></td>
<td class="@GetClass(context.Function)">@context.LogDate</td>
<td class="@GetClass(context.Function)">@context.Level</td>
<td class="@GetClass(context.Function)">@context.Feature</td>
<td class="@GetClass(context.Function)">@context.Function</td>
</Row>
</Pager>
}
@ -132,4 +132,31 @@ else
{
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;
}
}

View File

@ -94,9 +94,8 @@ else
}
}
private async Task Upgrade()
private void Upgrade()
{
await InstallationService.Upgrade();
NavigationManager.NavigateTo(NavigateUrl(Reload.Application));
}