grouping elm by activity context
This commit is contained in:
parent
71a4c18598
commit
4f75ae6485
|
|
@ -14,5 +14,7 @@ namespace Microsoft.AspNet.Diagnostics.Elm
|
|||
public DateTimeOffset Time { get; set; }
|
||||
|
||||
public bool IsCollapsed { get; set; }
|
||||
|
||||
public bool RepresentsScope { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -45,7 +45,7 @@ namespace Microsoft.AspNet.Diagnostics.Elm
|
|||
else
|
||||
{
|
||||
var context = GetNewActivityContext();
|
||||
context.Id = Guid.Empty; // mark as a non-scope log
|
||||
context.RepresentsScope = false; // mark as a non-scope log
|
||||
context.Root = new ScopeNode();
|
||||
context.Root.Messages.Add(info);
|
||||
_store.AddActivity(context);
|
||||
|
|
@ -69,7 +69,8 @@ namespace Microsoft.AspNet.Diagnostics.Elm
|
|||
return new ActivityContext()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Time = DateTimeOffset.UtcNow
|
||||
Time = DateTimeOffset.UtcNow,
|
||||
RepresentsScope = true
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ namespace Microsoft.AspNet.Diagnostics.Elm
|
|||
}
|
||||
else
|
||||
{
|
||||
RenderRequestDetailsPage(options, context);
|
||||
RenderDetailsPage(options, context);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -66,24 +66,23 @@ namespace Microsoft.AspNet.Diagnostics.Elm
|
|||
await logPage.ExecuteAsync(context);
|
||||
}
|
||||
|
||||
private async void RenderRequestDetailsPage(ViewOptions options, HttpContext context)
|
||||
private async void RenderDetailsPage(ViewOptions options, HttpContext context)
|
||||
{
|
||||
var parts = context.Request.Path.Value.Split('/');
|
||||
var id = Guid.Empty;
|
||||
if (!Guid.TryParse(parts[parts.Length - 1], out id))
|
||||
{
|
||||
context.Response.StatusCode = 400;
|
||||
await context.Response.WriteAsync("Invalid Request Id");
|
||||
await context.Response.WriteAsync("Invalid Id");
|
||||
return;
|
||||
}
|
||||
var model = new RequestPageModel()
|
||||
var model = new DetailsPageModel()
|
||||
{
|
||||
RequestID = id,
|
||||
Activity = _store.GetActivities().Where(a => a.HttpInfo?.RequestID == id).FirstOrDefault(),
|
||||
Activity = _store.GetActivities().Where(a => a.Id == id).FirstOrDefault(),
|
||||
Options = options
|
||||
};
|
||||
var requestPage = new RequestPage(model);
|
||||
await requestPage.ExecuteAsync(context);
|
||||
var detailsPage = new DetailsPage(model);
|
||||
await detailsPage.ExecuteAsync(context);
|
||||
}
|
||||
|
||||
private async Task<Tuple<ViewOptions, bool>> ParseParams(HttpContext context)
|
||||
|
|
|
|||
|
|
@ -1,42 +1,42 @@
|
|||
namespace Microsoft.AspNet.Diagnostics.Elm.Views
|
||||
{
|
||||
#line 1 "RequestPage.cshtml"
|
||||
#line 1 "DetailsPage.cshtml"
|
||||
using System
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
;
|
||||
#line 2 "RequestPage.cshtml"
|
||||
#line 2 "DetailsPage.cshtml"
|
||||
using System.Globalization
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
;
|
||||
#line 3 "RequestPage.cshtml"
|
||||
#line 3 "DetailsPage.cshtml"
|
||||
using System.Linq
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
;
|
||||
#line 4 "RequestPage.cshtml"
|
||||
#line 4 "DetailsPage.cshtml"
|
||||
using Microsoft.AspNet.Diagnostics.Elm
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
;
|
||||
#line 5 "RequestPage.cshtml"
|
||||
#line 5 "DetailsPage.cshtml"
|
||||
using Microsoft.AspNet.Diagnostics.Views
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
;
|
||||
#line 6 "RequestPage.cshtml"
|
||||
#line 6 "DetailsPage.cshtml"
|
||||
using Microsoft.AspNet.Diagnostics.Elm.Views
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
;
|
||||
#line 7 "RequestPage.cshtml"
|
||||
#line 7 "DetailsPage.cshtml"
|
||||
using Microsoft.Framework.Logging
|
||||
|
||||
#line default
|
||||
|
|
@ -44,17 +44,17 @@ using Microsoft.Framework.Logging
|
|||
;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public class RequestPage : Microsoft.AspNet.Diagnostics.Views.BaseView
|
||||
public class DetailsPage : Microsoft.AspNet.Diagnostics.Views.BaseView
|
||||
{
|
||||
public HelperResult
|
||||
#line 19 "RequestPage.cshtml"
|
||||
#line 19 "DetailsPage.cshtml"
|
||||
LogRow(LogInfo log)
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
return new HelperResult((__razor_helper_writer) => {
|
||||
#line 20 "RequestPage.cshtml"
|
||||
#line 20 "DetailsPage.cshtml"
|
||||
|
||||
if (log.Severity >= Model.Options.MinLevel &&
|
||||
(string.IsNullOrEmpty(Model.Options.NamePrefix) || log.Name.StartsWith(Model.Options.NamePrefix, StringComparison.Ordinal)))
|
||||
|
|
@ -64,13 +64,13 @@ LogRow(LogInfo log)
|
|||
#line hidden
|
||||
|
||||
WriteLiteralTo(__razor_helper_writer, " <tr>\r\n <td>");
|
||||
#line 25 "RequestPage.cshtml"
|
||||
#line 25 "DetailsPage.cshtml"
|
||||
WriteTo(__razor_helper_writer, string.Format("{0:MM/dd/yy}", log.Time));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteralTo(__razor_helper_writer, "</td>\r\n <td>");
|
||||
#line 26 "RequestPage.cshtml"
|
||||
#line 26 "DetailsPage.cshtml"
|
||||
WriteTo(__razor_helper_writer, string.Format("{0:H:mm:ss}", log.Time));
|
||||
|
||||
#line default
|
||||
|
|
@ -79,7 +79,7 @@ WriteTo(__razor_helper_writer, string.Format("{0:H:mm:ss}", log.Time));
|
|||
WriteAttributeTo(__razor_helper_writer, "class", Tuple.Create(" class=\"", 768), Tuple.Create("\"", 819),
|
||||
Tuple.Create(Tuple.Create("", 776), Tuple.Create<System.Object, System.Int32>(log.Severity.ToString().ToLowerInvariant(), 776), false));
|
||||
WriteLiteralTo(__razor_helper_writer, ">");
|
||||
#line 27 "RequestPage.cshtml"
|
||||
#line 27 "DetailsPage.cshtml"
|
||||
WriteTo(__razor_helper_writer, log.Severity);
|
||||
|
||||
#line default
|
||||
|
|
@ -88,7 +88,7 @@ WriteTo(__razor_helper_writer, string.Format("{0:H:mm:ss}", log.Time));
|
|||
WriteAttributeTo(__razor_helper_writer, "title", Tuple.Create(" title=\"", 856), Tuple.Create("\"", 873),
|
||||
Tuple.Create(Tuple.Create("", 864), Tuple.Create<System.Object, System.Int32>(log.Name, 864), false));
|
||||
WriteLiteralTo(__razor_helper_writer, ">");
|
||||
#line 28 "RequestPage.cshtml"
|
||||
#line 28 "DetailsPage.cshtml"
|
||||
WriteTo(__razor_helper_writer, log.Name);
|
||||
|
||||
#line default
|
||||
|
|
@ -97,7 +97,7 @@ WriteTo(__razor_helper_writer, string.Format("{0:H:mm:ss}", log.Time));
|
|||
WriteAttributeTo(__razor_helper_writer, "title", Tuple.Create(" title=\"", 906), Tuple.Create("\"", 926),
|
||||
Tuple.Create(Tuple.Create("", 914), Tuple.Create<System.Object, System.Int32>(log.Message, 914), false));
|
||||
WriteLiteralTo(__razor_helper_writer, " class=\"logState\" width=\"100px\">");
|
||||
#line 29 "RequestPage.cshtml"
|
||||
#line 29 "DetailsPage.cshtml"
|
||||
WriteTo(__razor_helper_writer, log.Message);
|
||||
|
||||
#line default
|
||||
|
|
@ -106,13 +106,13 @@ WriteTo(__razor_helper_writer, string.Format("{0:H:mm:ss}", log.Time));
|
|||
WriteAttributeTo(__razor_helper_writer, "title", Tuple.Create(" title=\"", 993), Tuple.Create("\"", 1015),
|
||||
Tuple.Create(Tuple.Create("", 1001), Tuple.Create<System.Object, System.Int32>(log.Exception, 1001), false));
|
||||
WriteLiteralTo(__razor_helper_writer, ">");
|
||||
#line 30 "RequestPage.cshtml"
|
||||
#line 30 "DetailsPage.cshtml"
|
||||
WriteTo(__razor_helper_writer, log.Exception);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteralTo(__razor_helper_writer, "</td>\r\n </tr>\r\n");
|
||||
#line 32 "RequestPage.cshtml"
|
||||
#line 32 "DetailsPage.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
|
|
@ -120,21 +120,21 @@ WriteTo(__razor_helper_writer, string.Format("{0:H:mm:ss}", log.Time));
|
|||
|
||||
}
|
||||
);
|
||||
#line 33 "RequestPage.cshtml"
|
||||
#line 33 "DetailsPage.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
public HelperResult
|
||||
#line 35 "RequestPage.cshtml"
|
||||
#line 35 "DetailsPage.cshtml"
|
||||
Traverse(ScopeNode node)
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
return new HelperResult((__razor_helper_writer) => {
|
||||
#line 36 "RequestPage.cshtml"
|
||||
#line 36 "DetailsPage.cshtml"
|
||||
|
||||
var messageIndex = 0;
|
||||
var childIndex = 0;
|
||||
|
|
@ -147,12 +147,12 @@ Traverse(ScopeNode node)
|
|||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 43 "RequestPage.cshtml"
|
||||
#line 43 "DetailsPage.cshtml"
|
||||
WriteTo(__razor_helper_writer, LogRow(node.Messages[messageIndex]));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 43 "RequestPage.cshtml"
|
||||
#line 43 "DetailsPage.cshtml"
|
||||
|
||||
messageIndex++;
|
||||
}
|
||||
|
|
@ -163,12 +163,12 @@ WriteTo(__razor_helper_writer, LogRow(node.Messages[messageIndex]));
|
|||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 48 "RequestPage.cshtml"
|
||||
#line 48 "DetailsPage.cshtml"
|
||||
WriteTo(__razor_helper_writer, Traverse(node.Children[childIndex]));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 48 "RequestPage.cshtml"
|
||||
#line 48 "DetailsPage.cshtml"
|
||||
|
||||
childIndex++;
|
||||
}
|
||||
|
|
@ -182,12 +182,12 @@ WriteTo(__razor_helper_writer, Traverse(node.Children[childIndex]));
|
|||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 56 "RequestPage.cshtml"
|
||||
#line 56 "DetailsPage.cshtml"
|
||||
WriteTo(__razor_helper_writer, LogRow(node.Messages[i]));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 56 "RequestPage.cshtml"
|
||||
#line 56 "DetailsPage.cshtml"
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -200,12 +200,12 @@ WriteTo(__razor_helper_writer, LogRow(node.Messages[i]));
|
|||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 63 "RequestPage.cshtml"
|
||||
#line 63 "DetailsPage.cshtml"
|
||||
WriteTo(__razor_helper_writer, Traverse(node.Children[i]));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 63 "RequestPage.cshtml"
|
||||
#line 63 "DetailsPage.cshtml"
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -215,25 +215,25 @@ WriteTo(__razor_helper_writer, Traverse(node.Children[i]));
|
|||
|
||||
}
|
||||
);
|
||||
#line 66 "RequestPage.cshtml"
|
||||
#line 66 "DetailsPage.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 10 "RequestPage.cshtml"
|
||||
#line 10 "DetailsPage.cshtml"
|
||||
|
||||
public RequestPage(RequestPageModel model)
|
||||
public DetailsPage(DetailsPageModel model)
|
||||
{
|
||||
Model = model;
|
||||
}
|
||||
|
||||
public RequestPageModel Model { get; set; }
|
||||
public DetailsPageModel Model { get; set; }
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line hidden
|
||||
public RequestPage()
|
||||
public DetailsPage()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -350,13 +350,13 @@ td, th {
|
|||
<body>
|
||||
<h1>ASP.NET Logs</h1>
|
||||
");
|
||||
#line 80 "RequestPage.cshtml"
|
||||
#line 80 "DetailsPage.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 80 "RequestPage.cshtml"
|
||||
#line 80 "DetailsPage.cshtml"
|
||||
|
||||
var context = Model.Activity?.HttpInfo;
|
||||
|
||||
|
|
@ -365,13 +365,13 @@ td, th {
|
|||
#line hidden
|
||||
|
||||
WriteLiteral("\r\n");
|
||||
#line 83 "RequestPage.cshtml"
|
||||
#line 83 "DetailsPage.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 83 "RequestPage.cshtml"
|
||||
#line 83 "DetailsPage.cshtml"
|
||||
if (context != null)
|
||||
{
|
||||
|
||||
|
|
@ -381,35 +381,35 @@ td, th {
|
|||
WriteLiteral(" <h2 id=\"requestHeader\">Request Details</h2>\r\n <table id=\"requestDe" +
|
||||
"tails\">\r\n <colgroup><col id=\"label\" /><col /></colgroup>\r\n\r\n " +
|
||||
" <tr>\r\n <th>Path</th>\r\n <td>");
|
||||
#line 91 "RequestPage.cshtml"
|
||||
#line 91 "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 95 "RequestPage.cshtml"
|
||||
#line 95 "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 99 "RequestPage.cshtml"
|
||||
#line 99 "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 103 "RequestPage.cshtml"
|
||||
#line 103 "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 107 "RequestPage.cshtml"
|
||||
#line 107 "DetailsPage.cshtml"
|
||||
Write(context.Protocol);
|
||||
|
||||
#line default
|
||||
|
|
@ -428,13 +428,13 @@ td, th {
|
|||
</thead>
|
||||
<tbody>
|
||||
");
|
||||
#line 120 "RequestPage.cshtml"
|
||||
#line 120 "DetailsPage.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 120 "RequestPage.cshtml"
|
||||
#line 120 "DetailsPage.cshtml"
|
||||
foreach (var header in context.Headers)
|
||||
{
|
||||
|
||||
|
|
@ -442,19 +442,19 @@ td, th {
|
|||
#line hidden
|
||||
|
||||
WriteLiteral(" <tr>\r\n <td>");
|
||||
#line 123 "RequestPage.cshtml"
|
||||
#line 123 "DetailsPage.cshtml"
|
||||
Write(header.Key);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n <td>");
|
||||
#line 124 "RequestPage.cshtml"
|
||||
#line 124 "DetailsPage.cshtml"
|
||||
Write(string.Join(";", header.Value));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n </tr>\r\n");
|
||||
#line 126 "RequestPage.cshtml"
|
||||
#line 126 "DetailsPage.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
|
|
@ -463,27 +463,27 @@ td, th {
|
|||
WriteLiteral(" </tbody>\r\n </table>\r\n <" +
|
||||
"/td>\r\n </tr>\r\n <tr>\r\n <th>Status Code</th>\r" +
|
||||
"\n <td>");
|
||||
#line 133 "RequestPage.cshtml"
|
||||
#line 133 "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 137 "RequestPage.cshtml"
|
||||
#line 137 "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 142 "RequestPage.cshtml"
|
||||
#line 142 "DetailsPage.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 142 "RequestPage.cshtml"
|
||||
#line 142 "DetailsPage.cshtml"
|
||||
if (context.User.Claims.Any())
|
||||
{
|
||||
|
||||
|
|
@ -499,13 +499,13 @@ td, th {
|
|||
</thead>
|
||||
<tbody>
|
||||
");
|
||||
#line 152 "RequestPage.cshtml"
|
||||
#line 152 "DetailsPage.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 152 "RequestPage.cshtml"
|
||||
#line 152 "DetailsPage.cshtml"
|
||||
foreach (var claim in context.User.Claims)
|
||||
{
|
||||
|
||||
|
|
@ -514,26 +514,26 @@ td, th {
|
|||
|
||||
WriteLiteral(" <tr>\r\n " +
|
||||
" <td>");
|
||||
#line 155 "RequestPage.cshtml"
|
||||
#line 155 "DetailsPage.cshtml"
|
||||
Write(claim.Issuer);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n <td>");
|
||||
#line 156 "RequestPage.cshtml"
|
||||
#line 156 "DetailsPage.cshtml"
|
||||
Write(claim.Value);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n </tr>\r\n");
|
||||
#line 158 "RequestPage.cshtml"
|
||||
#line 158 "DetailsPage.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
WriteLiteral(" </tbody>\r\n </table>\r\n");
|
||||
#line 161 "RequestPage.cshtml"
|
||||
#line 161 "DetailsPage.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
|
|
@ -541,27 +541,27 @@ td, th {
|
|||
|
||||
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>S" +
|
||||
"cheme</th>\r\n <td>");
|
||||
#line 166 "RequestPage.cshtml"
|
||||
#line 166 "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 170 "RequestPage.cshtml"
|
||||
#line 170 "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 175 "RequestPage.cshtml"
|
||||
#line 175 "DetailsPage.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 175 "RequestPage.cshtml"
|
||||
#line 175 "DetailsPage.cshtml"
|
||||
if (context.Cookies.Any())
|
||||
{
|
||||
|
||||
|
|
@ -577,13 +577,13 @@ td, th {
|
|||
</thead>
|
||||
<tbody>
|
||||
");
|
||||
#line 185 "RequestPage.cshtml"
|
||||
#line 185 "DetailsPage.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 185 "RequestPage.cshtml"
|
||||
#line 185 "DetailsPage.cshtml"
|
||||
foreach (var cookie in context.Cookies)
|
||||
{
|
||||
|
||||
|
|
@ -592,46 +592,46 @@ td, th {
|
|||
|
||||
WriteLiteral(" <tr>\r\n " +
|
||||
" <td>");
|
||||
#line 188 "RequestPage.cshtml"
|
||||
#line 188 "DetailsPage.cshtml"
|
||||
Write(cookie.Key);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n <td>");
|
||||
#line 189 "RequestPage.cshtml"
|
||||
#line 189 "DetailsPage.cshtml"
|
||||
Write(string.Join(";", cookie.Value));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n </tr>\r\n");
|
||||
#line 191 "RequestPage.cshtml"
|
||||
#line 191 "DetailsPage.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
WriteLiteral(" </tbody>\r\n </table>\r\n");
|
||||
#line 194 "RequestPage.cshtml"
|
||||
#line 194 "DetailsPage.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
WriteLiteral(" </td>\r\n </tr>\r\n </table>\r\n");
|
||||
#line 198 "RequestPage.cshtml"
|
||||
#line 198 "DetailsPage.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
WriteLiteral(" <h2>Logs</h2>\r\n <form method=\"get\">\r\n <select name=\"level\">\r\n");
|
||||
#line 202 "RequestPage.cshtml"
|
||||
#line 202 "DetailsPage.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 202 "RequestPage.cshtml"
|
||||
#line 202 "DetailsPage.cshtml"
|
||||
foreach (var severity in Enum.GetValues(typeof(LogLevel)))
|
||||
{
|
||||
var severityInt = (int)severity;
|
||||
|
|
@ -645,13 +645,13 @@ td, th {
|
|||
WriteAttribute("value", Tuple.Create(" value=\"", 6703), Tuple.Create("\"", 6723),
|
||||
Tuple.Create(Tuple.Create("", 6711), Tuple.Create<System.Object, System.Int32>(severityInt, 6711), false));
|
||||
WriteLiteral(" selected=\"selected\">");
|
||||
#line 207 "RequestPage.cshtml"
|
||||
#line 207 "DetailsPage.cshtml"
|
||||
Write(severity);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</option>\r\n");
|
||||
#line 208 "RequestPage.cshtml"
|
||||
#line 208 "DetailsPage.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -663,13 +663,13 @@ td, th {
|
|||
WriteAttribute("value", Tuple.Create(" value=\"", 6852), Tuple.Create("\"", 6872),
|
||||
Tuple.Create(Tuple.Create("", 6860), Tuple.Create<System.Object, System.Int32>(severityInt, 6860), false));
|
||||
WriteLiteral(">");
|
||||
#line 211 "RequestPage.cshtml"
|
||||
#line 211 "DetailsPage.cshtml"
|
||||
Write(severity);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</option>\r\n");
|
||||
#line 212 "RequestPage.cshtml"
|
||||
#line 212 "DetailsPage.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -694,7 +694,7 @@ td, th {
|
|||
</tr>
|
||||
</thead>
|
||||
");
|
||||
#line 229 "RequestPage.cshtml"
|
||||
#line 229 "DetailsPage.cshtml"
|
||||
Write(Traverse(Model.Activity.Root));
|
||||
|
||||
#line default
|
||||
|
|
@ -8,12 +8,12 @@
|
|||
|
||||
@functions
|
||||
{
|
||||
public RequestPage(RequestPageModel model)
|
||||
public DetailsPage(DetailsPageModel model)
|
||||
{
|
||||
Model = model;
|
||||
}
|
||||
|
||||
public RequestPageModel Model { get; set; }
|
||||
public DetailsPageModel Model { get; set; }
|
||||
}
|
||||
|
||||
@helper LogRow(LogInfo log)
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-2.1.1.min.js"></script>
|
||||
<style>
|
||||
<%$ include: Shared.css %>
|
||||
<%$ include: RequestPage.css %>
|
||||
<%$ include: DetailsPage.css %>
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -1,12 +1,9 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.AspNet.Diagnostics.Elm.Views
|
||||
{
|
||||
public class RequestPageModel
|
||||
public class DetailsPageModel
|
||||
{
|
||||
public Guid RequestID { get; set; }
|
||||
|
||||
public ActivityContext Activity { get; set; }
|
||||
|
||||
public ViewOptions Options { get; set; }
|
||||
|
|
@ -574,21 +574,21 @@ tr:nth-child(2n) {
|
|||
|
||||
#line 149 "LogPage.cshtml"
|
||||
|
||||
var activityPath = Model.Path.Value + "/" + activity.Id;
|
||||
if (activity.HttpInfo != null)
|
||||
{
|
||||
var requestPath = Model.Path.Value + "/" + activity.HttpInfo.RequestID;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
WriteLiteral(" <td><a");
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 4901), Tuple.Create("\"", 4920),
|
||||
Tuple.Create(Tuple.Create("", 4908), Tuple.Create<System.Object, System.Int32>(requestPath, 4908), false));
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4921), Tuple.Create("\"", 4952),
|
||||
Tuple.Create(Tuple.Create("", 4929), Tuple.Create<System.Object, System.Int32>(activity.HttpInfo.Path, 4929), false));
|
||||
WriteLiteral(" \t<td><a");
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 4879), Tuple.Create("\"", 4899),
|
||||
Tuple.Create(Tuple.Create("", 4886), Tuple.Create<System.Object, System.Int32>(activityPath, 4886), false));
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4900), Tuple.Create("\"", 4931),
|
||||
Tuple.Create(Tuple.Create("", 4908), Tuple.Create<System.Object, System.Int32>(activity.HttpInfo.Path, 4908), false));
|
||||
WriteLiteral(">");
|
||||
#line 153 "LogPage.cshtml"
|
||||
Write(activity.HttpInfo.Path);
|
||||
Write(activity.HttpInfo.Path);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
|
@ -612,6 +612,26 @@ tr:nth-child(2n) {
|
|||
#line hidden
|
||||
WriteLiteral("</td>\r\n");
|
||||
#line 157 "LogPage.cshtml"
|
||||
}
|
||||
else if (activity.RepresentsScope)
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
WriteLiteral(" <td colspan=\"4\"><a");
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 5321), Tuple.Create("\"", 5341),
|
||||
Tuple.Create(Tuple.Create("", 5328), Tuple.Create<System.Object, System.Int32>(activityPath, 5328), false));
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 5342), Tuple.Create("\"", 5370),
|
||||
Tuple.Create(Tuple.Create("", 5350), Tuple.Create<System.Object, System.Int32>(activity.Root.State, 5350), false));
|
||||
WriteLiteral(">");
|
||||
#line 160 "LogPage.cshtml"
|
||||
Write(activity.Root.State);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</a></td>\r\n");
|
||||
#line 161 "LogPage.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -619,14 +639,11 @@ tr:nth-child(2n) {
|
|||
#line default
|
||||
#line hidden
|
||||
|
||||
WriteLiteral(" <td colspan=\"4\">");
|
||||
#line 160 "LogPage.cshtml"
|
||||
Write(activity.Root.State);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n");
|
||||
#line 161 "LogPage.cshtml"
|
||||
WriteLiteral(" <td colspan=\"4\"><a");
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 5533), Tuple.Create("\"", 5553),
|
||||
Tuple.Create(Tuple.Create("", 5540), Tuple.Create<System.Object, System.Int32>(activityPath, 5540), false));
|
||||
WriteLiteral(">Non-scope Log</a></td>\r\n");
|
||||
#line 165 "LogPage.cshtml"
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -647,13 +664,13 @@ tr:nth-child(2n) {
|
|||
</tr>
|
||||
</thead>
|
||||
");
|
||||
#line 175 "LogPage.cshtml"
|
||||
#line 179 "LogPage.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 175 "LogPage.cshtml"
|
||||
#line 179 "LogPage.cshtml"
|
||||
|
||||
var counts = new Dictionary<string, int>();
|
||||
counts["Critical"] = 0;
|
||||
|
|
@ -667,14 +684,14 @@ tr:nth-child(2n) {
|
|||
#line hidden
|
||||
|
||||
WriteLiteral("\r\n <tbody class=\"logBody\">\r\n");
|
||||
#line 184 "LogPage.cshtml"
|
||||
#line 188 "LogPage.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 184 "LogPage.cshtml"
|
||||
if (activity.Id.Equals(Guid.Empty))
|
||||
#line 188 "LogPage.cshtml"
|
||||
if (!activity.RepresentsScope)
|
||||
{
|
||||
// message not within a scope
|
||||
var logInfo = activity.Root.Messages.FirstOrDefault();
|
||||
|
|
@ -683,12 +700,12 @@ tr:nth-child(2n) {
|
|||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 188 "LogPage.cshtml"
|
||||
#line 192 "LogPage.cshtml"
|
||||
Write(LogRow(logInfo, 0));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 188 "LogPage.cshtml"
|
||||
#line 192 "LogPage.cshtml"
|
||||
|
||||
counts[logInfo.Severity.ToString()] = 1;
|
||||
}
|
||||
|
|
@ -699,12 +716,12 @@ tr:nth-child(2n) {
|
|||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 193 "LogPage.cshtml"
|
||||
#line 197 "LogPage.cshtml"
|
||||
Write(Traverse(activity.Root, 0, counts));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 193 "LogPage.cshtml"
|
||||
#line 197 "LogPage.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -714,19 +731,19 @@ tr:nth-child(2n) {
|
|||
WriteLiteral(" </tbody>\r\n <tbody class=\"s" +
|
||||
"ummary\">\r\n <tr class=\"logRow\">\r\n " +
|
||||
" <td>");
|
||||
#line 198 "LogPage.cshtml"
|
||||
#line 202 "LogPage.cshtml"
|
||||
Write(activity.Time.ToString("MM-dd-yyyy HH:mm:ss"));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n");
|
||||
#line 199 "LogPage.cshtml"
|
||||
#line 203 "LogPage.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 199 "LogPage.cshtml"
|
||||
#line 203 "LogPage.cshtml"
|
||||
foreach (var kvp in counts)
|
||||
{
|
||||
if (string.Equals("Verbose", kvp.Key)) {
|
||||
|
|
@ -735,19 +752,19 @@ tr:nth-child(2n) {
|
|||
#line hidden
|
||||
|
||||
WriteLiteral(" <td>");
|
||||
#line 202 "LogPage.cshtml"
|
||||
#line 206 "LogPage.cshtml"
|
||||
Write(kvp.Value);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
#line 202 "LogPage.cshtml"
|
||||
#line 206 "LogPage.cshtml"
|
||||
Write(kvp.Key);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<span class=\"collapse\">v</span></td>\r\n");
|
||||
#line 203 "LogPage.cshtml"
|
||||
#line 207 "LogPage.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -756,19 +773,19 @@ tr:nth-child(2n) {
|
|||
#line hidden
|
||||
|
||||
WriteLiteral(" <td>");
|
||||
#line 206 "LogPage.cshtml"
|
||||
#line 210 "LogPage.cshtml"
|
||||
Write(kvp.Value);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
#line 206 "LogPage.cshtml"
|
||||
#line 210 "LogPage.cshtml"
|
||||
Write(kvp.Key);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n");
|
||||
#line 207 "LogPage.cshtml"
|
||||
#line 211 "LogPage.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -778,7 +795,7 @@ tr:nth-child(2n) {
|
|||
WriteLiteral(" </tr>\r\n </tbody>\r\n " +
|
||||
" </table>\r\n </td>\r\n </tr>\r\n" +
|
||||
" </tbody>\r\n");
|
||||
#line 215 "LogPage.cshtml"
|
||||
#line 219 "LogPage.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
|
|
|
|||
|
|
@ -147,17 +147,21 @@
|
|||
<tbody>
|
||||
<tr class="requestRow">
|
||||
@{
|
||||
var activityPath = Model.Path.Value + "/" + activity.Id;
|
||||
if (activity.HttpInfo != null)
|
||||
{
|
||||
var requestPath = Model.Path.Value + "/" + activity.HttpInfo.RequestID;
|
||||
<td><a href="@requestPath" title="@activity.HttpInfo.Path">@activity.HttpInfo.Path</a></td>
|
||||
<td><a href="@activityPath" title="@activity.HttpInfo.Path">@activity.HttpInfo.Path</a></td>
|
||||
<td>@activity.HttpInfo.Method</td>
|
||||
<td>@activity.HttpInfo.Host</td>
|
||||
<td>@activity.HttpInfo.StatusCode</td>
|
||||
}
|
||||
else if (activity.RepresentsScope)
|
||||
{
|
||||
<td colspan="4"><a href="@activityPath" title="@activity.Root.State">@activity.Root.State</a></td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td colspan="4">@activity.Root.State</td>
|
||||
<td colspan="4"><a href="@activityPath">Non-scope Log</a></td>
|
||||
}
|
||||
}
|
||||
<td class="logTd">
|
||||
|
|
@ -181,7 +185,7 @@
|
|||
counts["Verbose"] = 0;
|
||||
}
|
||||
<tbody class="logBody">
|
||||
@if (activity.Id.Equals(Guid.Empty))
|
||||
@if (!activity.RepresentsScope)
|
||||
{
|
||||
// message not within a scope
|
||||
var logInfo = activity.Root.Messages.FirstOrDefault();
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ namespace Microsoft.AspNet.Diagnostics.Tests
|
|||
|
||||
// Assert
|
||||
contextMock.VerifyGet(c => c.Request.Query, Times.AtLeastOnce());
|
||||
Assert.True(response.Contains("Invalid Request Id"));
|
||||
Assert.True(response.Contains("Invalid Id"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue