Inheritance: WebTemplateBase
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 7 "..\..\ErrorDetailPage.cshtml"

            var basePageName = Request.ServerVariables["URL"];

            //
            // Retrieve the ID of the error to display and read it from
            // the store.
            //

            var errorId = Request.QueryString["id"] ?? string.Empty;

            if (errorId.Length == 0)
            {
                return;
            }

            var log        = this.ErrorLog ?? ErrorLog.GetDefault(Context);
            var errorEntry = log.GetError(errorId);

            //
            // Perhaps the error has been deleted from the store? Whatever
            // the reason, bail out silently.
            //

            if (errorEntry == null)
            {
                Response.Status = HttpStatus.NotFound.ToString();


            #line default
            #line hidden
                WriteLiteral("    <p>Error not found in log.</p>\r\n");



            #line 34 "..\..\ErrorDetailPage.cshtml"
                return;
            }

            var title = string.Format("Error: {0} [{1}]", errorEntry.Error.Type, errorEntry.Id);

            Layout = new Elmah.MasterPage
            {
                Context       = Context, /* TODO Consider not requiring this */
                Title         = title,
                Footnote      = string.Format("This log is provided by the {0}.", log.Name),
                SpeedBarItems = new[]
                {
                    SpeedBar.Home.Format(basePageName),
                    SpeedBar.Help,
                    SpeedBar.About.Format(basePageName),
                },
            };

            var error = errorEntry.Error;



            #line default
            #line hidden
            WriteLiteral("\r\n");



            WriteLiteral("\r\n\r\n<h1 id=\"PageTitle\">");



            #line 59 "..\..\ErrorDetailPage.cshtml"
            Write(error.Message);


            #line default
            #line hidden
            WriteLiteral("</h1>\r\n\r\n<p id=\"ErrorTitle\">");



            WriteLiteral("<span id=\"ErrorType\">");



            #line 62 "..\..\ErrorDetailPage.cshtml"
            Write(error.Type);


            #line default
            #line hidden
            WriteLiteral("</span>");



            WriteLiteral("<span id=\"ErrorTypeMessageSeparator\">: </span>");



            WriteLiteral("<span id=\"ErrorMessage\">");



            #line 64 "..\..\ErrorDetailPage.cshtml"
            Write(error.Message);


            #line default
            #line hidden
            WriteLiteral("</span>\r\n</p>\r\n\r\n");



            WriteLiteral("\r\n\r\n");



            #line 75 "..\..\ErrorDetailPage.cshtml"
            if (error.Detail.Length != 0)
            {
            #line default
            #line hidden
                WriteLiteral("    <pre id=\"ErrorDetail\">");



            #line 77 "..\..\ErrorDetailPage.cshtml"
                Write(MarkupStackTrace(error.Detail));


            #line default
            #line hidden
                WriteLiteral("</pre>\r\n");



            #line 78 "..\..\ErrorDetailPage.cshtml"
            }



            #line default
            #line hidden


            #line 84 "..\..\ErrorDetailPage.cshtml"



            #line default
            #line hidden
            WriteLiteral("\r\n<p id=\"ErrorLogTime\">");



            #line 86 "..\..\ErrorDetailPage.cshtml"
            Write(string.Format(
                      @"Logged on {0} at {1}",
                      error.Time.ToLongDateString(),
                      error.Time.ToLongTimeString()));


            #line default
            #line hidden
            WriteLiteral("\r\n</p>\r\n\r\n");



            WriteLiteral("\r\n\r\n<p>See also:</p>\r\n\r\n<ul>\r\n\r\n    ");



            WriteLiteral("\r\n\r\n");



            #line 107 "..\..\ErrorDetailPage.cshtml"
            if (error.WebHostHtmlMessage.Length != 0)
            {
                var htmlUrl = basePageName + "/html?id=" + Uri.EscapeDataString(errorEntry.Id);


            #line default
            #line hidden
                WriteLiteral("        <li><a href=\"");



            #line 110 "..\..\ErrorDetailPage.cshtml"
                Write(basePageName);


            #line default
            #line hidden
                WriteLiteral("/html?id=");



            #line 110 "..\..\ErrorDetailPage.cshtml"
                Write(Uri.EscapeDataString(errorEntry.Id));


            #line default
            #line hidden
                WriteLiteral("\">Original ASP.NET error page</a></li>\r\n");



            #line 111 "..\..\ErrorDetailPage.cshtml"
            }



            #line default
            #line hidden


            #line 115 "..\..\ErrorDetailPage.cshtml"



            #line default
            #line hidden
            WriteLiteral("\r\n    <li>Raw/Source data in \r\n        <a rel=\"");



            #line 118 "..\..\ErrorDetailPage.cshtml"
            Write(HtmlLinkType.Alternate);


            #line default
            #line hidden
            WriteLiteral("\" \r\n           type=\"application/xml\" \r\n           href=\"xml");



            #line 120 "..\..\ErrorDetailPage.cshtml"
            Write(Request.Url.Query);


            #line default
            #line hidden
            WriteLiteral("\">XML</a>\r\n        or in\r\n        <a rel=\"");



            #line 122 "..\..\ErrorDetailPage.cshtml"
            Write(HtmlLinkType.Alternate);


            #line default
            #line hidden
            WriteLiteral("\" \r\n           type=\"application/json\" \r\n           href=\"json");



            #line 124 "..\..\ErrorDetailPage.cshtml"
            Write(Request.Url.Query);


            #line default
            #line hidden
            WriteLiteral("\">JSON</a>\r\n    </li>\r\n</ul>\r\n\r\n");



            WriteLiteral("\r\n\r\n");



            #line 142 "..\..\ErrorDetailPage.cshtml"

            var details = new[]
            {
                new {
                    Data  = error.ServerVariables,
                    Id    = "ServerVariables",
                    Title = "Server Variables"
                },
                new
                {
                    Data  = error.AdditionalData,
                    Id    = "AdditionalData",
                    Title = "Additional Data"
                }
            };

            //
            // If the collection isn't there or it's empty, then bail out.
            //
            foreach (var collection in details)
            {
                if (collection.Data != null && collection.Data.Count > 0)
                {
                    var items =
                        from i in Enumerable.Range(0, collection.Data.Count)
                        select new
                    {
                        Index = i,
                        Key   = collection.Data.GetKey(i),
                        Value = collection.Data[i],
                    };

                    items = items.OrderBy(e => e.Key, StringComparer.OrdinalIgnoreCase);



            #line default
            #line hidden
                    WriteLiteral("            <div id=\"");



            #line 176 "..\..\ErrorDetailPage.cshtml"
                    Write(collection.Id);


            #line default
            #line hidden
                    WriteLiteral("\">\r\n\r\n                <h2>");



            #line 178 "..\..\ErrorDetailPage.cshtml"
                    Write(collection.Title);


            #line default
            #line hidden
                    WriteLiteral("</h2>\r\n                ");



                    WriteLiteral(@"

                <div class=""scroll-view"">

                    <table cellspacing=""0"" style=""border-collapse: collapse;"" class=""table table-condensed table-striped"">
                        <tr>
                            <th class=""name-col"" style=""white-space: nowrap;"">Name</th>
                            <th class=""value-col"" style=""white-space: nowrap;"">Value</th>
                        </tr>

");



            #line 194 "..\..\ErrorDetailPage.cshtml"
                    foreach (var item in items)
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <tr class=\"");



            #line 196 "..\..\ErrorDetailPage.cshtml"
                        Write(item.Index % 2 == 0 ? "even" : "odd");


            #line default
            #line hidden
                        WriteLiteral("\">\r\n                                <td class=\"key-col\">");



            #line 197 "..\..\ErrorDetailPage.cshtml"
                        Write(item.Key);


            #line default
            #line hidden
                        WriteLiteral("</td>\r\n                                <td class=\"value-col\">");



            #line 198 "..\..\ErrorDetailPage.cshtml"
                        Write(item.Value);


            #line default
            #line hidden
                        WriteLiteral("</td>\r\n                            </tr>\r\n");



            #line 200 "..\..\ErrorDetailPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("\r\n                    </table>\r\n                </div>\r\n            </div>\r\n");



            #line 205 "..\..\ErrorDetailPage.cshtml"
                }
            }



            #line default
            #line hidden
            WriteLiteral("\r\n");



            WriteLiteral("\r\n");
        }
Beispiel #2
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 8 "..\..\ErrorLogPage.cshtml"

            const int defaultPageSize = 15;
            const int maximumPageSize = 100;

            var basePageName = Request.ServerVariables["URL"];

            //
            // Get the page index and size parameters within their bounds.
            //

            var pageSize = Convert.ToInt32(Request.QueryString["size"], CultureInfo.InvariantCulture);
            pageSize = Math.Min(maximumPageSize, Math.Max(0, pageSize));

            if (pageSize == 0)
            {
                pageSize = defaultPageSize;
            }

            var pageIndex = Convert.ToInt32(Request.QueryString["page"], CultureInfo.InvariantCulture);
            pageIndex = Math.Max(1, pageIndex) - 1;

            //
            // Read the error records.
            //

            var log            = this.ErrorLog ?? ErrorLog.GetDefault(Context);
            var errorEntryList = new List <ErrorLogEntry>(pageSize);
            var totalCount     = log.GetErrors(pageIndex, pageSize, errorEntryList);

            //
            // Set the title of the page.
            //

            var hostName = Elmah.Environment.TryGetMachineName(Context);
            var title    = string.Format(
                hostName.Length > 0
        ? "Error log for {0} on {2} (Page #{1})"
        : "Error log for {0} (Page #{1})",
                log.ApplicationName, (pageIndex + 1).ToString("N0"), hostName);

            Layout = new Elmah.MasterPage
            {
                Context       = Context, /* TODO Consider not requiring this */
                Title         = title,
                Footnote      = string.Format("This log is provided by the {0}.", log.Name),
                SpeedBarItems = new[]
                {
                    SpeedBar.RssFeed.Format(basePageName),
                    SpeedBar.RssDigestFeed.Format(basePageName),
                    SpeedBar.DownloadLog.Format(basePageName),
                    SpeedBar.Help,
                    SpeedBar.About.Format(basePageName),
                },
            };

            // If the application name matches the APPL_MD_PATH then its
            // of the form /LM/W3SVC/.../<name>. In this case, use only the
            // <name> part to reduce the noise. The full application name is
            // still made available through a tooltip.

            var simpleName = log.ApplicationName;

            if (string.Compare(simpleName, Request.ServerVariables["APPL_MD_PATH"],
                               true, CultureInfo.InvariantCulture) == 0)
            {
                var lastSlashIndex = simpleName.LastIndexOf('/');

                if (lastSlashIndex > 0)
                {
                    simpleName = simpleName.Substring(lastSlashIndex + 1);
                }
            }



            #line default
            #line hidden
            WriteLiteral("        <h1 id=\"PageTitle\">\r\n            Error Log for <span id=\"ApplicationName\"" +
                         " title=\"");



            #line 82 "..\..\ErrorLogPage.cshtml"
            Write(log.ApplicationName);


            #line default
            #line hidden
            WriteLiteral("\">");



            #line 82 "..\..\ErrorLogPage.cshtml"
            Write(simpleName);


            #line default
            #line hidden
            WriteLiteral(" \r\n");



            #line 83 "..\..\ErrorLogPage.cshtml"
            if (!string.IsNullOrEmpty(hostName))
            {
            #line default
            #line hidden
                WriteLiteral("                ");

                WriteLiteral(" on ");



            #line 85 "..\..\ErrorLogPage.cshtml"
                Write(hostName);


            #line default
            #line hidden
                WriteLiteral(" \r\n");



            #line 86 "..\..\ErrorLogPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("            </span>\r\n        </h1>\r\n        \r\n");



            #line 90 "..\..\ErrorLogPage.cshtml"
            if (errorEntryList.Count > 0)
            {
                // Write error number range displayed on this page and the
                // total available in the log, followed by stock
                // page sizes.

                var firstErrorNumber = pageIndex * pageSize + 1;
                var lastErrorNumber  = firstErrorNumber + errorEntryList.Count - 1;
                var totalPages       = (int)Math.Ceiling((double)totalCount / pageSize);

                // Write out a set of stock page size choices. Note that
                // selecting a stock page size re-starts the log
                // display from the first page to get the right paging.

                var stockSizes =
                    from sizes in new[]
                {
                    new[] { 10, 15, 20, 25, 30, 50, 100, },
                }
                from size in sizes.Index()
                let separator =
                    size.Key + 1 == sizes.Length
                    ? null
                    : size.Key + 2 == sizes.Length
                    ? " or "
                    : ", "
                    select LinkHere(basePageName, HtmlLinkType.Start, size.Value.ToString("N0"), 0, size.Value)
                    + separator;



            #line default
            #line hidden
                WriteLiteral("            <p>Errors ");



            #line 119 "..\..\ErrorLogPage.cshtml"
                Write(firstErrorNumber.ToString("N0"));


            #line default
            #line hidden
                WriteLiteral(" to ");



            #line 119 "..\..\ErrorLogPage.cshtml"
                Write(lastErrorNumber.ToString("N0"));


            #line default
            #line hidden
                WriteLiteral(" \r\n                of total ");



            #line 120 "..\..\ErrorLogPage.cshtml"
                Write(totalCount.ToString("N0"));


            #line default
            #line hidden
                WriteLiteral(" \r\n                (page ");



            #line 121 "..\..\ErrorLogPage.cshtml"
                Write((pageIndex + 1).ToString("N0"));


            #line default
            #line hidden
                WriteLiteral(" of ");



            #line 121 "..\..\ErrorLogPage.cshtml"
                Write(totalPages.ToString("N0"));


            #line default
            #line hidden
                WriteLiteral("). \r\n                Start with ");



            #line 122 "..\..\ErrorLogPage.cshtml"
                Write(Html(stockSizes.ToDelimitedString(string.Empty)));


            #line default
            #line hidden
                WriteLiteral(" errors per page.</p>\r\n");



            #line 123 "..\..\ErrorLogPage.cshtml"

                // Write out the main table to display the errors.



            #line default
            #line hidden
                WriteLiteral(@"            <table id=""ErrorLog"" cellspacing=""0"" style=""border-collapse:collapse;"" class=""table table-condensed table-striped"">
                <tr>
                    <th class=""host-col"" style=""white-space:nowrap;"">Host</th>
                    <th class=""code-col"" style=""white-space:nowrap;"">Code</th>
                    <th class=""type-col"" style=""white-space:nowrap;"">Type</th>
                    <th class=""error-col"" style=""white-space:nowrap;"">Error</th>
                    <th class=""user-col"" style=""white-space:nowrap;"">User</th>
                    <th class=""time-col"" style=""white-space:nowrap;"">When</th>
                </tr>

");



            #line 136 "..\..\ErrorLogPage.cshtml"
                foreach (var error in from item in errorEntryList.Index()
                         let e = item.Value.Error
                                 select new
                {
                    Index = item.Key,
                    item.Value.Id,
                    e.HostName,
                    e.StatusCode,
                    StatusDescription =
                        e.StatusCode > 0
                                          ? HttpWorkerRequest.GetStatusDescription(e.StatusCode)
                                          : null,
                    e.Type,
                    HumaneType = ErrorDisplay.HumaneExceptionErrorType(e),
                    e.Message,
                    e.User,
                    When = FuzzyTime.FormatInEnglish(e.Time),
                    Iso8601Time = e.Time.ToString("o"),
                })
                {
            #line default
            #line hidden
                    WriteLiteral("                <tr class=\"");



            #line 156 "..\..\ErrorLogPage.cshtml"
                    Write(error.Index % 2 == 0 ? "even" : "odd");


            #line default
            #line hidden
                    WriteLiteral("\">\r\n                    \r\n                    <td class=\"host-col\" style=\"white-s" +
                                 "pace:nowrap;\">");



            #line 158 "..\..\ErrorLogPage.cshtml"
                    Write(error.HostName);


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                    <td class=\"code-col\" style=\"white-space:nowrap;\">\r\n");



            #line 160 "..\..\ErrorLogPage.cshtml"
                    if (!string.IsNullOrEmpty(error.StatusDescription))
                    {
            #line default
            #line hidden
                        WriteLiteral("                            <span title=\"");



            #line 162 "..\..\ErrorLogPage.cshtml"
                        Write(error.StatusDescription);


            #line default
            #line hidden
                        WriteLiteral("\">");



            #line 162 "..\..\ErrorLogPage.cshtml"
                        Write(error.StatusCode);


            #line default
            #line hidden
                        WriteLiteral("</span>\r\n");



            #line 163 "..\..\ErrorLogPage.cshtml"
                    }
                    else if (error.StatusCode != 0)
                    {
            #line default
            #line hidden

            #line 166 "..\..\ErrorLogPage.cshtml"
                        Write(error.StatusCode);


            #line default
            #line hidden

            #line 166 "..\..\ErrorLogPage.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("                    </td>\r\n                    <td class=\"type-col\" style=\"white-" +
                                 "space:nowrap;\"><span title=\"");



            #line 169 "..\..\ErrorLogPage.cshtml"
                    Write(error.Type);


            #line default
            #line hidden
                    WriteLiteral("\">");



            #line 169 "..\..\ErrorLogPage.cshtml"
                    Write(error.HumaneType);


            #line default
            #line hidden
                    WriteLiteral("</span></td>\r\n                    \r\n                    <td class=\"error-col\"><sp" +
                                 "an>");



            #line 171 "..\..\ErrorLogPage.cshtml"
                    Write(error.Message);


            #line default
            #line hidden
                    WriteLiteral("</span> \r\n                        <a href=\"");



            #line 172 "..\..\ErrorLogPage.cshtml"
                    Write(basePageName);


            #line default
            #line hidden
                    WriteLiteral("/detail?id=");



            #line 172 "..\..\ErrorLogPage.cshtml"
                    Write(error.Id);


            #line default
            #line hidden
                    WriteLiteral("\">Details&hellip;</a></td>\r\n                    \r\n                    <td class=\"" +
                                 "user-col\" style=\"white-space:nowrap;\">");



            #line 174 "..\..\ErrorLogPage.cshtml"
                    Write(error.User);


            #line default
            #line hidden
                    WriteLiteral("</td>\r\n                    <td class=\"time-col\" style=\"white-space:nowrap;\"><abbr" +
                                 " title=\"");



            #line 175 "..\..\ErrorLogPage.cshtml"
                    Write(error.Iso8601Time);


            #line default
            #line hidden
                    WriteLiteral("\">");



            #line 175 "..\..\ErrorLogPage.cshtml"
                    Write(error.When);


            #line default
            #line hidden
                    WriteLiteral("</abbr></td>\r\n                </tr>\r\n");



            #line 177 "..\..\ErrorLogPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("            </table>\r\n");



            #line 179 "..\..\ErrorLogPage.cshtml"

                // Write out page navigation links.

                //
                // If not on the last page then render a link to the next page.
                //

                var nextPageIndex = pageIndex + 1;
                var moreErrors    = nextPageIndex * pageSize < totalCount;



            #line default
            #line hidden
                WriteLiteral("            <p>\r\n\r\n");



            #line 191 "..\..\ErrorLogPage.cshtml"
                if (moreErrors)
                {
            #line default
            #line hidden

            #line 193 "..\..\ErrorLogPage.cshtml"
                    Write(LinkHere(basePageName, HtmlLinkType.Next, "Next errors", nextPageIndex, pageSize));


            #line default
            #line hidden

            #line 193 "..\..\ErrorLogPage.cshtml"
                }


            #line default
            #line hidden


            #line 195 "..\..\ErrorLogPage.cshtml"
                if (pageIndex > 0 && totalCount > 0)
                {
                    if (moreErrors)
                    {
                        Write("; ");
                    }


            #line default
            #line hidden

            #line 200 "..\..\ErrorLogPage.cshtml"
                    Write(LinkHere(basePageName, HtmlLinkType.Start, "Back to first page", 0, pageSize));


            #line default
            #line hidden

            #line 200 "..\..\ErrorLogPage.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("\r\n            </p>\r\n");



            #line 204 "..\..\ErrorLogPage.cshtml"
            }
            else
            {
                // No errors found in the log, so display a corresponding
                // message.

                // It is possible that there are no error at the requested
                // page in the log (especially if it is not the first page).
                // However, if there are error in the log

                if (pageIndex > 0 && totalCount > 0)
                {
            #line default
            #line hidden
                    WriteLiteral("                <p>");



            #line 216 "..\..\ErrorLogPage.cshtml"
                    Write(LinkHere(basePageName, HtmlLinkType.Start, "Go to first page", 0, pageSize));


            #line default
            #line hidden
                    WriteLiteral(".</p>\r\n");



            #line 217 "..\..\ErrorLogPage.cshtml"
                }
                else
                {
            #line default
            #line hidden
                    WriteLiteral("                <p>No errors found.</p>\r\n");



            #line 221 "..\..\ErrorLogPage.cshtml"
                }
            }


            #line default
            #line hidden
            WriteLiteral("\r\n");


            WriteLiteral("\r\n");
        }
        public override void Execute()
        {


WriteLiteral("\r\n");






            
            #line 6 "..\..\AboutPage.cshtml"
  
    var basePageName = Request.ServerVariables["URL"];

    const string title = "About ELMAH";
    Layout = new Elmah.MasterPage
    {
        Context  = Context, /* TODO Consider not requiring this */
        Title    = title,
        SpeedBarItems = new[]
        {
            SpeedBar.Home.Format(basePageName),
            SpeedBar.Help,
            SpeedBar.About.Format(basePageName),
        },
    };

    var stamps = SccStamp.FindAll(typeof (ErrorLog).Assembly)
                          .OrderByDescending(s => s.Revision)
                          .ToArray();
        

            
            #line default
            #line hidden


WriteLiteral(@"

<script type='text/javascript' language='JavaScript'>
    function onCheckForUpdate(sender) {
        var script = document.createElement('script');
        script.type = 'text/javascript';
        script.language = 'JavaScript';
        script.src = 'https://elmah.github.io/update.js?__=' + (new Date()).getTime();
        document.getElementsByTagName('head')[0].appendChild(script);
        return false;
    }
    var ELMAH = {
        info: {
            version: '");


            
            #line 41 "..\..\AboutPage.cshtml"
                 Write(GetVersion());

            
            #line default
            #line hidden
WriteLiteral("\',\r\n            fileVersion: \'");


            
            #line 42 "..\..\AboutPage.cshtml"
                     Write(GetFileVersion());

            
            #line default
            #line hidden
WriteLiteral("\',\r\n            type: \'");


            
            #line 43 "..\..\AboutPage.cshtml"
              Write(Build.TypeLowercase);

            
            #line default
            #line hidden
WriteLiteral("\',\r\n            status: \'");


            
            #line 44 "..\..\AboutPage.cshtml"
                Write(Build.Status);

            
            #line default
            #line hidden
WriteLiteral("\',\r\n            framework: \'");


            
            #line 45 "..\..\AboutPage.cshtml"
                   Write(Build.Framework);

            
            #line default
            #line hidden
WriteLiteral("\',\r\n            imageRuntime: \'");


            
            #line 46 "..\..\AboutPage.cshtml"
                      Write(Build.ImageRuntimeVersion);

            
            #line default
            #line hidden
WriteLiteral("\'\r\n        }\r\n    };\r\n</script>\r\n\r\n<h1 id=\"PageTitle\">");


            
            #line 51 "..\..\AboutPage.cshtml"
              Write(title);

            
            #line default
            #line hidden
WriteLiteral("</h1>\r\n\r\n<p>\r\n    <button class=\"btn\"\r\n        onclick=\"return onCheckForUpdate(t" +
"his)\"\r\n        title=\"Checks if your ELMAH version is up to date (requires Inter" +
"net connection)\">Check for Update</button>\r\n</p>\r\n\r\n<p>\r\n    This <strong>");


            
            #line 60 "..\..\AboutPage.cshtml"
            Write(Build.TypeLowercase);

            
            #line default
            #line hidden
WriteLiteral("</strong>\r\n    ");


            
            #line 61 "..\..\AboutPage.cshtml"
Write(stamps.Any() ? "(SCC #" + stamps.First().Revision.ToString("N0") + ")" : null);

            
            #line default
            #line hidden
WriteLiteral("\r\n    build was compiled from the following sources for CLR ");


            
            #line 62 "..\..\AboutPage.cshtml"
                                                     Write(Build.ImageRuntimeVersion);

            
            #line default
            #line hidden
WriteLiteral(":\r\n</p>\r\n\r\n<ul>\r\n");


            
            #line 66 "..\..\AboutPage.cshtml"
     foreach (var stamp in stamps)
    {

            
            #line default
            #line hidden
WriteLiteral("        <li><code>");


            
            #line 68 "..\..\AboutPage.cshtml"
             Write(stamp.Id);

            
            #line default
            #line hidden
WriteLiteral("</code></li>        \r\n");


            
            #line 69 "..\..\AboutPage.cshtml"
    }

            
            #line default
            #line hidden
WriteLiteral("</ul>\r\n");


WriteLiteral("\r\n");


        }
        public override void Execute()
        {


WriteLiteral("\r\n");







            
            #line 7 "..\..\ErrorLogPage.cshtml"
  
    const int defaultPageSize = 15;
    const int maximumPageSize = 100;

    var basePageName = Request.ServerVariables["URL"];
    
    //
    // Get the page index and size parameters within their bounds.
    //

    var pageSize = Convert.ToInt32(Request.QueryString["size"], CultureInfo.InvariantCulture);
    pageSize = Math.Min(maximumPageSize, Math.Max(0, pageSize));

    if (pageSize == 0)
    {
        pageSize = defaultPageSize;
    }

    var pageIndex = Convert.ToInt32(Request.QueryString["page"], CultureInfo.InvariantCulture);
    pageIndex = Math.Max(1, pageIndex) - 1;

    //
    // Read the error records.
    //

    var log = this.ErrorLog ?? ErrorLog.GetDefault(Context);
    var errorEntryList = new List<ErrorLogEntry>(pageSize);
    var totalCount = log.GetErrors(pageIndex, pageSize, errorEntryList);

    //
    // Set the title of the page.
    //

    var hostName = Elmah.Environment.TryGetMachineName(Context);
    var title = string.Format(
        hostName.Length > 0
        ? "Error log for {0} on {2} (Page #{1})"
        : "Error log for {0} (Page #{1})",
        log.ApplicationName, (pageIndex + 1).ToString("N0"), hostName);

    Layout = new Elmah.MasterPage
    {
        Context  = Context, /* TODO Consider not requiring this */
        Title    = title,
        Footnote = string.Format("This log is provided by the {0}.", log.Name),
        SpeedBarItems = new[] 
        {
            SpeedBar.RssFeed.Format(basePageName),
            SpeedBar.RssDigestFeed.Format(basePageName),
            SpeedBar.DownloadLog.Format(basePageName),
            SpeedBar.Help,
            SpeedBar.About.Format(basePageName),
        },
    };
    
    // If the application name matches the APPL_MD_PATH then its
    // of the form /LM/W3SVC/.../<name>. In this case, use only the 
    // <name> part to reduce the noise. The full application name is 
    // still made available through a tooltip.

    var simpleName = log.ApplicationName;

    if (string.Compare(simpleName, Request.ServerVariables["APPL_MD_PATH"],
        true, CultureInfo.InvariantCulture) == 0)
    {
        var lastSlashIndex = simpleName.LastIndexOf('/');

        if (lastSlashIndex > 0)
        {
            simpleName = simpleName.Substring(lastSlashIndex + 1);
        }
    }
        

            
            #line default
            #line hidden
WriteLiteral("        <h1 id=\"PageTitle\">\r\n            Error Log for <span id=\"ApplicationName\"" +
" title=\"");


            
            #line 81 "..\..\ErrorLogPage.cshtml"
                                                       Write(log.ApplicationName);

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 81 "..\..\ErrorLogPage.cshtml"
                                                                             Write(simpleName);

            
            #line default
            #line hidden
WriteLiteral(" \r\n");


            
            #line 82 "..\..\ErrorLogPage.cshtml"
             if (!string.IsNullOrEmpty(hostName))
            {

            
            #line default
            #line hidden
WriteLiteral("                ");

WriteLiteral(" on ");


            
            #line 84 "..\..\ErrorLogPage.cshtml"
                     Write(hostName);

            
            #line default
            #line hidden
WriteLiteral(" \r\n");


            
            #line 85 "..\..\ErrorLogPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("            </span>\r\n        </h1>\r\n        \r\n");


            
            #line 89 "..\..\ErrorLogPage.cshtml"
         if (errorEntryList.Count > 0)
        {
            // Write error number range displayed on this page and the
            // total available in the log, followed by stock
            // page sizes.

            var firstErrorNumber = pageIndex * pageSize + 1;
            var lastErrorNumber = firstErrorNumber + errorEntryList.Count - 1;
            var totalPages = (int)Math.Ceiling((double)totalCount / pageSize);

            // Write out a set of stock page size choices. Note that
            // selecting a stock page size re-starts the log 
            // display from the first page to get the right paging.

            var stockSizes =
                from sizes in new[]
                {
                    new[] { 10, 15, 20, 25, 30, 50, 100, },
                }
                from size in sizes.Index()
                let separator = 
                    size.Key + 1 == sizes.Length 
                    ? null 
                    : size.Key + 2 == sizes.Length 
                    ? " or " 
                    : ", "
                select LinkHere(basePageName, HtmlLinkType.Start, size.Value.ToString("N0"), 0, size.Value)
                     + separator;
            

            
            #line default
            #line hidden
WriteLiteral("            <p>Errors ");


            
            #line 118 "..\..\ErrorLogPage.cshtml"
                 Write(firstErrorNumber.ToString("N0"));

            
            #line default
            #line hidden
WriteLiteral(" to ");


            
            #line 118 "..\..\ErrorLogPage.cshtml"
                                                     Write(lastErrorNumber.ToString("N0"));

            
            #line default
            #line hidden
WriteLiteral(" \r\n                of total ");


            
            #line 119 "..\..\ErrorLogPage.cshtml"
                    Write(totalCount.ToString("N0"));

            
            #line default
            #line hidden
WriteLiteral(" \r\n                (page ");


            
            #line 120 "..\..\ErrorLogPage.cshtml"
                  Write((pageIndex + 1).ToString("N0"));

            
            #line default
            #line hidden
WriteLiteral(" of ");


            
            #line 120 "..\..\ErrorLogPage.cshtml"
                                                      Write(totalPages.ToString("N0"));

            
            #line default
            #line hidden
WriteLiteral("). \r\n                Start with ");


            
            #line 121 "..\..\ErrorLogPage.cshtml"
                      Write(Html(stockSizes.ToDelimitedString(null)));

            
            #line default
            #line hidden
WriteLiteral(" errors per page.</p>\r\n");


            
            #line 122 "..\..\ErrorLogPage.cshtml"

            // Write out the main table to display the errors.


            
            #line default
            #line hidden
WriteLiteral(@"            <table id=""ErrorLog"" cellspacing=""0"" style=""border-collapse:collapse;"" class=""table table-condensed table-striped"">
                <tr>
                    <th class=""host-col"" style=""white-space:nowrap;"">Host</th>
                    <th class=""code-col"" style=""white-space:nowrap;"">Code</th>
                    <th class=""type-col"" style=""white-space:nowrap;"">Type</th>
                    <th class=""error-col"" style=""white-space:nowrap;"">Error</th>
                    <th class=""user-col"" style=""white-space:nowrap;"">User</th>
                    <th class=""time-col"" style=""white-space:nowrap;"">When</th>
                </tr>

");


            
            #line 135 "..\..\ErrorLogPage.cshtml"
             foreach (var error in from item in errorEntryList.Index()
                                   let e = item.Value.Error
                                   select new
                                   {
                                       Index = item.Key,
                                       item.Value.Id,
                                       e.HostName,                                                 
                                       e.StatusCode,
                                       StatusDescription = 
                                          e.StatusCode > 0
                                          ? HttpWorkerRequest.GetStatusDescription(e.StatusCode)
                                          : null,
                                       e.Type,
                                       HumaneType = ErrorDisplay.HumaneExceptionErrorType(e),
                                       e.Message,
                                       e.User,
                                       When = FuzzyTime.FormatInEnglish(e.Time),
                                       Iso8601Time = e.Time.ToString("o"),
                                   })
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr class=\"");


            
            #line 155 "..\..\ErrorLogPage.cshtml"
                       Write(error.Index % 2 == 0 ? "even" : "odd");

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                    \r\n                    <td class=\"host-col\" style=\"white-s" +
"pace:nowrap;\">");


            
            #line 157 "..\..\ErrorLogPage.cshtml"
                                                                Write(error.HostName);

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                    <td class=\"code-col\" style=\"white-space:nowrap;\">\r\n");


            
            #line 159 "..\..\ErrorLogPage.cshtml"
                         if (!string.IsNullOrEmpty(error.StatusDescription))
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span title=\"");


            
            #line 161 "..\..\ErrorLogPage.cshtml"
                                    Write(error.StatusDescription);

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 161 "..\..\ErrorLogPage.cshtml"
                                                              Write(error.StatusCode);

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n");


            
            #line 162 "..\..\ErrorLogPage.cshtml"
                        }
                        else if (error.StatusCode != 0)
                        {
                            
            
            #line default
            #line hidden
            
            #line 165 "..\..\ErrorLogPage.cshtml"
                       Write(error.StatusCode);

            
            #line default
            #line hidden
            
            #line 165 "..\..\ErrorLogPage.cshtml"
                                             
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td class=\"type-col\" style=\"white-" +
"space:nowrap;\"><span title=\"");


            
            #line 168 "..\..\ErrorLogPage.cshtml"
                                                                             Write(error.Type);

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 168 "..\..\ErrorLogPage.cshtml"
                                                                                          Write(error.HumaneType);

            
            #line default
            #line hidden
WriteLiteral("</span></td>\r\n                    \r\n                    <td class=\"error-col\"><sp" +
"an>");


            
            #line 170 "..\..\ErrorLogPage.cshtml"
                                           Write(error.Message);

            
            #line default
            #line hidden
WriteLiteral("</span> \r\n                        <a href=\"");


            
            #line 171 "..\..\ErrorLogPage.cshtml"
                            Write(basePageName);

            
            #line default
            #line hidden
WriteLiteral("/detail?id=");


            
            #line 171 "..\..\ErrorLogPage.cshtml"
                                                    Write(error.Id);

            
            #line default
            #line hidden
WriteLiteral("\">Details&hellip;</a></td>\r\n                    \r\n                    <td class=\"" +
"user-col\" style=\"white-space:nowrap;\">");


            
            #line 173 "..\..\ErrorLogPage.cshtml"
                                                                Write(error.User);

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                    <td class=\"time-col\" style=\"white-space:nowrap;\"><abbr" +
" title=\"");


            
            #line 174 "..\..\ErrorLogPage.cshtml"
                                                                             Write(error.Iso8601Time);

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 174 "..\..\ErrorLogPage.cshtml"
                                                                                                 Write(error.When);

            
            #line default
            #line hidden
WriteLiteral("</abbr></td>\r\n                </tr>\r\n");


            
            #line 176 "..\..\ErrorLogPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("            </table>\r\n");


            
            #line 178 "..\..\ErrorLogPage.cshtml"

            // Write out page navigation links.

            //
            // If not on the last page then render a link to the next page.
            //

            var nextPageIndex = pageIndex + 1;
            var moreErrors = nextPageIndex * pageSize < totalCount;
            

            
            #line default
            #line hidden
WriteLiteral("            <p>\r\n\r\n");


            
            #line 190 "..\..\ErrorLogPage.cshtml"
                 if (moreErrors)
                {
                    
            
            #line default
            #line hidden
            
            #line 192 "..\..\ErrorLogPage.cshtml"
               Write(LinkHere(basePageName, HtmlLinkType.Next, "Next errors", nextPageIndex, pageSize));

            
            #line default
            #line hidden
            
            #line 192 "..\..\ErrorLogPage.cshtml"
                                                                                                      
                }

            
            #line default
            #line hidden

            
            #line 194 "..\..\ErrorLogPage.cshtml"
                 if (pageIndex > 0 && totalCount > 0)
                {
                    if (moreErrors) {
                        Write("; ");
                    }
                    
            
            #line default
            #line hidden
            
            #line 199 "..\..\ErrorLogPage.cshtml"
               Write(LinkHere(basePageName, HtmlLinkType.Start, "Back to first page", 0, pageSize));

            
            #line default
            #line hidden
            
            #line 199 "..\..\ErrorLogPage.cshtml"
                                                                                                  
                }

            
            #line default
            #line hidden
WriteLiteral("\r\n            </p>\r\n");


            
            #line 203 "..\..\ErrorLogPage.cshtml"
        }
        else
        {
            // No errors found in the log, so display a corresponding
            // message.

            // It is possible that there are no error at the requested 
            // page in the log (especially if it is not the first page).
            // However, if there are error in the log

            if (pageIndex > 0 && totalCount > 0)
            {

            
            #line default
            #line hidden
WriteLiteral("                <p>");


            
            #line 215 "..\..\ErrorLogPage.cshtml"
              Write(LinkHere(basePageName, HtmlLinkType.Start, "Go to first page", 0, pageSize));

            
            #line default
            #line hidden
WriteLiteral(".</p>\r\n");


            
            #line 216 "..\..\ErrorLogPage.cshtml"
            }
            else
            {

            
            #line default
            #line hidden
WriteLiteral("                <p>No errors found.</p>\r\n");


            
            #line 220 "..\..\ErrorLogPage.cshtml"
            }
        }

            
            #line default
            #line hidden
WriteLiteral("\r\n");


WriteLiteral("\r\n");


        }
        public override void Execute()
        {


WriteLiteral("\r\n");







            
            #line 7 "..\..\ErrorDetailPage.cshtml"
  
    var basePageName = Request.ServerVariables["URL"];
    
    //
    // Retrieve the ID of the error to display and read it from 
    // the store.
    //

    var errorId = Request.QueryString["id"] ?? string.Empty;

    if (errorId.Length == 0)
    { 
        return;
    }

    var log = this.ErrorLog ?? ErrorLog.GetDefault(Context);
    var errorEntry = log.GetError(errorId);

    //
    // Perhaps the error has been deleted from the store? Whatever
    // the reason, bail out silently.
    //

    if (errorEntry == null)
    {
        Response.Status = HttpStatus.NotFound.ToString();

            
            #line default
            #line hidden
WriteLiteral("        <p>Error not found in log.</p>\r\n");


            
            #line 34 "..\..\ErrorDetailPage.cshtml"
        return;
    }

    var title = string.Format("Error: {0} [{1}]", errorEntry.Error.Type, errorEntry.Id);

    Layout = new Elmah.MasterPage
    {
        Context  = Context, /* TODO Consider not requiring this */
        Title    = title,
        Footnote = string.Format("This log is provided by the {0}.", log.Name),
        SpeedBarItems = new[] 
        {
            SpeedBar.Home.Format(basePageName),
            SpeedBar.Help,
            SpeedBar.About.Format(basePageName),
        },
    };

    var error = errorEntry.Error;


            
            #line default
            #line hidden
WriteLiteral("\r\n");



WriteLiteral("\r\n\r\n<h1 id=\"PageTitle\">");


            
            #line 59 "..\..\ErrorDetailPage.cshtml"
              Write(error.Message);

            
            #line default
            #line hidden
WriteLiteral("</h1>\r\n\r\n<p id=\"ErrorTitle\">");



WriteLiteral("<span id=\"ErrorType\">");


            
            #line 62 "..\..\ErrorDetailPage.cshtml"
                      Write(error.Type);

            
            #line default
            #line hidden
WriteLiteral("</span>");



WriteLiteral("<span id=\"ErrorTypeMessageSeparator\">: </span>");



WriteLiteral("<span id=\"ErrorMessage\">");


            
            #line 64 "..\..\ErrorDetailPage.cshtml"
                         Write(error.Message);

            
            #line default
            #line hidden
WriteLiteral("</span></p>\r\n\r\n");



WriteLiteral("\r\n\r\n");


            
            #line 74 "..\..\ErrorDetailPage.cshtml"
 if (error.Detail.Length != 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <pre id=\"ErrorDetail\">");


            
            #line 76 "..\..\ErrorDetailPage.cshtml"
                     Write(MarkupStackTrace(error.Detail));

            
            #line default
            #line hidden
WriteLiteral("</pre>\r\n");


            
            #line 77 "..\..\ErrorDetailPage.cshtml"
}


            
            #line default
            #line hidden

            
            #line 83 "..\..\ErrorDetailPage.cshtml"
  

            
            #line default
            #line hidden
WriteLiteral("\r\n<p id=\"ErrorLogTime\">");


            
            #line 85 "..\..\ErrorDetailPage.cshtml"
                Write(string.Format(
    @"Logged on {0} at {1}",
    error.Time.ToLongDateString(),
    error.Time.ToLongTimeString()));

            
            #line default
            #line hidden
WriteLiteral("</p>\r\n\r\n");



WriteLiteral("\r\n\r\n<p>See also:</p>\r\n\r\n<ul>\r\n\r\n");



WriteLiteral("\r\n\r\n");


            
            #line 105 "..\..\ErrorDetailPage.cshtml"
     if (error.WebHostHtmlMessage.Length != 0)
    {
        var htmlUrl = basePageName + "/html?id=" + Uri.EscapeDataString(errorEntry.Id);

            
            #line default
            #line hidden
WriteLiteral("        <li><a href=\"");


            
            #line 108 "..\..\ErrorDetailPage.cshtml"
                Write(basePageName);

            
            #line default
            #line hidden
WriteLiteral("/html?id=");


            
            #line 108 "..\..\ErrorDetailPage.cshtml"
                                      Write(Uri.EscapeDataString(errorEntry.Id));

            
            #line default
            #line hidden
WriteLiteral("\">Original ASP.NET error page</a></li>\r\n");


            
            #line 109 "..\..\ErrorDetailPage.cshtml"
    }


            
            #line default
            #line hidden

            
            #line 113 "..\..\ErrorDetailPage.cshtml"
  

            
            #line default
            #line hidden
WriteLiteral("\r\n    <li>Raw/Source data in \r\n        <a rel=\"");


            
            #line 116 "..\..\ErrorDetailPage.cshtml"
           Write(HtmlLinkType.Alternate);

            
            #line default
            #line hidden
WriteLiteral("\" \r\n           type=\"application/xml\" \r\n           href=\"xml");


            
            #line 118 "..\..\ErrorDetailPage.cshtml"
                Write(Request.Url.Query);

            
            #line default
            #line hidden
WriteLiteral("\">XML</a>\r\n        or in\r\n        <a rel=\"");


            
            #line 120 "..\..\ErrorDetailPage.cshtml"
           Write(HtmlLinkType.Alternate);

            
            #line default
            #line hidden
WriteLiteral("\" \r\n           type=\"application/json\" \r\n           href=\"json");


            
            #line 122 "..\..\ErrorDetailPage.cshtml"
                 Write(Request.Url.Query);

            
            #line default
            #line hidden
WriteLiteral("\">JSON</a>\r\n    </li>\r\n</ul>\r\n\r\n");



WriteLiteral("\r\n\r\n");


            
            #line 140 "..\..\ErrorDetailPage.cshtml"
  
    var collection = new
    {
        Data  = error.ServerVariables,
        Id    = "ServerVariables",
        Title = "Server Variables",
    };

    //
    // If the collection isn't there or it's empty, then bail out.
    //

    if (collection.Data != null && collection.Data.Count > 0)
    {
        var items = 
            from i in Enumerable.Range(0, collection.Data.Count)
            select new
            {
                Index  = i,
                Key    = collection.Data.GetKey(i),
                Value  = collection.Data[i],
            };
        
        items = items.OrderBy(e => e.Key, StringComparer.OrdinalIgnoreCase);
        

            
            #line default
            #line hidden
WriteLiteral("        <div id=\"");


            
            #line 165 "..\..\ErrorDetailPage.cshtml"
            Write(collection.Id);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n\r\n            <h2>");


            
            #line 167 "..\..\ErrorDetailPage.cshtml"
           Write(collection.Title);

            
            #line default
            #line hidden
WriteLiteral("</h2>\r\n            ");



WriteLiteral(@"

            <div class=""scroll-view"">

                <table cellspacing=""0"" style=""border-collapse:collapse;"" class=""table table-condensed table-striped"">
                    <tr>
                        <th class=""name-col"" style=""white-space:nowrap;"">Name</th>
                        <th class=""value-col"" style=""white-space:nowrap;"">Value</th>
                    </tr>
    
");


            
            #line 183 "..\..\ErrorDetailPage.cshtml"
                     foreach (var item in items)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <tr class=\"");


            
            #line 185 "..\..\ErrorDetailPage.cshtml"
                               Write(item.Index % 2 == 0 ? "even" : "odd");

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            <td class=\"key-col\">");


            
            #line 186 "..\..\ErrorDetailPage.cshtml"
                                           Write(item.Key);

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                            <td class=\"value-col\">");


            
            #line 187 "..\..\ErrorDetailPage.cshtml"
                                             Write(item.Value);

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                        </tr>\r\n");


            
            #line 189 "..\..\ErrorDetailPage.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("\r\n                </table>\r\n            </div>\r\n        </div>\r\n");


            
            #line 194 "..\..\ErrorDetailPage.cshtml"
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");



WriteLiteral("\r\n");


        }
Beispiel #6
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 7 "..\..\ErrorDetailPage.cshtml"

            var basePageName = Request.ServerVariables["URL"];

            //
            // Retrieve the ID of the error to display and read it from
            // the store.
            //

            var errorId = Request.QueryString["id"] ?? string.Empty;

            if (errorId.Length == 0)
            {
                return;
            }

            var log        = this.ErrorLog ?? ErrorLog.GetDefault(Context);
            var errorEntry = log.GetError(errorId);

            //
            // Perhaps the error has been deleted from the store? Whatever
            // the reason, bail out silently.
            //

            if (errorEntry == null)
            {
                Response.Status = HttpStatus.NotFound.ToString();


            #line default
            #line hidden
                WriteLiteral("        <p>Error not found in log.</p>\r\n");



            #line 34 "..\..\ErrorDetailPage.cshtml"
                return;
            }

            var title = string.Format("Error: {0} [{1}]", errorEntry.Error.Type, errorEntry.Id);

            Layout = new Elmah.MasterPage
            {
                Context       = Context, /* TODO Consider not requiring this */
                Title         = title,
                Footnote      = string.Format("This log is provided by the {0}.", log.Name),
                SpeedBarItems = new[]
                {
                    SpeedBar.Home.Format(basePageName),
                    SpeedBar.Help,
                    SpeedBar.About.Format(basePageName),
                },
            };

            var error = errorEntry.Error;



            #line default
            #line hidden
            WriteLiteral("\r\n");



            WriteLiteral("\r\n\r\n<h1 id=\"PageTitle\">");



            #line 59 "..\..\ErrorDetailPage.cshtml"
            Write(error.Message);


            #line default
            #line hidden
            WriteLiteral("</h1>\r\n\r\n<p id=\"ErrorTitle\">");



            WriteLiteral("<span id=\"ErrorType\">");



            #line 62 "..\..\ErrorDetailPage.cshtml"
            Write(error.Type);


            #line default
            #line hidden
            WriteLiteral("</span>");



            WriteLiteral("<span id=\"ErrorTypeMessageSeparator\">: </span>");



            WriteLiteral("<span id=\"ErrorMessage\">");



            #line 64 "..\..\ErrorDetailPage.cshtml"
            Write(error.Message);


            #line default
            #line hidden
            WriteLiteral("</span></p>\r\n\r\n");



            WriteLiteral("\r\n\r\n");



            #line 74 "..\..\ErrorDetailPage.cshtml"
            if (error.Detail.Length != 0)
            {
            #line default
            #line hidden
                WriteLiteral("    <pre id=\"ErrorDetail\">");



            #line 76 "..\..\ErrorDetailPage.cshtml"
                Write(MarkupStackTrace(error.Detail));


            #line default
            #line hidden
                WriteLiteral("</pre>\r\n");



            #line 77 "..\..\ErrorDetailPage.cshtml"
            }



            #line default
            #line hidden


            #line 83 "..\..\ErrorDetailPage.cshtml"



            #line default
            #line hidden
            WriteLiteral("\r\n<p id=\"ErrorLogTime\">");



            #line 85 "..\..\ErrorDetailPage.cshtml"
            Write(string.Format(
                      @"Logged on {0} at {1}",
                      error.Time.ToLongDateString(),
                      error.Time.ToLongTimeString()));


            #line default
            #line hidden
            WriteLiteral("</p>\r\n\r\n");



            WriteLiteral("\r\n\r\n<p>See also:</p>\r\n\r\n<ul>\r\n\r\n");



            WriteLiteral("\r\n\r\n");



            #line 105 "..\..\ErrorDetailPage.cshtml"
            if (error.WebHostHtmlMessage.Length != 0)
            {
                var htmlUrl = basePageName + "/html?id=" + Uri.EscapeDataString(errorEntry.Id);


            #line default
            #line hidden
                WriteLiteral("        <li><a href=\"");



            #line 108 "..\..\ErrorDetailPage.cshtml"
                Write(basePageName);


            #line default
            #line hidden
                WriteLiteral("/html?id=");



            #line 108 "..\..\ErrorDetailPage.cshtml"
                Write(Uri.EscapeDataString(errorEntry.Id));


            #line default
            #line hidden
                WriteLiteral("\">Original ASP.NET error page</a></li>\r\n");



            #line 109 "..\..\ErrorDetailPage.cshtml"
            }



            #line default
            #line hidden


            #line 113 "..\..\ErrorDetailPage.cshtml"



            #line default
            #line hidden
            WriteLiteral("\r\n    <li>Raw/Source data in \r\n        <a rel=\"");



            #line 116 "..\..\ErrorDetailPage.cshtml"
            Write(HtmlLinkType.Alternate);


            #line default
            #line hidden
            WriteLiteral("\" \r\n           type=\"application/xml\" \r\n           href=\"xml");



            #line 118 "..\..\ErrorDetailPage.cshtml"
            Write(Request.Url.Query);


            #line default
            #line hidden
            WriteLiteral("\">XML</a>\r\n        or in\r\n        <a rel=\"");



            #line 120 "..\..\ErrorDetailPage.cshtml"
            Write(HtmlLinkType.Alternate);


            #line default
            #line hidden
            WriteLiteral("\" \r\n           type=\"application/json\" \r\n           href=\"json");



            #line 122 "..\..\ErrorDetailPage.cshtml"
            Write(Request.Url.Query);


            #line default
            #line hidden
            WriteLiteral("\">JSON</a>\r\n    </li>\r\n</ul>\r\n\r\n");



            #line 126 "..\..\ErrorDetailPage.cshtml"
            if (error.UserComments.Length != 0)
            {
            #line default
            #line hidden
                WriteLiteral("    <div id=\"UserComments\">\r\n        <h2>User Comments</h2>\r\n    </div>\r\n");



                WriteLiteral("    <pre>");



            #line 131 "..\..\ErrorDetailPage.cshtml"
                Write(error.UserComments);


            #line default
            #line hidden
                WriteLiteral("</pre>\r\n");



            #line 132 "..\..\ErrorDetailPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("\r\n");



            #line 134 "..\..\ErrorDetailPage.cshtml"



            #line default
            #line hidden

            #line 135 "..\..\ErrorDetailPage.cshtml"
            Write(MarkupCollection(error.ServerVariables, "ServerVariables", "Server Variables"));


            #line default
            #line hidden

            #line 135 "..\..\ErrorDetailPage.cshtml"



            #line default
            #line hidden

            #line 136 "..\..\ErrorDetailPage.cshtml"
            Write(MarkupCollection(error.SessionVariables, "SessionVariables", "Session Variables"));


            #line default
            #line hidden

            #line 136 "..\..\ErrorDetailPage.cshtml"



            #line default
            #line hidden

            #line 137 "..\..\ErrorDetailPage.cshtml"
            Write(MarkupCollection(error.QueryString, "QueryString", "Query String"));


            #line default
            #line hidden

            #line 137 "..\..\ErrorDetailPage.cshtml"



            #line default
            #line hidden

            #line 138 "..\..\ErrorDetailPage.cshtml"
            Write(MarkupCollection(error.Cookies, "Cookies", "Cookies"));


            #line default
            #line hidden

            #line 138 "..\..\ErrorDetailPage.cshtml"



            #line default
            #line hidden
            WriteLiteral("\r\n");



            WriteLiteral("\r\n");
        }
Beispiel #7
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 6 "..\..\AboutPage.cshtml"

            var basePageName = Request.ServerVariables["URL"];

            const string title = "About ELMAH";
            Layout = new Elmah.MasterPage
            {
                Context       = Context, /* TODO Consider not requiring this */
                Title         = title,
                SpeedBarItems = new[]
                {
                    SpeedBar.Home.Format(basePageName),
                    SpeedBar.Help,
                    SpeedBar.About.Format(basePageName),
                },
            };

            var stamps = SccStamp.FindAll(typeof(ErrorLog).Assembly)
                         .OrderByDescending(s => s.Revision)
                         .ToArray();



            #line default
            #line hidden


            WriteLiteral(@"

<script type='text/javascript' language='JavaScript'>
    function onCheckForUpdate(sender) {
        var script = document.createElement('script');
        script.type = 'text/javascript';
        script.language = 'JavaScript';
        script.src = 'https://elmah.github.io/update.js?__=' + (new Date()).getTime();
        document.getElementsByTagName('head')[0].appendChild(script);
        return false;
    }
    var ELMAH = {
        info: {
            version: '");



            #line 41 "..\..\AboutPage.cshtml"
            Write(GetVersion());


            #line default
            #line hidden
            WriteLiteral("\',\r\n            fileVersion: \'");



            #line 42 "..\..\AboutPage.cshtml"
            Write(GetFileVersion());


            #line default
            #line hidden
            WriteLiteral("\',\r\n            type: \'");



            #line 43 "..\..\AboutPage.cshtml"
            Write(Build.TypeLowercase);


            #line default
            #line hidden
            WriteLiteral("\',\r\n            status: \'");



            #line 44 "..\..\AboutPage.cshtml"
            Write(Build.Status);


            #line default
            #line hidden
            WriteLiteral("\',\r\n            framework: \'");



            #line 45 "..\..\AboutPage.cshtml"
            Write(Build.Framework);


            #line default
            #line hidden
            WriteLiteral("\',\r\n            imageRuntime: \'");



            #line 46 "..\..\AboutPage.cshtml"
            Write(Build.ImageRuntimeVersion);


            #line default
            #line hidden
            WriteLiteral("\'\r\n        }\r\n    };\r\n</script>\r\n\r\n<h1 id=\"PageTitle\">");



            #line 51 "..\..\AboutPage.cshtml"
            Write(title);


            #line default
            #line hidden
            WriteLiteral("</h1>\r\n\r\n<p>\r\n    <button class=\"btn\"\r\n        onclick=\"return onCheckForUpdate(t" +
                         "his)\"\r\n        title=\"Checks if your ELMAH version is up to date (requires Inter" +
                         "net connection)\">Check for Update</button>\r\n</p>\r\n\r\n<p>\r\n    This <strong>");



            #line 60 "..\..\AboutPage.cshtml"
            Write(Build.TypeLowercase);


            #line default
            #line hidden
            WriteLiteral("</strong>\r\n    ");



            #line 61 "..\..\AboutPage.cshtml"
            Write(stamps.Any() ? "(SCC #" + stamps.First().Revision.ToString("N0") + ")" : null);


            #line default
            #line hidden
            WriteLiteral("\r\n    build was compiled from the following sources for CLR ");



            #line 62 "..\..\AboutPage.cshtml"
            Write(Build.ImageRuntimeVersion);


            #line default
            #line hidden
            WriteLiteral(":\r\n</p>\r\n\r\n<ul>\r\n");



            #line 66 "..\..\AboutPage.cshtml"
            foreach (var stamp in stamps)
            {
            #line default
            #line hidden
                WriteLiteral("        <li><code>");



            #line 68 "..\..\AboutPage.cshtml"
                Write(stamp.Id);


            #line default
            #line hidden
                WriteLiteral("</code></li>        \r\n");



            #line 69 "..\..\AboutPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("</ul>\r\n");


            WriteLiteral("\r\n");
        }