542 lines
15 KiB
C#
542 lines
15 KiB
C#
// <auto-generated/>
|
|
#pragma warning disable 1591
|
|
namespace Microsoft.AspNetCore.Diagnostics.Elm.RazorViews
|
|
{
|
|
#line hidden
|
|
#line 1 "DetailsPage.cshtml"
|
|
using System;
|
|
|
|
#line default
|
|
#line hidden
|
|
using System.Threading.Tasks;
|
|
#line 2 "DetailsPage.cshtml"
|
|
using System.Globalization;
|
|
|
|
#line default
|
|
#line hidden
|
|
#line 3 "DetailsPage.cshtml"
|
|
using System.Linq;
|
|
|
|
#line default
|
|
#line hidden
|
|
#line 4 "DetailsPage.cshtml"
|
|
using Microsoft.AspNetCore.Diagnostics.Elm;
|
|
|
|
#line default
|
|
#line hidden
|
|
#line 5 "DetailsPage.cshtml"
|
|
using Microsoft.AspNetCore.Diagnostics.Elm.RazorViews;
|
|
|
|
#line default
|
|
#line hidden
|
|
#line 6 "DetailsPage.cshtml"
|
|
using Microsoft.Extensions.RazorViews;
|
|
|
|
#line default
|
|
#line hidden
|
|
#line 7 "DetailsPage.cshtml"
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
#line default
|
|
#line hidden
|
|
internal class DetailsPage : Microsoft.Extensions.RazorViews.BaseView
|
|
{
|
|
#pragma warning disable 1998
|
|
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
|
{
|
|
WriteLiteral("\r\n");
|
|
#line 86 "DetailsPage.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=""http://ajax.aspnetcdn.com/ajax/jquery/jquery-2.1.1.min.js""></script>
|
|
<style>
|
|
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;
|
|
}
|
|
|
|
.information {
|
|
color: blue;
|
|
}
|
|
|
|
.debug {
|
|
color: black;
|
|
}
|
|
|
|
.warning {
|
|
color: orange;
|
|
} body {
|
|
font-size: 0.9em;
|
|
width: 90%;
|
|
margin: 0px auto;
|
|
}
|
|
|
|
h1 {
|
|
padding-bottom: 10px;
|
|
}
|
|
|
|
h2 {
|
|
font-weight: normal;
|
|
}
|
|
|
|
table {
|
|
border-spacing: 0px;
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
border: 1px solid black;
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
");
|
|
WriteLiteral(@"
|
|
th {
|
|
font-family: Arial;
|
|
}
|
|
|
|
td, th {
|
|
padding: 8px;
|
|
}
|
|
|
|
#headerTable, #cookieTable {
|
|
border: none;
|
|
height: 100%;
|
|
}
|
|
|
|
#headerTd {
|
|
white-space: normal;
|
|
}
|
|
|
|
#label {
|
|
width: 20%;
|
|
border-right: 1px solid black;
|
|
}
|
|
|
|
#logs{
|
|
margin-top: 10px;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
#logs>tbody>tr>td {
|
|
border-right: 1px dashed lightgray;
|
|
}
|
|
|
|
#logs>thead>tr>th {
|
|
border: 1px solid black;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>ASP.NET Core Logs</h1>
|
|
");
|
|
#line 194 "DetailsPage.cshtml"
|
|
|
|
var context = Model.Activity?.HttpInfo;
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
#line 197 "DetailsPage.cshtml"
|
|
if (context != null)
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <h2 id=\"requestHeader\">Request Details</h2>\r\n <table id=\"requestDetails\">\r\n <colgroup><col id=\"label\" /><col /></colgroup>\r\n\r\n <tr>\r\n <th>Path</th>\r\n <td>");
|
|
#line 205 "DetailsPage.cshtml"
|
|
Write(context.Path);
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</td>\r\n </tr>\r\n <tr>\r\n <th>Host</th>\r\n <td>");
|
|
#line 209 "DetailsPage.cshtml"
|
|
Write(context.Host);
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</td>\r\n </tr>\r\n <tr>\r\n <th>Content Type</th>\r\n <td>");
|
|
#line 213 "DetailsPage.cshtml"
|
|
Write(context.ContentType);
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</td>\r\n </tr>\r\n <tr>\r\n <th>Method</th>\r\n <td>");
|
|
#line 217 "DetailsPage.cshtml"
|
|
Write(context.Method);
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</td>\r\n </tr>\r\n <tr>\r\n <th>Protocol</th>\r\n <td>");
|
|
#line 221 "DetailsPage.cshtml"
|
|
Write(context.Protocol);
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@"</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Headers</th>
|
|
<td id=""headerTd"">
|
|
<table id=""headerTable"">
|
|
<thead>
|
|
<tr>
|
|
<th>Variable</th>
|
|
<th>Value</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
");
|
|
#line 234 "DetailsPage.cshtml"
|
|
foreach (var header in context.Headers)
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <tr>\r\n <td>");
|
|
#line 237 "DetailsPage.cshtml"
|
|
Write(header.Key);
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</td>\r\n <td>");
|
|
#line 238 "DetailsPage.cshtml"
|
|
Write(string.Join(";", header.Value));
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</td>\r\n </tr>\r\n");
|
|
#line 240 "DetailsPage.cshtml"
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>Status Code</th>\r\n <td>");
|
|
#line 247 "DetailsPage.cshtml"
|
|
Write(context.StatusCode);
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</td>\r\n </tr>\r\n <tr>\r\n <th>User</th>\r\n <td>");
|
|
#line 251 "DetailsPage.cshtml"
|
|
Write(context.User.Identity.Name);
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</td>\r\n </tr>\r\n <tr>\r\n <th>Claims</th>\r\n <td>\r\n");
|
|
#line 256 "DetailsPage.cshtml"
|
|
if (context.User.Claims.Any())
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@" <table id=""claimsTable"">
|
|
<thead>
|
|
<tr>
|
|
<th>Issuer</th>
|
|
<th>Value</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
");
|
|
#line 266 "DetailsPage.cshtml"
|
|
foreach (var claim in context.User.Claims)
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <tr>\r\n <td>");
|
|
#line 269 "DetailsPage.cshtml"
|
|
Write(claim.Issuer);
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</td>\r\n <td>");
|
|
#line 270 "DetailsPage.cshtml"
|
|
Write(claim.Value);
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</td>\r\n </tr>\r\n");
|
|
#line 272 "DetailsPage.cshtml"
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </tbody>\r\n </table>\r\n");
|
|
#line 275 "DetailsPage.cshtml"
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>Scheme</th>\r\n <td>");
|
|
#line 280 "DetailsPage.cshtml"
|
|
Write(context.Scheme);
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</td>\r\n </tr>\r\n <tr>\r\n <th>Query</th>\r\n <td>");
|
|
#line 284 "DetailsPage.cshtml"
|
|
Write(context.Query.Value);
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</td>\r\n </tr>\r\n <tr>\r\n <th>Cookies</th>\r\n <td>\r\n");
|
|
#line 289 "DetailsPage.cshtml"
|
|
if (context.Cookies.Any())
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@" <table id=""cookieTable"">
|
|
<thead>
|
|
<tr>
|
|
<th>Variable</th>
|
|
<th>Value</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
");
|
|
#line 299 "DetailsPage.cshtml"
|
|
foreach (var cookie in context.Cookies)
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <tr>\r\n <td>");
|
|
#line 302 "DetailsPage.cshtml"
|
|
Write(cookie.Key);
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</td>\r\n <td>");
|
|
#line 303 "DetailsPage.cshtml"
|
|
Write(string.Join(";", cookie.Value));
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</td>\r\n </tr>\r\n");
|
|
#line 305 "DetailsPage.cshtml"
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </tbody>\r\n </table>\r\n");
|
|
#line 308 "DetailsPage.cshtml"
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n </table>\r\n");
|
|
#line 312 "DetailsPage.cshtml"
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <h2>Logs</h2>\r\n <form method=\"get\">\r\n <select name=\"level\">\r\n");
|
|
#line 316 "DetailsPage.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=\"", 8857, "\"", 8877, 1);
|
|
#line 321 "DetailsPage.cshtml"
|
|
WriteAttributeValue("", 8865, severityInt, 8865, 12, false);
|
|
|
|
#line default
|
|
#line hidden
|
|
EndWriteAttribute();
|
|
WriteLiteral(" selected=\"selected\">");
|
|
#line 321 "DetailsPage.cshtml"
|
|
Write(severity);
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</option>\r\n");
|
|
#line 322 "DetailsPage.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <option");
|
|
BeginWriteAttribute("value", " value=\"", 9006, "\"", 9026, 1);
|
|
#line 325 "DetailsPage.cshtml"
|
|
WriteAttributeValue("", 9014, severityInt, 9014, 12, false);
|
|
|
|
#line default
|
|
#line hidden
|
|
EndWriteAttribute();
|
|
WriteLiteral(">");
|
|
#line 325 "DetailsPage.cshtml"
|
|
Write(severity);
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</option>\r\n");
|
|
#line 326 "DetailsPage.cshtml"
|
|
}
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </select>\r\n <input type=\"text\" name=\"name\"");
|
|
BeginWriteAttribute("value", " value=\"", 9139, "\"", 9172, 1);
|
|
#line 329 "DetailsPage.cshtml"
|
|
WriteAttributeValue("", 9147, Model.Options.NamePrefix, 9147, 25, false);
|
|
|
|
#line default
|
|
#line hidden
|
|
EndWriteAttribute();
|
|
WriteLiteral(@" />
|
|
<input type=""submit"" value=""filter"" />
|
|
</form>
|
|
<table id=""logs"">
|
|
<thead>
|
|
<tr>
|
|
<th>Date</th>
|
|
<th>Time</th>
|
|
<th>Severity</th>
|
|
<th>Name</th>
|
|
<th>State</th>
|
|
<th>Error</th>
|
|
</tr>
|
|
</thead>
|
|
");
|
|
#line 343 "DetailsPage.cshtml"
|
|
Write(Traverse(Model.Activity.Root));
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@"
|
|
</table>
|
|
<script type=""text/javascript"">
|
|
$(document).ready(function () {
|
|
$(""#requestHeader"").click(function () {
|
|
$(""#requestDetails"").toggle();
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>");
|
|
}
|
|
#pragma warning restore 1998
|
|
#line 10 "DetailsPage.cshtml"
|
|
|
|
public DetailsPage(DetailsPageModel model)
|
|
{
|
|
Model = model;
|
|
}
|
|
|
|
public DetailsPageModel Model { get; set; }
|
|
|
|
public HelperResult LogRow(LogInfo log)
|
|
{
|
|
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>\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));
|
|
var severity = log.Severity.ToString().ToLowerInvariant();
|
|
WriteLiteral($"</td>\r\n <td class=\"{severity}\">");
|
|
Write(log.Severity);
|
|
|
|
WriteLiteral($"</td>\r\n <td title=\"{log.Name}\">");
|
|
Write(log.Name);
|
|
|
|
WriteLiteral($"</td>\r\n <td title=\"{log.Message}\""+
|
|
"class=\"logState\" width=\"100px\">");
|
|
Write(log.Message);
|
|
|
|
WriteLiteral($"</td>\r\n <td title=\"{log.Exception}\">");
|
|
Write(log.Exception);
|
|
|
|
WriteLiteral("</td>\r\n </tr>\r\n");
|
|
PopWriter();
|
|
}
|
|
});
|
|
}
|
|
|
|
public HelperResult Traverse(ScopeNode node)
|
|
{
|
|
return new HelperResult((writer) =>
|
|
{
|
|
var messageIndex = 0;
|
|
var childIndex = 0;
|
|
while (messageIndex < node.Messages.Count && childIndex < node.Children.Count)
|
|
{
|
|
if (node.Messages[messageIndex].Time < node.Children[childIndex].StartTime)
|
|
{
|
|
LogRow(node.Messages[messageIndex]);
|
|
messageIndex++;
|
|
}
|
|
else
|
|
{
|
|
Traverse(node.Children[childIndex]);
|
|
childIndex++;
|
|
}
|
|
}
|
|
if (messageIndex < node.Messages.Count)
|
|
{
|
|
for (var i = messageIndex; i < node.Messages.Count; i++)
|
|
{
|
|
LogRow(node.Messages[i]);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
for (var i = childIndex; i < node.Children.Count; i++)
|
|
{
|
|
Traverse(node.Children[i]);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
}
|
|
}
|
|
#pragma warning restore 1591
|