Пример #1
0
        public string ToHtml()
        {
            var table = new TableTag();
            table.AddClass("table");
            table.AddClass("table-striped");
            table.AddHeaderRow(row =>
            {
                row.Header("Details");
                row.Header("Duration (ms)");
                row.Header("Method");
                row.Header("Endpoint");
                row.Header("Status");
                row.Header("Content Type");
            });

            _logs.Each(log =>
            {
                var url = _runtime.BaseAddress.TrimEnd('/') + "/_fubu/#/fubumvc/request-details/" + log.Id;

                table.AddBodyRow(row =>
                {
                    row.Cell().Add("a").Text("Details").Attr("href", url).Attr("target", "_blank");
                    row.Cell(log.ExecutionTime.ToString()).Attr("align", "right");

                    var summary = new HttpRequestSummary(log);
                    row.Cell(summary.method);
                    row.Cell(log.Title());
                    row.Cell(summary.status.ToString());
                    row.Cell(summary.contentType);
                });
            });

            return table.ToString();
        }
        public HtmlTag get_tasks()
        {
            var peers = _repository.FindPeers();
            var cache = new Cache<Uri, TransportNode>();
            peers.Each(peer => peer.OwnedTasks.Each(x => cache[x] = peer));

            var tag = new HtmlTag("div");
            tag.Add("h1").Text("Task Assignements");

            var table = new TableTag();
            tag.Append(table);

            table.AddClass("table");

            table.AddHeaderRow(row => {
                row.Header("Task");
                row.Header("Assigned to");
                row.Header("Control Channel");
            });

            var tasks = _tasks.PermanentTasks().Union(_tasks.ActiveTasks()).ToArray();
            tasks.Each(uri => {
                table.AddBodyRow(row => addRow(row, uri, cache));
            });

            return tag;
        }
        private static TableTag buildTable()
        {
            var table = new TableTag();
            table.AddClass("table table-striped table-bordered table-condensed");

            table.AddHeaderRow(row =>
            {
                row.Header("Property");
                row.Header("Handler");
                row.Header("Value(s)");
            });

            return table;
        }
Пример #4
0
        private void writeProperties(Description description)
        {
            if (description.Properties.Any())
            {
                var table = new TableTag();
                table.AddClass("desc-properties");

                description.Properties.Each((key, value) =>
                {
                    table.AddBodyRow(row =>
                    {
                        row.Header(key);
                        row.Cell(value);
                    });
                });

                Append(table);
            }
        }
Пример #5
0
        public static TableTag Write(LoggingSession session)
        {
            var table = new TableTag();
            table.AddClass("table");
            table.AddHeaderRow(r =>
            {
                r.Header("Description");
                r.Header("Provenance");
            });

            session.EachLog((target, log) =>
            {
                table.AddBodyRow(row =>
                {
                    row.Add("td", td =>
                    {
                        td.Append(new HtmlTag("h3").Text("Directive: "+BottlingDiagnostics.GetTypeName(target)));
                        td.Append(new HtmlTag("h5").Text("Desc: " + target.ToString()));
                        var time = new HtmlTag("h6").Text(log.TimeInMilliseconds.ToString()+"ms");
                        td.Append(time);
                    });

                    row.Cell(log.Provenance);

                });

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

            return table;
        }
Пример #6
0
        public PreviewSummary(string title)
        {
            Title = title;

            Body.Style("margin", "30px");

            AddStyle(HtmlClasses.CSS());
            Add("h1").Text(title);

            Add("hr");

            _table = new TableTag();
            _table.AddClass("summary-table");
            Add(_table);

            _table.AddHeaderRow(row => {
                row.Header("Name");
                row.Header("Suite");
                row.Header("Lifecycle");
            });
        }
Пример #7
0
        private static HtmlTag writeSettings(string provRoot ,IEnumerable<SettingDataSource> settingDataSources)
        {
            var table = new TableTag();
            table.AddClass("table");
            table.AddHeaderRow("Key", "Value", "Provenance");

            settingDataSources.Each(s =>
            {
                var prov = s.Provenance.Replace(provRoot, "");
                table.AddBodyRow(s.Key, s.Value, s.Provenance);
            });

            return table;
        }
Пример #8
0
        private void writeOptions(DeploymentPlan plan)
        {
            wrapInSection("Options","Options used at runtime", div =>
            {

                var table = new TableTag();
                table.AddClass("table");
                table.AddProperty("Written at", DateTime.Now.ToLongTimeString());
                table.AddProperty("Profile", plan.Options.ProfileName);

                table.AddBodyRow(tr =>
                {
                    tr.Add("th", th =>
                    {
                        th.Text("Recipes").Append(new HtmlTag("small").Text(" (in order)"));
                    });
                    tr.Add("td", td =>
                    {
                        td.Text(plan.Recipes.Select(x => x.Name).Join(" > "));
                    });
                });

                table.AddProperty("Hosts", plan.Hosts.Select(x => x.Name).OrderBy(x => x).Join(", "));
                table.AddProperty("Bottles",
                                  plan.Hosts.SelectMany(host => host.BottleReferences).Select(bottle => bottle.Name).
                                      Distinct().OrderBy(x => x).Join(", "));
                div.Append(table);
            });
        }