aspnetcore/src/Microsoft.AspNetCore.Diagno.../Views/LogPage.Designer.cs

652 lines
18 KiB
C#

// <auto-generated/>
#pragma warning disable 1591
namespace Microsoft.AspNetCore.Diagnostics.Elm.RazorViews
{
#line hidden
#line 1 "LogPage.cshtml"
using System;
#line default
#line hidden
using System.Threading.Tasks;
#line 2 "LogPage.cshtml"
using System.Collections.Generic;
#line default
#line hidden
#line 3 "LogPage.cshtml"
using System.Globalization;
#line default
#line hidden
#line 4 "LogPage.cshtml"
using System.Linq;
#line default
#line hidden
#line 5 "LogPage.cshtml"
using Microsoft.AspNetCore.Diagnostics.Elm;
#line default
#line hidden
#line 6 "LogPage.cshtml"
using Microsoft.AspNetCore.Diagnostics.Elm.RazorViews;
#line default
#line hidden
#line 7 "LogPage.cshtml"
using Microsoft.Extensions.RazorViews;
#line default
#line hidden
#line 8 "LogPage.cshtml"
using Microsoft.Extensions.Logging;
#line default
#line hidden
internal class LogPage : Microsoft.Extensions.RazorViews.BaseView
{
#pragma warning disable 1998
public async override global::System.Threading.Tasks.Task ExecuteAsync()
{
WriteLiteral("\r\n");
#line 118 "LogPage.cshtml"
Response.ContentType = "text/html; charset=utf-8";
#line default
#line hidden
WriteLiteral(@"
<!DOCTYPE html>
<html>
<head>
<meta charset=""utf-8"" />
<title>ASP.NET Core Logs</title>
<script src=""//ajax.aspnetcdn.com/ajax/jquery/jquery-2.1.1.min.js""></script>
<style>
body {
font-size: .813em;
white-space: nowrap;
margin: 20px;
}
col:nth-child(2n) {
background-color: #FAFAFA;
}
form {
display: inline-block;
}
h1 {
margin-left: 25px;
}
table {
margin: 0px auto;
border-collapse: collapse;
border-spacing: 0px;
table-layout: fixed;
width: 100%;
}
td, th {
padding: 4px;
}
thead {
font-size: 1em;
font-family: Arial;
}
tr {
height: 23px;
}
#requestHeader {
border-bottom: solid 1px gray;
border-top: solid 1px gray;
margin-bottom: 2px;
font-size: 1em;
line-height: 2em;
}
.collapse {
color: black;
float: right;
font-weight: normal;
width: 1em;
}
.date, .time {
width: 70px;
}
.logHeader {
border-bottom: 1px ");
WriteLiteral(@"solid lightgray;
color: gray;
text-align: left;
}
.logState {
text-overflow: ellipsis;
overflow: hidden;
}
.logTd {
border-left: 1px solid gray;
padding: 0px;
}
.logs {
width: 80%;
}
.logRow:hover {
background-color: #D6F5FF;
}
.requestRow>td {
border-bottom: solid 1px gray;
}
.severity {
width: 80px;
}
.summary {
color: black;
line-height: 1.8em;
}
.summary>th {
font-weight: normal;
}
.tab {
margin-left: 30px;
}
#viewOptions {
margin: 20px;
}
#viewOptions > * {
margin: 5px;
}
body {
font-family: 'Segoe UI', Tahoma, Arial, Helvtica, sans-serif;
line-height: 1.4em;
}
h1 {
font-family: 'Segoe UI', Helvetica, sans-serif;
font-size: 2.5em;
}
td {
text-overflow: ellipsis;
overflow: hidden;
}
tr:nth-child(2n) {
background-color: #F6F6F6;
}
.critical {
background-color: red;
color: white;
}
.error {
color: red;
}
");
WriteLiteral("\r\n.information {\r\n color: blue;\r\n}\r\n\r\n.debug {\r\n color: black;\r\n}\r\n\r\n.warning {\r\n color: orange;\r\n}\r\n </style>\r\n</head>\r\n<body>\r\n <h1>ASP.NET Core Logs</h1>\r\n <form id=\"viewOptions\" method=\"get\">\r\n <select name=\"level\">\r\n");
#line 284 "LogPage.cshtml"
foreach (var severity in Enum.GetValues(typeof(LogLevel)))
{
var severityInt = (int)severity;
if ((int)Model.Options.MinLevel == severityInt)
{
#line default
#line hidden
WriteLiteral(" <option");
BeginWriteAttribute("value", " value=\"", 6741, "\"", 6761, 1);
#line 289 "LogPage.cshtml"
WriteAttributeValue("", 6749, severityInt, 6749, 12, false);
#line default
#line hidden
EndWriteAttribute();
WriteLiteral(" selected=\"selected\">");
#line 289 "LogPage.cshtml"
Write(severity);
#line default
#line hidden
WriteLiteral("</option>\r\n");
#line 290 "LogPage.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <option");
BeginWriteAttribute("value", " value=\"", 6890, "\"", 6910, 1);
#line 293 "LogPage.cshtml"
WriteAttributeValue("", 6898, severityInt, 6898, 12, false);
#line default
#line hidden
EndWriteAttribute();
WriteLiteral(">");
#line 293 "LogPage.cshtml"
Write(severity);
#line default
#line hidden
WriteLiteral("</option>\r\n");
#line 294 "LogPage.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </select>\r\n <input type=\"text\" name=\"name\"");
BeginWriteAttribute("value", " value=\"", 7023, "\"", 7056, 1);
#line 297 "LogPage.cshtml"
WriteAttributeValue("", 7031, Model.Options.NamePrefix, 7031, 25, false);
#line default
#line hidden
EndWriteAttribute();
WriteLiteral(@" />
<input type=""submit"" value=""filter"" />
</form>
<form id=""clear"" method=""post"" action="""">
<button type=""submit"" name=""clear"" value=""1"">Clear Logs</button>
</form>
<table id=""requestTable"">
<thead id=""requestHeader"">
<tr>
<th class=""path"">Path</th>
<th class=""method"">Method</th>
<th class=""host"">Host</th>
<th class=""statusCode"">Status Code</th>
<th class=""logs"">Logs</th>
</tr>
</thead>
<colgroup>
<col />
<col />
<col />
<col />
<col />
</colgroup>
");
#line 321 "LogPage.cshtml"
foreach (var activity in Model.Activities.Reverse())
{
#line default
#line hidden
WriteLiteral(" <tbody>\r\n <tr class=\"requestRow\">\r\n");
#line 325 "LogPage.cshtml"
var activityPath = Model.Path.Value + "/" + activity.Id;
if (activity.HttpInfo != null)
{
#line default
#line hidden
WriteLiteral(" \t<td><a");
BeginWriteAttribute("href", " href=\"", 8120, "\"", 8140, 1);
#line 329 "LogPage.cshtml"
WriteAttributeValue("", 8127, activityPath, 8127, 13, false);
#line default
#line hidden
EndWriteAttribute();
BeginWriteAttribute("title", " title=\"", 8141, "\"", 8172, 1);
#line 329 "LogPage.cshtml"
WriteAttributeValue("", 8149, activity.HttpInfo.Path, 8149, 23, false);
#line default
#line hidden
EndWriteAttribute();
WriteLiteral(">");
#line 329 "LogPage.cshtml"
Write(activity.HttpInfo.Path);
#line default
#line hidden
WriteLiteral("</a></td>\r\n <td>");
#line 330 "LogPage.cshtml"
Write(activity.HttpInfo.Method);
#line default
#line hidden
WriteLiteral("</td>\r\n <td>");
#line 331 "LogPage.cshtml"
Write(activity.HttpInfo.Host);
#line default
#line hidden
WriteLiteral("</td>\r\n <td>");
#line 332 "LogPage.cshtml"
Write(activity.HttpInfo.StatusCode);
#line default
#line hidden
WriteLiteral("</td>\r\n");
#line 333 "LogPage.cshtml"
}
else if (activity.RepresentsScope)
{
#line default
#line hidden
WriteLiteral(" <td colspan=\"4\"><a");
BeginWriteAttribute("href", " href=\"", 8562, "\"", 8582, 1);
#line 336 "LogPage.cshtml"
WriteAttributeValue("", 8569, activityPath, 8569, 13, false);
#line default
#line hidden
EndWriteAttribute();
BeginWriteAttribute("title", " title=\"", 8583, "\"", 8611, 1);
#line 336 "LogPage.cshtml"
WriteAttributeValue("", 8591, activity.Root.State, 8591, 20, false);
#line default
#line hidden
EndWriteAttribute();
WriteLiteral(">");
#line 336 "LogPage.cshtml"
Write(activity.Root.State);
#line default
#line hidden
WriteLiteral("</a></td>\r\n");
#line 337 "LogPage.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <td colspan=\"4\"><a");
BeginWriteAttribute("href", " href=\"", 8774, "\"", 8794, 1);
#line 340 "LogPage.cshtml"
WriteAttributeValue("", 8781, activityPath, 8781, 13, false);
#line default
#line hidden
EndWriteAttribute();
WriteLiteral(">Non-scope Log</a></td>\r\n");
#line 341 "LogPage.cshtml"
}
#line default
#line hidden
WriteLiteral(@" <td class=""logTd"">
<table class=""logTable"">
<thead class=""logHeader"">
<tr class=""headerRow"">
<th class=""date"">Date</th>
<th class=""time"">Time</th>
<th class=""name"">Name</th>
<th class=""severity"">Severity</th>
<th class=""state"">State</th>
<th>Error<span class=""collapse"">^</span></th>
</tr>
</thead>
");
#line 355 "LogPage.cshtml"
var counts = new Dictionary<string, int>();
counts["Critical"] = 0;
counts["Error"] = 0;
counts["Warning"] = 0;
counts["Information"] = 0;
counts["Debug"] = 0;
#line default
#line hidden
WriteLiteral(" <tbody class=\"logBody\">\r\n");
#line 364 "LogPage.cshtml"
if (!activity.RepresentsScope)
{
// message not within a scope
var logInfo = activity.Root.Messages.FirstOrDefault();
#line default
#line hidden
#line 368 "LogPage.cshtml"
Write(LogRow(logInfo, 0));
#line default
#line hidden
#line 368 "LogPage.cshtml"
counts[logInfo.Severity.ToString()] = 1;
}
else
{
#line default
#line hidden
#line 373 "LogPage.cshtml"
Write(Traverse(activity.Root, 0, counts));
#line default
#line hidden
#line 373 "LogPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" </tbody>\r\n <tbody class=\"summary\">\r\n <tr class=\"logRow\">\r\n <td>");
#line 378 "LogPage.cshtml"
Write(activity.Time.ToString("MM-dd-yyyy HH:mm:ss"));
#line default
#line hidden
WriteLiteral("</td>\r\n");
#line 379 "LogPage.cshtml"
foreach (var kvp in counts)
{
if (string.Equals("Debug", kvp.Key)) {
#line default
#line hidden
WriteLiteral(" <td>");
#line 382 "LogPage.cshtml"
Write(kvp.Value);
#line default
#line hidden
WriteLiteral(" ");
#line 382 "LogPage.cshtml"
Write(kvp.Key);
#line default
#line hidden
WriteLiteral("<span class=\"collapse\">v</span></td>\r\n");
#line 383 "LogPage.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <td>");
#line 386 "LogPage.cshtml"
Write(kvp.Value);
#line default
#line hidden
WriteLiteral(" ");
#line 386 "LogPage.cshtml"
Write(kvp.Key);
#line default
#line hidden
WriteLiteral("</td>\r\n");
#line 387 "LogPage.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n");
#line 395 "LogPage.cshtml"
}
#line default
#line hidden
WriteLiteral(@" </table>
<script type=""text/javascript"">
$(document).ready(function () {
$("".logBody"").hide();
$("".logTable > thead"").hide();
$("".logTable > thead"").click(function () {
$(this).closest("".logTable"").find(""tbody"").hide();
$(this).closest("".logTable"").find("".summary"").show();
$(this).hide();
});
$("".logTable > .summary"").click(function () {
$(this).closest("".logTable"").find(""tbody"").show();
$(this).closest("".logTable"").find(""thead"").show();
$(this).hide();
});
});
</script>
</body>
</html>");
}
#pragma warning restore 1998
#line 11 "LogPage.cshtml"
public LogPage(LogPageModel model)
{
Model = model;
}
public LogPageModel Model { get; set; }
public HelperResult LogRow(LogInfo log, int level)
{
return new HelperResult((writer) =>
{
if (log.Severity >= Model.Options.MinLevel &&
(string.IsNullOrEmpty(Model.Options.NamePrefix) || log.Name.StartsWith(Model.Options.NamePrefix, StringComparison.Ordinal)))
{
PushWriter(writer);
WriteLiteral(" <tr class=\"logRow\">\r\n <td>");
Write(string.Format("{0:MM/dd/yy}", log.Time));
WriteLiteral("</td>\r\n <td>");
Write(string.Format("{0:H:mm:ss}", log.Time));
WriteLiteral($"</td>\r\n <td title=\"{log.Name}\">");
Write(log.Name);
var severity = log.Severity.ToString().ToLowerInvariant();
WriteLiteral($"</td>\r\n <td class=\"{severity}\">");
Write(log.Severity);
WriteLiteral($"</td>\r\n <td title=\"{log.Message}\"> \r\n");
for (var i = 0; i < level; i++)
{
WriteLiteral(" <span class=\"tab\"></span>\r\n");
}
WriteLiteral(" ");
Write(log.Message);
WriteLiteral($"\r\n </td>\r\n <td title=\"{log.Exception}\">");
Write(log.Exception);
WriteLiteral("</td>\r\n </tr>\r\n");
PopWriter();
}
});
}
public HelperResult Traverse(ScopeNode node, int level, Dictionary<string, int> counts)
{
return new HelperResult((writer) => {
PushWriter(writer);
// print start of scope
Write(LogRow(new LogInfo()
{
Name = node.Name,
Time = node.StartTime,
Severity = LogLevel.Debug,
Message = "Beginning " + node.State,
}, level));
var messageIndex = 0;
var childIndex = 0;
while (messageIndex < node.Messages.Count && childIndex < node.Children.Count)
{
if (node.Messages[messageIndex].Time < node.Children[childIndex].StartTime)
{
Write(LogRow(node.Messages[messageIndex], level));
counts[node.Messages[messageIndex].Severity.ToString()]++;
messageIndex++;
}
else
{
Write(Traverse(node.Children[childIndex], level + 1, counts));
childIndex++;
}
}
if (messageIndex < node.Messages.Count)
{
for (var i = messageIndex; i < node.Messages.Count; i++)
{
Write(LogRow(node.Messages[i], level));
counts[node.Messages[i].Severity.ToString()]++;
}
}
else
{
for (var i = childIndex; i < node.Children.Count; i++)
{
Write(Traverse(node.Children[i], level + 1, counts));
}
}
// print end of scope
Write(LogRow(new LogInfo()
{
Name = node.Name,
Time = node.EndTime,
Severity = LogLevel.Debug,
Message = string.Format("Completed {0} in {1}ms", node.State, node.EndTime - node.StartTime)
}, level));
PopWriter();
});
}
#line default
#line hidden
}
}
#pragma warning restore 1591