Example #1
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);
        }
Example #2
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)));

            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 = _scripts.GetScripts(queryNames);
                actuals.Each(script => document.Push("li").Text(script.Name));
            }

            document.Pop();

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