From 7dac0986c212a1f899441cd563a7d5a63243c40d Mon Sep 17 00:00:00 2001 From: ryanbrandenburg Date: Tue, 13 Oct 2015 12:49:03 -0700 Subject: [PATCH] * Fix PageGenerator * Generate pages on build * Add copyable stacktrace to error page --- makefile.shade | 5 +- .../Views/DetailsPage.cs | 528 +++++---------- .../Views/DetailsPage.cshtml | 183 +++--- .../Views/LogPage.cs | 608 +++++------------- .../Views/LogPage.cshtml | 161 +++-- .../project.json | 4 +- .../Views/DatabaseErrorPage.cs | 1 - .../Views/CompilationErrorPage.cs | 46 +- .../Views/CompilationErrorPage.cshtml | 2 +- .../DeveloperExceptionPage/Views/ErrorPage.cs | 275 ++++---- .../Views/ErrorPage.cshtml | 14 +- .../DeveloperExceptionPage/Views/ErrorPage.js | 6 + .../RuntimeInfo/Views/RuntimeInfoPage.cs | 20 +- .../Views/AttributeValue.cs | 19 +- .../Views/BaseView.cs | 80 +-- .../WelcomePage/Views/WelcomePage.cs | 83 ++- .../WelcomePage/Views/WelcomePage.cshtml | 1 + src/Microsoft.AspNet.Diagnostics/project.json | 3 +- src/PageGenerator/Program.cs | 34 +- src/PageGenerator/project.json | 9 +- 20 files changed, 841 insertions(+), 1241 deletions(-) diff --git a/makefile.shade b/makefile.shade index a612302092..bed37e67a4 100644 --- a/makefile.shade +++ b/makefile.shade @@ -5,4 +5,7 @@ var FULL_VERSION='0.1' var AUTHORS='Microsoft Open Technologies, Inc.' use-standard-lifecycle -k-standard-goals \ No newline at end of file +k-standard-goals + +#generatepages target='initialize' + k command='run ../Microsoft.AspNet.Diagnostics' dnxDir='src/PageGenerator' \ No newline at end of file diff --git a/src/Microsoft.AspNet.Diagnostics.Elm/Views/DetailsPage.cs b/src/Microsoft.AspNet.Diagnostics.Elm/Views/DetailsPage.cs index 1003055c53..1a3a0cc5f2 100644 --- a/src/Microsoft.AspNet.Diagnostics.Elm/Views/DetailsPage.cs +++ b/src/Microsoft.AspNet.Diagnostics.Elm/Views/DetailsPage.cs @@ -46,181 +46,6 @@ using Microsoft.Extensions.Logging public class DetailsPage : Microsoft.AspNet.Diagnostics.Views.BaseView { -public HelperResult -#line 19 "DetailsPage.cshtml" -LogRow(LogInfo log) -{ - -#line default -#line hidden - return new HelperResult((__razor_helper_writer) => { -#line 20 "DetailsPage.cshtml" - - if (log.Severity >= Model.Options.MinLevel && - (string.IsNullOrEmpty(Model.Options.NamePrefix) || log.Name.StartsWith(Model.Options.NamePrefix, StringComparison.Ordinal))) - { - -#line default -#line hidden - - WriteLiteralTo(__razor_helper_writer, " \r\n "); -#line 25 "DetailsPage.cshtml" -WriteTo(__razor_helper_writer, string.Format("{0:MM/dd/yy}", log.Time)); - -#line default -#line hidden - WriteLiteralTo(__razor_helper_writer, "\r\n "); -#line 26 "DetailsPage.cshtml" -WriteTo(__razor_helper_writer, string.Format("{0:H:mm:ss}", log.Time)); - -#line default -#line hidden - WriteLiteralTo(__razor_helper_writer, "\r\n (log.Severity.ToString().ToLowerInvariant(), 776), false)); - WriteLiteralTo(__razor_helper_writer, ">"); -#line 27 "DetailsPage.cshtml" - WriteTo(__razor_helper_writer, log.Severity); - -#line default -#line hidden - WriteLiteralTo(__razor_helper_writer, "\r\n (log.Name, 864), false)); - WriteLiteralTo(__razor_helper_writer, ">"); -#line 28 "DetailsPage.cshtml" - WriteTo(__razor_helper_writer, log.Name); - -#line default -#line hidden - WriteLiteralTo(__razor_helper_writer, "\r\n (log.Message, 914), false)); - WriteLiteralTo(__razor_helper_writer, " class=\"logState\" width=\"100px\">"); -#line 29 "DetailsPage.cshtml" - WriteTo(__razor_helper_writer, log.Message); - -#line default -#line hidden - WriteLiteralTo(__razor_helper_writer, "\r\n (log.Exception, 1001), false)); - WriteLiteralTo(__razor_helper_writer, ">"); -#line 30 "DetailsPage.cshtml" - WriteTo(__razor_helper_writer, log.Exception); - -#line default -#line hidden - WriteLiteralTo(__razor_helper_writer, "\r\n \r\n"); -#line 32 "DetailsPage.cshtml" - } - -#line default -#line hidden - - } - ); -#line 33 "DetailsPage.cshtml" -} - -#line default -#line hidden - -public HelperResult -#line 35 "DetailsPage.cshtml" -Traverse(ScopeNode node) -{ - -#line default -#line hidden - return new HelperResult((__razor_helper_writer) => { -#line 36 "DetailsPage.cshtml" - - var messageIndex = 0; - var childIndex = 0; - while (messageIndex < node.Messages.Count && childIndex < node.Children.Count) - { - if (node.Messages[messageIndex].Time < node.Children[childIndex].StartTime) - { - - -#line default -#line hidden - -#line 43 "DetailsPage.cshtml" -WriteTo(__razor_helper_writer, LogRow(node.Messages[messageIndex])); - -#line default -#line hidden -#line 43 "DetailsPage.cshtml" - - messageIndex++; - } - else - { - - -#line default -#line hidden - -#line 48 "DetailsPage.cshtml" -WriteTo(__razor_helper_writer, Traverse(node.Children[childIndex])); - -#line default -#line hidden -#line 48 "DetailsPage.cshtml" - - childIndex++; - } - } - if (messageIndex < node.Messages.Count) - { - for (var i = messageIndex; i < node.Messages.Count; i++) - { - - -#line default -#line hidden - -#line 56 "DetailsPage.cshtml" -WriteTo(__razor_helper_writer, LogRow(node.Messages[i])); - -#line default -#line hidden -#line 56 "DetailsPage.cshtml" - - } - } - else - { - for (var i = childIndex; i < node.Children.Count; i++) - { - - -#line default -#line hidden - -#line 63 "DetailsPage.cshtml" -WriteTo(__razor_helper_writer, Traverse(node.Children[i])); - -#line default -#line hidden -#line 63 "DetailsPage.cshtml" - - } - } - -#line default -#line hidden - - } - ); -#line 66 "DetailsPage.cshtml" -} - -#line default -#line hidden - #line 10 "DetailsPage.cshtml" public DetailsPage(DetailsPageModel model) @@ -230,6 +55,72 @@ WriteTo(__razor_helper_writer, Traverse(node.Children[i])); 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))) + { + WriteLiteralTo(writer, " \r\n "); + WriteTo(writer, string.Format("{0:MM/dd/yy}", log.Time)); + WriteLiteralTo(writer, "\r\n "); + WriteTo(writer, string.Format("{0:H:mm:ss}", log.Time)); + var severity = log.Severity.ToString().ToLowerInvariant(); + WriteLiteralTo(writer, $"\r\n "); + WriteTo(writer, log.Severity); + + WriteLiteralTo(writer, $"\r\n "); + WriteTo(writer, log.Name); + + WriteLiteralTo(writer, $"\r\n "); + WriteTo(writer, log.Message); + + WriteLiteralTo(writer, $"\r\n "); + WriteTo(writer, log.Exception); + + WriteLiteralTo(writer, "\r\n \r\n"); + } + }); + } + + 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 #line hidden @@ -240,10 +131,14 @@ WriteTo(__razor_helper_writer, Traverse(node.Children[i])); #pragma warning disable 1998 public override async Task ExecuteAsync() { - Response.ContentType = "text/html; charset=utf-8"; - WriteLiteral("\r\n"); - WriteLiteral("\r\n"); WriteLiteral("\r\n"); +#line 84 "DetailsPage.cshtml" + + Response.ContentType = "text/html"; + +#line default +#line hidden + WriteLiteral(@" @@ -251,113 +146,19 @@ WriteTo(__razor_helper_writer, Traverse(node.Children[i])); ASP.NET Logs

ASP.NET Logs

"); -#line 80 "DetailsPage.cshtml" +#line 99 "DetailsPage.cshtml" #line default #line hidden -#line 80 "DetailsPage.cshtml" +#line 99 "DetailsPage.cshtml" var context = Model.Activity?.HttpInfo; @@ -365,14 +166,8 @@ td, th { #line default #line hidden - WriteLiteral("\r\n"); -#line 83 "DetailsPage.cshtml" - - -#line default -#line hidden - -#line 83 "DetailsPage.cshtml" + WriteLiteral(" "); +#line 102 "DetailsPage.cshtml" if (context != null) { @@ -382,35 +177,35 @@ td, th { WriteLiteral("

Request Details

\r\n \r\n \r\n\r\n " + " \r\n \r\n \r\n \r\n \r\n \r\n " + " \r\n \r\n \r\n " + "\r\n \r\n \r\n \r\n \r\n " + " \r\n \r\n \r\n \r\n " + " "); -#line 120 "DetailsPage.cshtml" +#line 139 "DetailsPage.cshtml" #line default #line hidden -#line 120 "DetailsPage.cshtml" +#line 139 "DetailsPage.cshtml" foreach (var header in context.Headers) { #line default #line hidden - WriteLiteral(" \r\n \r\n \r\n \r\n \r\n \r\n"); -#line 126 "DetailsPage.cshtml" + WriteLiteral("\r\n \r\n"); +#line 145 "DetailsPage.cshtml" } #line default @@ -464,77 +259,76 @@ td, th { WriteLiteral(" \r\n
Path"); -#line 91 "DetailsPage.cshtml" +#line 110 "DetailsPage.cshtml" Write(context.Path); #line default #line hidden WriteLiteral("
Host"); -#line 95 "DetailsPage.cshtml" +#line 114 "DetailsPage.cshtml" Write(context.Host); #line default #line hidden WriteLiteral("
Content Type"); -#line 99 "DetailsPage.cshtml" +#line 118 "DetailsPage.cshtml" Write(context.ContentType); #line default #line hidden WriteLiteral("
Method"); -#line 103 "DetailsPage.cshtml" +#line 122 "DetailsPage.cshtml" Write(context.Method); #line default #line hidden WriteLiteral("
Protocol"); -#line 107 "DetailsPage.cshtml" +#line 126 "DetailsPage.cshtml" Write(context.Protocol); #line default @@ -429,33 +224,33 @@ td, th {
"); -#line 123 "DetailsPage.cshtml" - Write(header.Key); + WriteLiteral("
"); +#line 142 "DetailsPage.cshtml" + Write(header.Key); #line default #line hidden - WriteLiteral(""); -#line 124 "DetailsPage.cshtml" - Write(string.Join(";", header.Value)); + WriteLiteral(""); +#line 143 "DetailsPage.cshtml" + Write(string.Join(";", header.Value)); #line default #line hidden - WriteLiteral("
\r\n <" + "/td>\r\n \r\n \r\n Status Code\r" + "\n "); -#line 133 "DetailsPage.cshtml" +#line 152 "DetailsPage.cshtml" Write(context.StatusCode); #line default #line hidden WriteLiteral("\r\n \r\n \r\n User\r\n " + " "); -#line 137 "DetailsPage.cshtml" +#line 156 "DetailsPage.cshtml" Write(context.User.Identity.Name); #line default #line hidden WriteLiteral("\r\n \r\n \r\n Claims\r\n " + " \r\n"); -#line 142 "DetailsPage.cshtml" +#line 161 "DetailsPage.cshtml" #line default #line hidden -#line 142 "DetailsPage.cshtml" +#line 161 "DetailsPage.cshtml" if (context.User.Claims.Any()) { #line default #line hidden - WriteLiteral(@" - - - - - - - + WriteLiteral(@"
IssuerValue
+ + + + + + + "); -#line 152 "DetailsPage.cshtml" - +#line 171 "DetailsPage.cshtml" + #line default #line hidden -#line 152 "DetailsPage.cshtml" - foreach (var claim in context.User.Claims) +#line 171 "DetailsPage.cshtml" + foreach (var claim in context.User.Claims) { #line default #line hidden - WriteLiteral(" \r\n " + -" \r\n \r\n \r\n \r\n \r\n"); -#line 158 "DetailsPage.cshtml" + WriteLiteral("\r\n \r\n"); +#line 177 "DetailsPage.cshtml" } #line default #line hidden - WriteLiteral(" \r\n
IssuerValue
"); -#line 155 "DetailsPage.cshtml" - Write(claim.Issuer); + WriteLiteral("
"); +#line 174 "DetailsPage.cshtml" + Write(claim.Issuer); #line default #line hidden - WriteLiteral(""); -#line 156 "DetailsPage.cshtml" - Write(claim.Value); + WriteLiteral(""); +#line 175 "DetailsPage.cshtml" + Write(claim.Value); #line default #line hidden - WriteLiteral("
\r\n"); -#line 161 "DetailsPage.cshtml" + WriteLiteral(" \r\n \r\n"); +#line 180 "DetailsPage.cshtml" } #line default @@ -542,97 +336,96 @@ td, th { WriteLiteral(" \r\n \r\n \r\n S" + "cheme\r\n "); -#line 166 "DetailsPage.cshtml" +#line 185 "DetailsPage.cshtml" Write(context.Scheme); #line default #line hidden WriteLiteral("\r\n \r\n \r\n Query\r\n " + " "); -#line 170 "DetailsPage.cshtml" +#line 189 "DetailsPage.cshtml" Write(context.Query.Value); #line default #line hidden WriteLiteral("\r\n \r\n \r\n Cookies\r\n " + " \r\n"); -#line 175 "DetailsPage.cshtml" +#line 194 "DetailsPage.cshtml" #line default #line hidden -#line 175 "DetailsPage.cshtml" +#line 194 "DetailsPage.cshtml" if (context.Cookies.Any()) { #line default #line hidden - WriteLiteral(@" - - - - - - - + WriteLiteral(@"
VariableValue
+ + + + + + + "); -#line 185 "DetailsPage.cshtml" - +#line 204 "DetailsPage.cshtml" + #line default #line hidden -#line 185 "DetailsPage.cshtml" - foreach (var cookie in context.Cookies) +#line 204 "DetailsPage.cshtml" + foreach (var cookie in context.Cookies) { #line default #line hidden - WriteLiteral(" \r\n " + -" \r\n \r\n \r\n \r\n \r\n"); -#line 191 "DetailsPage.cshtml" + WriteLiteral("\r\n \r\n"); +#line 210 "DetailsPage.cshtml" } #line default #line hidden - WriteLiteral(" \r\n
VariableValue
"); -#line 188 "DetailsPage.cshtml" - Write(cookie.Key); + WriteLiteral("
"); +#line 207 "DetailsPage.cshtml" + Write(cookie.Key); #line default #line hidden - WriteLiteral(""); -#line 189 "DetailsPage.cshtml" - Write(string.Join(";", cookie.Value)); + WriteLiteral(""); +#line 208 "DetailsPage.cshtml" + Write(string.Join(";", cookie.Value)); #line default #line hidden - WriteLiteral("
\r\n"); -#line 194 "DetailsPage.cshtml" + WriteLiteral(" \r\n \r\n"); +#line 213 "DetailsPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n"); -#line 198 "DetailsPage.cshtml" +#line 217 "DetailsPage.cshtml" } #line default #line hidden WriteLiteral("

Logs

\r\n
\r\n \r\n (Model.Options.NamePrefix, 6993), false)); + BeginWriteAttribute("value", " value=\"", 7975, "\"", 8008, 1); + WriteAttributeValue("", 7983, Model.Options.NamePrefix, 7983, 25, false); + EndWriteAttribute(); WriteLiteral(@" />
@@ -695,7 +491,7 @@ td, th { "); -#line 229 "DetailsPage.cshtml" +#line 248 "DetailsPage.cshtml" Write(Traverse(Model.Activity.Root)); #line default diff --git a/src/Microsoft.AspNet.Diagnostics.Elm/Views/DetailsPage.cshtml b/src/Microsoft.AspNet.Diagnostics.Elm/Views/DetailsPage.cshtml index 9824337e67..bb80b87f33 100644 --- a/src/Microsoft.AspNet.Diagnostics.Elm/Views/DetailsPage.cshtml +++ b/src/Microsoft.AspNet.Diagnostics.Elm/Views/DetailsPage.cshtml @@ -1,4 +1,4 @@ -@using System +@using System @using System.Globalization @using System.Linq @using Microsoft.AspNet.Diagnostics.Elm @@ -14,55 +14,75 @@ } public DetailsPageModel Model { get; set; } -} -@helper LogRow(LogInfo log) -{ - if (log.Severity >= Model.Options.MinLevel && - (string.IsNullOrEmpty(Model.Options.NamePrefix) || log.Name.StartsWith(Model.Options.NamePrefix, StringComparison.Ordinal))) + public HelperResult LogRow(LogInfo log) { - - @string.Format("{0:MM/dd/yy}", log.Time) - @string.Format("{0:H:mm:ss}", log.Time) - @log.Severity - @log.Name - @log.Message - @log.Exception - + return new HelperResult((writer) => + { + if (log.Severity >= Model.Options.MinLevel && + (string.IsNullOrEmpty(Model.Options.NamePrefix) || log.Name.StartsWith(Model.Options.NamePrefix, StringComparison.Ordinal))) + { + WriteLiteralTo(writer, " \r\n "); + WriteTo(writer, string.Format("{0:MM/dd/yy}", log.Time)); + WriteLiteralTo(writer, "\r\n "); + WriteTo(writer, string.Format("{0:H:mm:ss}", log.Time)); + var severity = log.Severity.ToString().ToLowerInvariant(); + WriteLiteralTo(writer, $"\r\n "); + WriteTo(writer, log.Severity); + + WriteLiteralTo(writer, $"\r\n "); + WriteTo(writer, log.Name); + + WriteLiteralTo(writer, $"\r\n "); + WriteTo(writer, log.Message); + + WriteLiteralTo(writer, $"\r\n "); + WriteTo(writer, log.Exception); + + WriteLiteralTo(writer, "\r\n \r\n"); + } + }); + } + + 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]); + } + } + }); } } - -@helper Traverse(ScopeNode node) -{ - 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]) - } - } +@{ + Response.ContentType = "text/html"; } @@ -71,8 +91,7 @@ ASP.NET Logs @@ -119,10 +138,10 @@ @foreach (var header in context.Headers) { - - @header.Key - @string.Join(";", header.Value) - + + @header.Key + @string.Join(";", header.Value) + } @@ -141,23 +160,23 @@ @if (context.User.Claims.Any()) { - - - - - - - - - @foreach (var claim in context.User.Claims) +
IssuerValue
+ + + + + + + + @foreach (var claim in context.User.Claims) { - - - - + + + + } - -
IssuerValue
@claim.Issuer@claim.Value
@claim.Issuer@claim.Value
+ + } @@ -174,23 +193,23 @@ @if (context.Cookies.Any()) { - - - - - - - - - @foreach (var cookie in context.Cookies) +
VariableValue
+ + + + + + + + @foreach (var cookie in context.Cookies) { - - - - + + + + } - -
VariableValue
@cookie.Key@string.Join(";", cookie.Value)
@cookie.Key@string.Join(";", cookie.Value)
+ + } diff --git a/src/Microsoft.AspNet.Diagnostics.Elm/Views/LogPage.cs b/src/Microsoft.AspNet.Diagnostics.Elm/Views/LogPage.cs index 1c9313ee5a..3eb32dd274 100644 --- a/src/Microsoft.AspNet.Diagnostics.Elm/Views/LogPage.cs +++ b/src/Microsoft.AspNet.Diagnostics.Elm/Views/LogPage.cs @@ -52,241 +52,6 @@ using Microsoft.Extensions.Logging public class LogPage : Microsoft.AspNet.Diagnostics.Views.BaseView { -public HelperResult -#line 21 "LogPage.cshtml" -LogRow(LogInfo log, int level) { - -#line default -#line hidden - return new HelperResult((__razor_helper_writer) => { -#line 21 "LogPage.cshtml" - - if (log.Severity >= Model.Options.MinLevel && - (string.IsNullOrEmpty(Model.Options.NamePrefix) || log.Name.StartsWith(Model.Options.NamePrefix, StringComparison.Ordinal))) - { - -#line default -#line hidden - - WriteLiteralTo(__razor_helper_writer, " \r\n "); -#line 26 "LogPage.cshtml" -WriteTo(__razor_helper_writer, string.Format("{0:MM/dd/yy}", log.Time)); - -#line default -#line hidden - WriteLiteralTo(__razor_helper_writer, "\r\n "); -#line 27 "LogPage.cshtml" -WriteTo(__razor_helper_writer, string.Format("{0:H:mm:ss}", log.Time)); - -#line default -#line hidden - WriteLiteralTo(__razor_helper_writer, "\r\n (log.Name, 879), false)); - WriteLiteralTo(__razor_helper_writer, ">"); -#line 28 "LogPage.cshtml" - WriteTo(__razor_helper_writer, log.Name); - -#line default -#line hidden - WriteLiteralTo(__razor_helper_writer, "\r\n (log.Severity.ToString().ToLowerInvariant(), 929), false)); - WriteLiteralTo(__razor_helper_writer, ">"); -#line 29 "LogPage.cshtml" - WriteTo(__razor_helper_writer, log.Severity); - -#line default -#line hidden - WriteLiteralTo(__razor_helper_writer, "\r\n (log.Message, 1017), false)); - WriteLiteralTo(__razor_helper_writer, ">\r\n"); -#line 31 "LogPage.cshtml" - - -#line default -#line hidden - -#line 31 "LogPage.cshtml" - for (var i = 0; i < level; i++) - { - -#line default -#line hidden - - WriteLiteralTo(__razor_helper_writer, " \r\n"); -#line 34 "LogPage.cshtml" - } - -#line default -#line hidden - - WriteLiteralTo(__razor_helper_writer, " "); -#line 35 "LogPage.cshtml" -WriteTo(__razor_helper_writer, log.Message); - -#line default -#line hidden - WriteLiteralTo(__razor_helper_writer, "\r\n \r\n (log.Exception, 1240), false)); - WriteLiteralTo(__razor_helper_writer, ">"); -#line 37 "LogPage.cshtml" - WriteTo(__razor_helper_writer, log.Exception); - -#line default -#line hidden - WriteLiteralTo(__razor_helper_writer, "\r\n \r\n"); -#line 39 "LogPage.cshtml" - } - -#line default -#line hidden - - } - ); -#line 40 "LogPage.cshtml" -} - -#line default -#line hidden - -public HelperResult -#line 42 "LogPage.cshtml" -Traverse(ScopeNode node, int level, Dictionary counts) -{ - -#line default -#line hidden - return new HelperResult((__razor_helper_writer) => { -#line 43 "LogPage.cshtml" - - // print start of scope - - -#line default -#line hidden - -#line 45 "LogPage.cshtml" -WriteTo(__razor_helper_writer, LogRow(new LogInfo() - { - Name = node.Name, - Time = node.StartTime, - Severity = LogLevel.Verbose, - Message = "Beginning " + node.State, - }, level)); - -#line default -#line hidden -#line 51 "LogPage.cshtml" - ; - var messageIndex = 0; - var childIndex = 0; - while (messageIndex < node.Messages.Count && childIndex < node.Children.Count) - { - if (node.Messages[messageIndex].Time < node.Children[childIndex].StartTime) - { - - -#line default -#line hidden - -#line 58 "LogPage.cshtml" -WriteTo(__razor_helper_writer, LogRow(node.Messages[messageIndex], level)); - -#line default -#line hidden -#line 58 "LogPage.cshtml" - - counts[node.Messages[messageIndex].Severity.ToString()]++; - messageIndex++; - } - else - { - - -#line default -#line hidden - -#line 64 "LogPage.cshtml" -WriteTo(__razor_helper_writer, Traverse(node.Children[childIndex], level + 1, counts)); - -#line default -#line hidden -#line 64 "LogPage.cshtml" - - childIndex++; - } - } - if (messageIndex < node.Messages.Count) - { - for (var i = messageIndex; i < node.Messages.Count; i++) - { - - -#line default -#line hidden - -#line 72 "LogPage.cshtml" -WriteTo(__razor_helper_writer, LogRow(node.Messages[i], level)); - -#line default -#line hidden -#line 72 "LogPage.cshtml" - - counts[node.Messages[i].Severity.ToString()]++; - } - } - else - { - for (var i = childIndex; i < node.Children.Count; i++) - { - - -#line default -#line hidden - -#line 80 "LogPage.cshtml" -WriteTo(__razor_helper_writer, Traverse(node.Children[i], level + 1, counts)); - -#line default -#line hidden -#line 80 "LogPage.cshtml" - - } - } - // print end of scope - - -#line default -#line hidden - -#line 84 "LogPage.cshtml" -WriteTo(__razor_helper_writer, LogRow(new LogInfo() - { - Name = node.Name, - Time = node.EndTime, - Severity = LogLevel.Verbose, - Message = string.Format("Completed {0} in {1}ms", node.State, node.EndTime - node.StartTime) - }, level)); - -#line default -#line hidden -#line 90 "LogPage.cshtml" - ; - -#line default -#line hidden - - } - ); -#line 91 "LogPage.cshtml" -} - -#line default -#line hidden - #line 11 "LogPage.cshtml" public LogPage(LogPageModel model) @@ -296,6 +61,101 @@ WriteTo(__razor_helper_writer, LogRow(new LogInfo() 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))) + { + + WriteLiteralTo(writer, " \r\n "); + WriteTo(writer, string.Format("{0:MM/dd/yy}", log.Time)); + + WriteLiteralTo(writer, "\r\n "); + WriteTo(writer, string.Format("{0:H:mm:ss}", log.Time)); + + WriteLiteralTo(writer, $"\r\n "); + WriteTo(writer, log.Name); + var severity = log.Severity.ToString().ToLowerInvariant(); + WriteLiteralTo(writer, $"\r\n "); + WriteTo(writer, log.Severity); + + WriteLiteralTo(writer, $"\r\n \r\n"); + + for (var i = 0; i < level; i++) + { + WriteLiteralTo(writer, " \r\n"); + } + + WriteLiteralTo(writer, " "); + WriteTo(writer, log.Message); + + WriteLiteralTo(writer, $"\r\n \r\n "); + + WriteTo(writer, log.Exception); + + WriteLiteralTo(writer, "\r\n \r\n"); + + } + }); + } + + public HelperResult Traverse(ScopeNode node, int level, Dictionary counts) + { + return new HelperResult((writer) => { + // print start of scope + WriteTo(writer, LogRow(new LogInfo() + { + Name = node.Name, + Time = node.StartTime, + Severity = LogLevel.Verbose, + 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) + { + WriteTo(writer, LogRow(node.Messages[messageIndex], level)); + + counts[node.Messages[messageIndex].Severity.ToString()]++; + messageIndex++; + } + else + { + WriteTo(writer, Traverse(node.Children[childIndex], level + 1, counts)); + childIndex++; + } + } + if (messageIndex < node.Messages.Count) + { + for (var i = messageIndex; i < node.Messages.Count; i++) + { + WriteTo(writer, LogRow(node.Messages[i], level)); + counts[node.Messages[i].Severity.ToString()]++; + } + } + else + { + for (var i = childIndex; i < node.Children.Count; i++) + { + WriteTo(writer, Traverse(node.Children[i], level + 1, counts)); + } + } + // print end of scope + WriteTo(writer, LogRow(new LogInfo() + { + Name = node.Name, + Time = node.EndTime, + Severity = LogLevel.Verbose, + Message = string.Format("Completed {0} in {1}ms", node.State, node.EndTime - node.StartTime) + }, level)); + }); + } + #line default #line hidden #line hidden @@ -306,10 +166,14 @@ WriteTo(__razor_helper_writer, LogRow(new LogInfo() #pragma warning disable 1998 public override async Task ExecuteAsync() { - Response.ContentType = "text/html; charset=utf-8"; - WriteLiteral("\r\n"); - WriteLiteral("\r\n\r\n"); WriteLiteral("\r\n"); +#line 114 "LogPage.cshtml" + + Response.ContentType = "text/html"; + +#line default +#line hidden + WriteLiteral(@" @@ -318,155 +182,8 @@ WriteTo(__razor_helper_writer, LogRow(new LogInfo() ASP.NET Logs @@ -474,13 +191,13 @@ tr:nth-child(2n) {
\r\n (Model.Options.NamePrefix, 3790), false)); + BeginWriteAttribute("value", " value=\"", 5190, "\"", 5223, 1); + WriteAttributeValue("", 5198, Model.Options.NamePrefix, 5198, 25, false); + EndWriteAttribute(); WriteLiteral(@" />
@@ -553,13 +273,13 @@ tr:nth-child(2n) { "); -#line 145 "LogPage.cshtml" +#line 170 "LogPage.cshtml" #line default #line hidden -#line 145 "LogPage.cshtml" +#line 170 "LogPage.cshtml" foreach (var activity in Model.Activities.Reverse()) { @@ -567,13 +287,13 @@ tr:nth-child(2n) { #line hidden WriteLiteral(" \r\n \r\n"); -#line 149 "LogPage.cshtml" +#line 174 "LogPage.cshtml" #line default #line hidden -#line 149 "LogPage.cshtml" +#line 174 "LogPage.cshtml" var activityPath = Model.Path.Value + "/" + activity.Id; if (activity.HttpInfo != null) @@ -583,36 +303,38 @@ tr:nth-child(2n) { #line hidden WriteLiteral(" \t(activityPath, 4886), false)); - WriteAttribute("title", Tuple.Create(" title=\"", 4900), Tuple.Create("\"", 4931), - Tuple.Create(Tuple.Create("", 4908), Tuple.Create(activity.HttpInfo.Path, 4908), false)); + BeginWriteAttribute("href", " href=\"", 6287, "\"", 6307, 1); + WriteAttributeValue("", 6294, activityPath, 6294, 13, false); + EndWriteAttribute(); + BeginWriteAttribute("title", " title=\"", 6308, "\"", 6339, 1); + WriteAttributeValue("", 6316, activity.HttpInfo.Path, 6316, 23, false); + EndWriteAttribute(); WriteLiteral(">"); -#line 153 "LogPage.cshtml" +#line 178 "LogPage.cshtml" Write(activity.HttpInfo.Path); #line default #line hidden WriteLiteral("\r\n "); -#line 154 "LogPage.cshtml" +#line 179 "LogPage.cshtml" Write(activity.HttpInfo.Method); #line default #line hidden WriteLiteral("\r\n "); -#line 155 "LogPage.cshtml" +#line 180 "LogPage.cshtml" Write(activity.HttpInfo.Host); #line default #line hidden WriteLiteral("\r\n "); -#line 156 "LogPage.cshtml" +#line 181 "LogPage.cshtml" Write(activity.HttpInfo.StatusCode); #line default #line hidden WriteLiteral("\r\n"); -#line 157 "LogPage.cshtml" +#line 182 "LogPage.cshtml" } else if (activity.RepresentsScope) { @@ -621,18 +343,20 @@ tr:nth-child(2n) { #line hidden WriteLiteral(" (activityPath, 5328), false)); - WriteAttribute("title", Tuple.Create(" title=\"", 5342), Tuple.Create("\"", 5370), - Tuple.Create(Tuple.Create("", 5350), Tuple.Create(activity.Root.State, 5350), false)); + BeginWriteAttribute("href", " href=\"", 6729, "\"", 6749, 1); + WriteAttributeValue("", 6736, activityPath, 6736, 13, false); + EndWriteAttribute(); + BeginWriteAttribute("title", " title=\"", 6750, "\"", 6778, 1); + WriteAttributeValue("", 6758, activity.Root.State, 6758, 20, false); + EndWriteAttribute(); WriteLiteral(">"); -#line 160 "LogPage.cshtml" +#line 185 "LogPage.cshtml" Write(activity.Root.State); #line default #line hidden WriteLiteral("\r\n"); -#line 161 "LogPage.cshtml" +#line 186 "LogPage.cshtml" } else { @@ -641,18 +365,18 @@ tr:nth-child(2n) { #line hidden WriteLiteral(" (activityPath, 5540), false)); + BeginWriteAttribute("href", " href=\"", 6941, "\"", 6961, 1); + WriteAttributeValue("", 6948, activityPath, 6948, 13, false); + EndWriteAttribute(); WriteLiteral(">Non-scope Log\r\n"); -#line 165 "LogPage.cshtml" +#line 190 "LogPage.cshtml" } #line default #line hidden - WriteLiteral(@" - + WriteLiteral(@" @@ -665,13 +389,13 @@ tr:nth-child(2n) { "); -#line 179 "LogPage.cshtml" +#line 204 "LogPage.cshtml" #line default #line hidden -#line 179 "LogPage.cshtml" +#line 204 "LogPage.cshtml" var counts = new Dictionary(); counts["Critical"] = 0; @@ -684,14 +408,14 @@ tr:nth-child(2n) { #line default #line hidden - WriteLiteral("\r\n \r\n"); -#line 188 "LogPage.cshtml" + WriteLiteral(" \r\n"); +#line 213 "LogPage.cshtml" #line default #line hidden -#line 188 "LogPage.cshtml" +#line 213 "LogPage.cshtml" if (!activity.RepresentsScope) { // message not within a scope @@ -701,12 +425,12 @@ tr:nth-child(2n) { #line default #line hidden -#line 192 "LogPage.cshtml" +#line 217 "LogPage.cshtml" Write(LogRow(logInfo, 0)); #line default #line hidden -#line 192 "LogPage.cshtml" +#line 217 "LogPage.cshtml" counts[logInfo.Severity.ToString()] = 1; } @@ -717,12 +441,12 @@ tr:nth-child(2n) { #line default #line hidden -#line 197 "LogPage.cshtml" +#line 222 "LogPage.cshtml" Write(Traverse(activity.Root, 0, counts)); #line default #line hidden -#line 197 "LogPage.cshtml" +#line 222 "LogPage.cshtml" } @@ -732,19 +456,19 @@ tr:nth-child(2n) { WriteLiteral(" \r\n \r\n \r\n " + " \r\n"); -#line 203 "LogPage.cshtml" +#line 228 "LogPage.cshtml" #line default #line hidden -#line 203 "LogPage.cshtml" +#line 228 "LogPage.cshtml" foreach (var kvp in counts) { if (string.Equals("Verbose", kvp.Key)) { @@ -753,19 +477,19 @@ tr:nth-child(2n) { #line hidden WriteLiteral(" \r\n"); -#line 207 "LogPage.cshtml" +#line 232 "LogPage.cshtml" } else { @@ -774,19 +498,19 @@ tr:nth-child(2n) { #line hidden WriteLiteral(" \r\n"); -#line 211 "LogPage.cshtml" +#line 236 "LogPage.cshtml" } } @@ -796,7 +520,7 @@ tr:nth-child(2n) { WriteLiteral(" \r\n \r\n " + "
"); -#line 202 "LogPage.cshtml" +#line 227 "LogPage.cshtml" Write(activity.Time.ToString("MM-dd-yyyy HH:mm:ss")); #line default #line hidden WriteLiteral(""); -#line 206 "LogPage.cshtml" +#line 231 "LogPage.cshtml" Write(kvp.Value); #line default #line hidden WriteLiteral(" "); -#line 206 "LogPage.cshtml" +#line 231 "LogPage.cshtml" Write(kvp.Key); #line default #line hidden WriteLiteral("v"); -#line 210 "LogPage.cshtml" +#line 235 "LogPage.cshtml" Write(kvp.Value); #line default #line hidden WriteLiteral(" "); -#line 210 "LogPage.cshtml" +#line 235 "LogPage.cshtml" Write(kvp.Key); #line default #line hidden WriteLiteral("
\r\n \r\n \r\n" + " \r\n"); -#line 219 "LogPage.cshtml" +#line 244 "LogPage.cshtml" } #line default diff --git a/src/Microsoft.AspNet.Diagnostics.Elm/Views/LogPage.cshtml b/src/Microsoft.AspNet.Diagnostics.Elm/Views/LogPage.cshtml index 7be96bef63..20922f68cb 100644 --- a/src/Microsoft.AspNet.Diagnostics.Elm/Views/LogPage.cshtml +++ b/src/Microsoft.AspNet.Diagnostics.Elm/Views/LogPage.cshtml @@ -1,4 +1,4 @@ -@using System +@using System @using System.Collections.Generic @using System.Globalization @using System.Linq @@ -15,79 +15,104 @@ } public LogPageModel Model { get; set; } -} -@* writes one log row indented by the given level *@ -@helper LogRow(LogInfo log, int level) { - if (log.Severity >= Model.Options.MinLevel && - (string.IsNullOrEmpty(Model.Options.NamePrefix) || log.Name.StartsWith(Model.Options.NamePrefix, StringComparison.Ordinal))) + public HelperResult LogRow(LogInfo log, int level) { - - @string.Format("{0:MM/dd/yy}", log.Time) - @string.Format("{0:H:mm:ss}", log.Time) - @log.Name - @log.Severity - - @for (var i = 0; i < level; i++) + return new HelperResult((writer) => + { + if (log.Severity >= Model.Options.MinLevel && + (string.IsNullOrEmpty(Model.Options.NamePrefix) || log.Name.StartsWith(Model.Options.NamePrefix, StringComparison.Ordinal))) + { + + WriteLiteralTo(writer, " \r\n "); + WriteTo(writer, string.Format("{0:MM/dd/yy}", log.Time)); + + WriteLiteralTo(writer, "\r\n "); + WriteTo(writer, string.Format("{0:H:mm:ss}", log.Time)); + + WriteLiteralTo(writer, $"\r\n "); + WriteTo(writer, log.Name); + var severity = log.Severity.ToString().ToLowerInvariant(); + WriteLiteralTo(writer, $"\r\n "); + WriteTo(writer, log.Severity); + + WriteLiteralTo(writer, $"\r\n \r\n"); + + for (var i = 0; i < level; i++) { - + WriteLiteralTo(writer, " \r\n"); } - @log.Message - - @log.Exception - + + WriteLiteralTo(writer, " "); + WriteTo(writer, log.Message); + + WriteLiteralTo(writer, $"\r\n \r\n "); + + WriteTo(writer, log.Exception); + + WriteLiteralTo(writer, "\r\n \r\n"); + + } + }); + } + + public HelperResult Traverse(ScopeNode node, int level, Dictionary counts) + { + return new HelperResult((writer) => { + // print start of scope + WriteTo(writer, LogRow(new LogInfo() + { + Name = node.Name, + Time = node.StartTime, + Severity = LogLevel.Verbose, + 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) + { + WriteTo(writer, LogRow(node.Messages[messageIndex], level)); + + counts[node.Messages[messageIndex].Severity.ToString()]++; + messageIndex++; + } + else + { + WriteTo(writer, Traverse(node.Children[childIndex], level + 1, counts)); + childIndex++; + } + } + if (messageIndex < node.Messages.Count) + { + for (var i = messageIndex; i < node.Messages.Count; i++) + { + WriteTo(writer, LogRow(node.Messages[i], level)); + counts[node.Messages[i].Severity.ToString()]++; + } + } + else + { + for (var i = childIndex; i < node.Children.Count; i++) + { + WriteTo(writer, Traverse(node.Children[i], level + 1, counts)); + } + } + // print end of scope + WriteTo(writer, LogRow(new LogInfo() + { + Name = node.Name, + Time = node.EndTime, + Severity = LogLevel.Verbose, + Message = string.Format("Completed {0} in {1}ms", node.State, node.EndTime - node.StartTime) + }, level)); + }); } } - -@helper Traverse(ScopeNode node, int level, Dictionary counts) -{ - // print start of scope - @LogRow(new LogInfo() - { - Name = node.Name, - Time = node.StartTime, - Severity = LogLevel.Verbose, - 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) - { - @LogRow(node.Messages[messageIndex], level) - counts[node.Messages[messageIndex].Severity.ToString()]++; - messageIndex++; - } - else - { - @Traverse(node.Children[childIndex], level + 1, counts) - childIndex++; - } - } - if (messageIndex < node.Messages.Count) - { - for (var i = messageIndex; i < node.Messages.Count; i++) - { - @LogRow(node.Messages[i], level) - counts[node.Messages[i].Severity.ToString()]++; - } - } - else - { - for (var i = childIndex; i < node.Children.Count; i++) - { - @Traverse(node.Children[i], level + 1, counts) - } - } - // print end of scope - @LogRow(new LogInfo() - { - Name = node.Name, - Time = node.EndTime, - Severity = LogLevel.Verbose, - Message = string.Format("Completed {0} in {1}ms", node.State, node.EndTime - node.StartTime) - }, level); +@{ + Response.ContentType = "text/html"; } diff --git a/src/Microsoft.AspNet.Diagnostics.Elm/project.json b/src/Microsoft.AspNet.Diagnostics.Elm/project.json index a3f79b9424..6adf371510 100644 --- a/src/Microsoft.AspNet.Diagnostics.Elm/project.json +++ b/src/Microsoft.AspNet.Diagnostics.Elm/project.json @@ -9,7 +9,6 @@ "Microsoft.AspNet.Diagnostics": "1.0.0-*", "Microsoft.Extensions.Logging.Abstractions": "1.0.0-*" }, - "frameworks": { "dnx451": { }, "dnxcore50": { @@ -17,5 +16,6 @@ "System.Threading": "4.0.11-beta-*" } } - } + }, + "compileExclude": ["Views/*.cshtml"] } diff --git a/src/Microsoft.AspNet.Diagnostics.Entity/Views/DatabaseErrorPage.cs b/src/Microsoft.AspNet.Diagnostics.Entity/Views/DatabaseErrorPage.cs index a5c276685e..e9c5b18def 100644 --- a/src/Microsoft.AspNet.Diagnostics.Entity/Views/DatabaseErrorPage.cs +++ b/src/Microsoft.AspNet.Diagnostics.Entity/Views/DatabaseErrorPage.cs @@ -74,7 +74,6 @@ using Microsoft.AspNet.Diagnostics.Entity.Views #line default #line hidden - WriteLiteral("\r\n"); WriteLiteral("\r\n\r\n\r\n\r" + "\n \r\n Internal Server Error\r\n \r\n body {\r\n font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif;\r\n font-size: .813em;\r\n line-height: 1.4em;\r\n color: #222;\r\n}\r\n\r\nh1, h2, h3, h4, h5 {\r\n font-weight: 100;\r\n}\r\n\r\nh1 {\r\n color: #44525e;\r\n margin: 15px 0 15px 0;\r\n}\r\n\r\nh2 {\r\n margin: 10px 5px 0 0;\r\n}\r\n\r\nh3 {\r\n color: #363636;\r\n margin: 5px 5px 0 0;\r\n}\r\n\r\ncode {\r\n font-family: Consolas, \"Courier New\", courier, monospace;\r\n}\r\n\r\na {\r\n color: #1ba1e2;\r\n text-decoration: none;\r\n}\r\n\r\n a:hover {\r\n color: #13709e;\r\n text-decoration: underline;\r\n }\r\n\r\nhr {\r\n border: 1px #ddd solid;\r\n}\r\n\r\nbody .titleerror {\r\n padding: 3px;\r\n}\r\n\r\n#applyMigrations {\r\n font-size: 14px;\r\n background: #44c5f2;\r\n color: #ffffff;\r\n display: inline-block;\r\n padding: 6px 12px;\r\n margin-bottom: 0;\r\n font-weight: normal;\r\n text-align: center;\r\n white-space: nowrap;\r\n vertical-align: middle;\r\n cursor: pointer;\r\n border: 1px solid transparent;\r\n}\r\n\r\n #applyMigrations:disabled {\r\n background-color: #a9e4f9;\r\n border-color: #44c5f2;\r\n }\r\n\r\n.error {\r\n color: red;\r\n}\r\n\r\n.expanded {\r\n display: block;\r\n}\r\n\r\n.collapsed {\r\n display: none;\r\n}\r\n\r\n "); diff --git a/src/Microsoft.AspNet.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.cs b/src/Microsoft.AspNet.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.cs index b64b1f4654..4367f9bfb3 100644 --- a/src/Microsoft.AspNet.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.cs +++ b/src/Microsoft.AspNet.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.cs @@ -25,7 +25,7 @@ using System.Net #line hidden ; #line 5 "CompilationErrorPage.cshtml" -using Views +using Microsoft.AspNet.Diagnostics #line default #line hidden @@ -57,8 +57,8 @@ using Views #line default #line hidden - WriteLiteral("\r\n\r\n\r\n \r\n \r\n " + -""); + WriteLiteral("<!DOCTYPE html>\r\n<html>\r\n <head>\r\n <meta charset=\"utf-8\" />\r\n <t" + +"itle>"); #line 19 "CompilationErrorPage.cshtml" Write(Resources.ErrorPageHtml_Title); @@ -98,13 +98,7 @@ using Views #line default #line hidden - WriteLiteral("\r\n"); -#line 30 "CompilationErrorPage.cshtml" - - -#line default -#line hidden - + WriteLiteral(" "); #line 30 "CompilationErrorPage.cshtml" var fileName = errorDetail.StackFrames.FirstOrDefault()?.File; @@ -128,7 +122,7 @@ using Views #line default #line hidden - WriteLiteral("\r\n <br />\r\n <ul>\r\n"); + WriteLiteral(" <br />\r\n <ul>\r\n"); #line 39 "CompilationErrorPage.cshtml" @@ -143,8 +137,9 @@ using Views #line hidden WriteLiteral(" <li class=\"frame\""); - WriteAttribute("tabindex", Tuple.Create(" tabindex=\"", 1246), Tuple.Create("\"", 1266), - Tuple.Create(Tuple.Create("", 1257), Tuple.Create<System.Object, System.Int32>(tabIndex, 1257), false)); + BeginWriteAttribute("tabindex", " tabindex=\"", 1269, "\"", 1289, 1); + WriteAttributeValue("", 1280, tabIndex, 1280, 9, false); + EndWriteAttribute(); WriteLiteral(">\r\n"); #line 42 "CompilationErrorPage.cshtml" @@ -158,13 +153,7 @@ using Views #line default #line hidden - WriteLiteral("\r\n"); -#line 43 "CompilationErrorPage.cshtml" - - -#line default -#line hidden - + WriteLiteral(" "); #line 43 "CompilationErrorPage.cshtml" if (!string.IsNullOrEmpty(frame.ErrorDetails)) { @@ -214,8 +203,9 @@ using Views #line hidden WriteLiteral(" <ol"); - WriteAttribute("start", Tuple.Create(" start=\"", 1790), Tuple.Create("\"", 1819), - Tuple.Create(Tuple.Create("", 1798), Tuple.Create<System.Object, System.Int32>(frame.PreContextLine, 1798), false)); + BeginWriteAttribute("start", " start=\"", 1813, "\"", 1842, 1); + WriteAttributeValue("", 1821, frame.PreContextLine, 1821, 21, false); + EndWriteAttribute(); WriteLiteral(" class=\"collapsible\">\r\n"); #line 54 "CompilationErrorPage.cshtml" @@ -251,8 +241,9 @@ using Views #line hidden WriteLiteral(" <ol"); - WriteAttribute("start", Tuple.Create(" start=\"", 2200), Tuple.Create("\"", 2219), - Tuple.Create(Tuple.Create("", 2208), Tuple.Create<System.Object, System.Int32>(frame.Line, 2208), false)); + BeginWriteAttribute("start", " start=\"", 2223, "\"", 2242, 1); + WriteAttributeValue("", 2231, frame.Line, 2231, 11, false); + EndWriteAttribute(); WriteLiteral(" class=\"highlight\">\r\n"); #line 61 "CompilationErrorPage.cshtml" @@ -295,8 +286,9 @@ using Views #line hidden WriteLiteral(" <ol"); - WriteAttribute("start", Tuple.Create(" start=\'", 2646), Tuple.Create("\'", 2671), - Tuple.Create(Tuple.Create("", 2654), Tuple.Create<System.Object, System.Int32>(frame.Line + 1, 2654), false)); + BeginWriteAttribute("start", " start=\'", 2669, "\'", 2694, 1); + WriteAttributeValue("", 2677, frame.Line + 1, 2677, 17, false); + EndWriteAttribute(); WriteLiteral(" class=\"collapsible\">\r\n"); #line 69 "CompilationErrorPage.cshtml" @@ -352,7 +344,7 @@ using Views #line default #line hidden - WriteLiteral(" <script>\r\n //<!--\r\n (function (window, undefined) {\r\n \"use strict\";\r\n\r\n function $(selector, element) {\r\n return new NodeCollection(selector, element);\r\n }\r\n\r\n function NodeCollection(selector, element) {\r\n this.items = [];\r\n element = element || window.document;\r\n\r\n var nodeList;\r\n\r\n if (typeof (selector) === \"string\") {\r\n nodeList = element.querySelectorAll(selector);\r\n for (var i = 0, l = nodeList.length; i < l; i++) {\r\n this.items.push(nodeList.item(i));\r\n }\r\n } else if (selector.tagName) {\r\n this.items.push(selector);\r\n } else if (selector.splice) {\r\n this.items = this.items.concat(selector);\r\n }\r\n }\r\n\r\n NodeCollection.prototype = {\r\n each: function (callback) {\r\n for (var i = 0, l = this.items.length; i < l; i++) {\r\n callback(this.items[i], i);\r\n }\r\n return this;\r\n },\r\n\r\n children: function (selector) {\r\n var children = [];\r\n\r\n this.each(function (el) {\r\n children = children.concat($(selector, el).items);\r\n });\r\n\r\n return $(children);\r\n },\r\n\r\n hide: function () {\r\n this.each(function (el) {\r\n el.style.display = \"none\";\r\n });\r\n\r\n return this;\r\n },\r\n\r\n toggle: function () {\r\n this.each(function (el) {\r\n el.style.display = el.style.display === \"none\" ? \"\" : \"none\";\r\n });\r\n\r\n return this;\r\n },\r\n\r\n show: function () {\r\n this.each(function (el) {\r\n el.style.display = \"\";\r\n });\r\n\r\n return this;\r\n },\r\n\r\n addClass: function (className) {\r\n this.each(function (el) {\r\n var existingClassName = el.className,\r\n classNames;\r\n if (!existingClassName) {\r\n el.className = className;\r\n } else {\r\n classNames = existingClassName.split(\" \");\r\n if (classNames.indexOf(className) < 0) {\r\n el.className = existingClassName + \" \" + className;\r\n }\r\n }\r\n });\r\n\r\n return this;\r\n },\r\n\r\n removeClass: function (className) {\r\n this.each(function (el) {\r\n var existingClassName = el.className,\r\n classNames, index;\r\n if (existingClassName === className) {\r\n el.className = \"\";\r\n } else if (existingClassName) {\r\n classNames = existingClassName.split(\" \");\r\n index = classNames.indexOf(className);\r\n if (index > 0) {\r\n classNames.splice(index, 1);\r\n el.className = classNames.join(\" \");\r\n }\r\n }\r\n });\r\n\r\n return this;\r\n },\r\n\r\n toggleClass: function (className) {\r\n this.each(function (el) {\r\n var classNames = el.className.split(\" \");\r\n if (classNames.indexOf(className) >= 0) {\r\n $(el).removeClass(className);\r\n } else {\r\n $(el).addClass(className);\r\n }\r\n });\r\n\r\n return this;\r\n },\r\n\r\n attr: function (name) {\r\n if (this.items.length === 0) {\r\n return null;\r\n }\r\n\r\n return this.items[0].getAttribute(name);\r\n },\r\n\r\n on: function (eventName, handler) {\r\n this.each(function (el, idx) {\r\n var callback = function (e) {\r\n e = e || window.event;\r\n if (!e.which && e.keyCode) {\r\n e.which = e.keyCode; // Normalize IE8 key events\r\n }\r\n handler.apply(el, [e]);\r\n };\r\n\r\n if (el.addEventListener) { // DOM Events\r\n el.addEventListener(eventName, callback, false);\r\n } else if (el.attachEvent) { // IE8 events\r\n el.attachEvent(\"on\" + eventName, callback);\r\n } else {\r\n el[\"on\" + type] = callback;\r\n }\r\n });\r\n\r\n return this;\r\n },\r\n\r\n click: function (handler) {\r\n return this.on(\"click\", handler);\r\n },\r\n\r\n keypress: function (handler) {\r\n return this.on(\"keypress\", handler);\r\n }\r\n };\r\n\r\n function frame(el) {\r\n $(el).children(\".source .collapsible\").toggle();\r\n }\r\n\r\n function tab(el) {\r\n var unselected = $(\"#header .selected\").removeClass(\"selected\").attr(\"id\");\r\n var selected = $(el).addClass(\"selected\").attr(\"id\");\r\n\r\n $(\"#\" + unselected + \"page\").hide();\r\n $(\"#\" + selected + \"page\").show();\r\n }\r\n\r\n $(\".collapsible\").hide();\r\n $(\".page\").hide();\r\n $(\"#stackpage\").show();\r\n\r\n $(\".frame\")\r\n .click(function () {\r\n frame(this);\r\n })\r\n .keypress(function (e) {\r\n if (e.which === 13) {\r\n frame(this);\r\n }\r\n });\r\n\r\n $(\"#header li\")\r\n .click(function () {\r\n tab(this);\r\n })\r\n .keypress(function (e) {\r\n if (e.which === 13) {\r\n tab(this);\r\n }\r\n });\r\n})(window);\r\n " + + WriteLiteral(" <script>\r\n //<!--\r\n (function (window, undefined) {\r\n \"use strict\";\r\n\r\n function $(selector, element) {\r\n return new NodeCollection(selector, element);\r\n }\r\n\r\n function NodeCollection(selector, element) {\r\n this.items = [];\r\n element = element || window.document;\r\n\r\n var nodeList;\r\n\r\n if (typeof (selector) === \"string\") {\r\n nodeList = element.querySelectorAll(selector);\r\n for (var i = 0, l = nodeList.length; i < l; i++) {\r\n this.items.push(nodeList.item(i));\r\n }\r\n } else if (selector.tagName) {\r\n this.items.push(selector);\r\n } else if (selector.splice) {\r\n this.items = this.items.concat(selector);\r\n }\r\n }\r\n\r\n NodeCollection.prototype = {\r\n each: function (callback) {\r\n for (var i = 0, l = this.items.length; i < l; i++) {\r\n callback(this.items[i], i);\r\n }\r\n return this;\r\n },\r\n\r\n children: function (selector) {\r\n var children = [];\r\n\r\n this.each(function (el) {\r\n children = children.concat($(selector, el).items);\r\n });\r\n\r\n return $(children);\r\n },\r\n\r\n hide: function () {\r\n this.each(function (el) {\r\n el.style.display = \"none\";\r\n });\r\n\r\n return this;\r\n },\r\n\r\n toggle: function () {\r\n this.each(function (el) {\r\n el.style.display = el.style.display === \"none\" ? \"\" : \"none\";\r\n });\r\n\r\n return this;\r\n },\r\n\r\n show: function () {\r\n this.each(function (el) {\r\n el.style.display = \"\";\r\n });\r\n\r\n return this;\r\n },\r\n\r\n addClass: function (className) {\r\n this.each(function (el) {\r\n var existingClassName = el.className,\r\n classNames;\r\n if (!existingClassName) {\r\n el.className = className;\r\n } else {\r\n classNames = existingClassName.split(\" \");\r\n if (classNames.indexOf(className) < 0) {\r\n el.className = existingClassName + \" \" + className;\r\n }\r\n }\r\n });\r\n\r\n return this;\r\n },\r\n\r\n removeClass: function (className) {\r\n this.each(function (el) {\r\n var existingClassName = el.className,\r\n classNames, index;\r\n if (existingClassName === className) {\r\n el.className = \"\";\r\n } else if (existingClassName) {\r\n classNames = existingClassName.split(\" \");\r\n index = classNames.indexOf(className);\r\n if (index > 0) {\r\n classNames.splice(index, 1);\r\n el.className = classNames.join(\" \");\r\n }\r\n }\r\n });\r\n\r\n return this;\r\n },\r\n\r\n toggleClass: function (className) {\r\n this.each(function (el) {\r\n var classNames = el.className.split(\" \");\r\n if (classNames.indexOf(className) >= 0) {\r\n $(el).removeClass(className);\r\n } else {\r\n $(el).addClass(className);\r\n }\r\n });\r\n\r\n return this;\r\n },\r\n\r\n attr: function (name) {\r\n if (this.items.length === 0) {\r\n return null;\r\n }\r\n\r\n return this.items[0].getAttribute(name);\r\n },\r\n\r\n on: function (eventName, handler) {\r\n this.each(function (el, idx) {\r\n var callback = function (e) {\r\n e = e || window.event;\r\n if (!e.which && e.keyCode) {\r\n e.which = e.keyCode; // Normalize IE8 key events\r\n }\r\n handler.apply(el, [e]);\r\n };\r\n\r\n if (el.addEventListener) { // DOM Events\r\n el.addEventListener(eventName, callback, false);\r\n } else if (el.attachEvent) { // IE8 events\r\n el.attachEvent(\"on\" + eventName, callback);\r\n } else {\r\n el[\"on\" + type] = callback;\r\n }\r\n });\r\n\r\n return this;\r\n },\r\n\r\n click: function (handler) {\r\n return this.on(\"click\", handler);\r\n },\r\n\r\n keypress: function (handler) {\r\n return this.on(\"keypress\", handler);\r\n }\r\n };\r\n\r\n function frame(el) {\r\n $(el).children(\".source .collapsible\").toggle();\r\n }\r\n\r\n function tab(el) {\r\n var unselected = $(\"#header .selected\").removeClass(\"selected\").attr(\"id\");\r\n var selected = $(el).addClass(\"selected\").attr(\"id\");\r\n\r\n $(\"#\" + unselected + \"page\").hide();\r\n $(\"#\" + selected + \"page\").show();\r\n }\r\n\r\n $(\".collapsible\").hide();\r\n $(\".page\").hide();\r\n $(\"#stackpage\").show();\r\n\r\n $(\"#rawExceptionButton\").click(function () {\r\n var div = document.getElementById('rawException');\r\n div.style.display = 'inline-block';\r\n div.scrollIntoView(true);\r\n });\r\n\r\n $(\".frame\")\r\n .click(function () {\r\n frame(this);\r\n })\r\n .keypress(function (e) {\r\n if (e.which === 13) {\r\n frame(this);\r\n }\r\n });\r\n\r\n $(\"#header li\")\r\n .click(function () {\r\n tab(this);\r\n })\r\n .keypress(function (e) {\r\n if (e.which === 13) {\r\n tab(this);\r\n }\r\n });\r\n})(window);\r\n " + " //-->\r\n </script>\r\n </body>\r\n</html>\r\n"); } #pragma warning restore 1998 diff --git a/src/Microsoft.AspNet.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.cshtml b/src/Microsoft.AspNet.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.cshtml index 5e7c80164a..db1fd3c613 100644 --- a/src/Microsoft.AspNet.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.cshtml +++ b/src/Microsoft.AspNet.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.cshtml @@ -2,7 +2,7 @@ @using System.Globalization @using System.Linq @using System.Net -@using Views +@using Microsoft.AspNet.Diagnostics @functions { public CompilationErrorPageModel Model { get; set; } diff --git a/src/Microsoft.AspNet.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cs b/src/Microsoft.AspNet.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cs index bc2ec0e7f7..0fcf12eba9 100644 --- a/src/Microsoft.AspNet.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cs +++ b/src/Microsoft.AspNet.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cs @@ -25,7 +25,13 @@ using System.Net #line hidden ; #line 5 "ErrorPage.cshtml" -using Views +using Microsoft.AspNet.Diagnostics.Views + +#line default +#line hidden + ; +#line 6 "ErrorPage.cshtml" +using Microsoft.AspNet.Diagnostics #line default #line hidden @@ -34,7 +40,7 @@ using Views public class ErrorPage : Microsoft.AspNet.Diagnostics.Views.BaseView { -#line 7 "ErrorPage.cshtml" +#line 8 "ErrorPage.cshtml" public ErrorPage(ErrorPageModel model) { @@ -53,7 +59,7 @@ using Views #pragma warning disable 1998 public override async Task ExecuteAsync() { -#line 15 "ErrorPage.cshtml" +#line 16 "ErrorPage.cshtml" // TODO: Response.ReasonPhrase = "Internal Server Error"; Response.ContentType = "text/html; charset=utf-8"; @@ -62,31 +68,32 @@ using Views #line default #line hidden - WriteLiteral("\r\n<!DOCTYPE html>\r\n<html"); - WriteAttribute("lang", Tuple.Create(" lang=\"", 431), Tuple.Create("\"", 492), - Tuple.Create(Tuple.Create("", 438), Tuple.Create<System.Object, System.Int32>(CultureInfo.CurrentUICulture.TwoLetterISOLanguageName, 438), false)); + WriteLiteral("<!DOCTYPE html>\r\n<html"); + BeginWriteAttribute("lang", " lang=\"", 497, "\"", 558, 1); + WriteAttributeValue("", 504, CultureInfo.CurrentUICulture.TwoLetterISOLanguageName, 504, 54, false); + EndWriteAttribute(); WriteLiteral(" xmlns=\"http://www.w3.org/1999/xhtml\">\r\n <head>\r\n <meta charset=\"utf-8\"" + " />\r\n <title>"); -#line 24 "ErrorPage.cshtml" +#line 25 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_Title); #line default #line hidden WriteLiteral("\r\n