public HtmlDocument FullLog()
        {
            var table    = LoggingSessionWriter.Write(PackageRegistry.Diagnostics);
            var document = DiagnosticHtml.BuildDocument(_urls, "Full Package Loading Log", table);

            return(document);
        }
Beispiel #2
0
        public HtmlDocument Write()
        {
            HtmlTag header = new HtmlTag("div", x =>
            {
                var table = x.Add <TableTag>()
                            .AddBodyRow(row =>
                {
                    row.Cell("Request Url:");
                    row.Cell(_report.Url).AddClass("cell-data");
                })
                            .AddBodyRow(row =>
                {
                    row.Cell("Execution Time:");
                    row.Cell(_report.ExecutionTime + " milliseconds");
                })
                            .AddBodyRow(row =>
                {
                    row.Cell("At:");
                    row.Cell(_report.Time.ToString("G"));
                });

                table.AddClass("summary");

                writeFormData(x);
            });

            var reportWriter = new DebugReportTagWriter();

            _report.Steps.Each(reportWriter.WriteStep);

            string title = "Debug Run of " + _report.Url;

            return(DiagnosticHtml.BuildDocument(_urls, title, header, reportWriter.Tag));
        }
Beispiel #3
0
        public HtmlDocument FullLog()
        {
            var table = new TableTag();

            table.AddHeaderRow(r =>
            {
                r.Header("Type");
                r.Header("Description");
                r.Header("Provenance");
                r.Header("Timing");
            });

            PackageRegistry.Diagnostics.EachLog((target, log) =>
            {
                table.AddBodyRow(row =>
                {
                    row.Cell(PackagingDiagnostics.GetTypeName(target));
                    row.Cell(target.ToString());
                    row.Cell(log.Provenance);
                    row.Cell(log.TimeInMilliseconds.ToString()).AddClass("execution-time");
                });

                if (log.FullTraceText().IsNotEmpty())
                {
                    table.AddBodyRow(row =>
                    {
                        row.Cell().Attr("colspan", "4").Add("pre").AddClass("log").Text(log.FullTraceText());
                        if (!log.Success)
                        {
                            row.AddClass("failure");
                        }
                    });
                }
            });

            var document = DiagnosticHtml.BuildDocument(_urls, "Full Package Loading Log", table);



            return(document);
        }
Beispiel #4
0
        public HtmlDocument QueryScripts(ScriptQuery query)
        {
            var queryNames = query.Scripts == null
                                                 ? new string[0]
                                                 : query.Scripts.Split(',').Select(x => x.Trim()).Distinct();



            var document = DiagnosticHtml.BuildDocument(_urls, "Script Graph Query");

            document.Push("div").AddClass("script-query");

            document.Push("form").Attr("action", _urls.UrlFor <ScriptWriter>(x => x.QueryScripts(null), null));

            document.Add("b").Text("For requested script names (comma-delimited):  ");
            document.Add(new TextboxTag("Scripts", queryNames.Join(", ")).Id("script-names-text"));
            document.Add("br");
            document.Add("input").Attr("type", "submit").Value("Query");
            document.Pop();



            if (queryNames.Any())
            {
                document.Add("hr");
                document.Add("b").Text("Results");
                document.Push("ul");

                var actuals = _assets.GetAssets(queryNames);
                actuals.Each(script => document.Push("li").Text(script.Name));
            }

            document.Pop();

            return(document);
        }
Beispiel #5
0
 internal HtmlDocument BuildDocument(string title, params HtmlTag[] tags)
 {
     return(DiagnosticHtml.BuildDocument(_urls, title, tags));
 }