public TableRowTag AddBodyRow() { var row = new TableRowTag(); this.Children.Add(row); return(row); }
private static void addDescriptionCell(TableRowTag row, ChannelNode channel) { var cell = row.Cell(); cell.Add("h5").Text(channel.Key); cell.Add("div/i").Text(channel.Uri.ToString()); if (channel.DefaultContentType != null) cell.Add("div").Text("Default Content Type: " + channel.DefaultContentType); }
private void addRow(TableRowTag row, ChannelNode channel) { addDescriptionCell(row, channel); addSchedulers(row, channel); addRoutingRules(row, channel); }
private static void addOthersCell(TableRowTag row, IEnumerable<BehaviorNode> chain) { var otherNodes = chain.Where(x => x.GetType() != typeof (ExceptionHandlerNode) && x.GetType() != typeof (HandlerCall)); var otherCell = row.Cell(); otherNodes.Each(node => { var description = Description.For(node); otherCell.Append(new DescriptionBodyTag(description)); }); }
private static void addExceptionCell(TableRowTag row, HandlerChain chain) { var exceptionCell = row.Cell(); var node = chain.OfType<ExceptionHandlerNode>().FirstOrDefault(); if (node != null) { var description = Description.For(node); var descriptionTag = new DescriptionBodyTag(description); exceptionCell.Append(descriptionTag); } }
private static void addRoutingRules(TableRowTag row, ChannelNode channel) { var cell = row.Cell().AddClass("routing-rules"); if (channel.Rules.Any()) { cell.Add("ul", ul => { channel.Rules.Each(x => ul.Add("li").Text(x.Describe())); }); } else { cell.Text("None"); } }
private void addRow(TableRowTag row, HandlerChain chain) { addMessageCell(row, chain); addExceptionCell(row, chain); addOthersCell(row, chain); row.Cell().Add("ul", ul => { chain.OfType<HandlerCall>().Each(call => { ul.Add("li").Text(call.Description); }); }); }
public void write_route_column_for_internal_diagnostics_route() { var chain = new BehaviorChain(); chain.Route = new RouteDefinition(DiagnosticUrlPolicy.DIAGNOSTICS_URL_ROOT + "/chains"); var row = new TableRowTag(); var tag = row.Cell(); new RouteColumn().WriteBody(chain, row, tag); row.HasClass(BehaviorGraphWriter.FUBU_INTERNAL_CLASS).ShouldBeTrue(); }
private void addModifiers(TableRowTag row, ChannelNode channel) { var cell = row.Cell().AddClass("modifiers"); if (channel.Modifiers.Any()) { cell.Add("ul", ul => { channel.Modifiers.Each(x => ul.Add("li").Text(x.ToString())); }); } else { cell.Text("None"); } }
public void write_route_column_when_the_route_exists() { var chain = new BehaviorChain(); chain.Route = new RouteDefinition("some/thing/else"); var row = new TableRowTag(); var tag = row.Cell(); new RouteColumn().WriteBody(chain, null, tag); tag.FirstChild().Text().ShouldEqual(chain.Route.Pattern); row.HasClass(BehaviorGraphWriter.FUBU_INTERNAL_CLASS).ShouldBeFalse(); }
private static void addSchedulers(TableRowTag row, ChannelNode channel) { var cell = row.Cell(); if (channel.Incoming) { var description = Description.For(channel.Scheduler); cell.Append(new DescriptionBodyTag(description)); } else { cell.Text("None"); } }
public StoryTellerTableTag(Table table, IStep step) { _table = table; _step = step; AddClass("table"); Attr("cellpadding", "0").Attr("cellspacing", "0"); CaptionText(_table.Label); AddHeaderRow(x => { _headerRow = x; _table.Cells.Each(cell => x.Header(cell.Header)); }); }
private void addRow(TableRowTag row, Uri uri, Cache<Uri, TransportNode> peers) { row.Cell(uri.ToString()); if (peers.Has(uri)) { var peer = peers[uri]; row.Cell(peer.Id); row.Cell(peer.ControlChannel.ToString()); } else { row.Cell("None"); row.Cell(); } }
private void addRecord(JobExecutionRecord record, TableRowTag row) { row.Cell(record.Finished.ToLocalTime().ToString()).Style("vertical-align", "top"); row.Cell(record.Executor).Style("vertical-align", "top"); row.Cell(record.Success ? "Success" : "Failed").Style("vertical-align", "top"); row.Cell(record.Duration.ToString()).Attr("align", "right").Style("vertical-align", "top"); row.Cell(record.Attempts.ToString()).Attr("align", "right").Style("vertical-align", "top"); if (record.ExceptionText.IsEmpty()) { row.Cell("None"); } else { row.Cell().Add("pre").Text(record.ExceptionText).Style("font-size", "xx-small"); } }
private void addSerialization(TableRowTag row, ChannelNode channel) { var cell = row.Cell().AddClass("serialization"); if (channel.DefaultContentType.IsNotEmpty()) { cell.Text(channel.DefaultContentType); } else if (channel.DefaultSerializer != null) { cell.Text(channel.DefaultSerializer.ToString()); } else { cell.Text("None"); } }
public StoryTellerTableTag(Table table, IStep step) { AddClass("table"); this.AddSafeClassName(table.GetType().Name.ToLower()); _table = table; _step = step; _writer = table.GetWriter(_step); Attr("cellpadding", "0").Attr("cellspacing", "0"); AddHeaderRow(x => { _headerRow = x; _writer.DisplayCells.Each(cell => x.Header(cell.Header)); }); }
private void AddFeedback(HtmlTag div) { var table = Tags.Table.Caption("Feedback"); var headerRow = table.AddHeaderRow(); headerRow.Cell("Date"); headerRow.Cell("From"); headerRow.Cell("Rating"); headerRow.Cell("Notes"); headerRow.Cell(); var addRow = new TableRowTag(); addRow.AddClass("top"); addRow.Cell().Nest(Tags.Span.DataBind("text: Date")); addRow.Cell().Nest(Tags.Span.DataBind("text: Source")); addRow.Cell().Nest(new GiveFeedback().InputFor(x => x.Rating).DataBind("value: Rating")); addRow.Cell().Nest(new HtmlTag("textarea").DataBind("value: Notes")); addRow.Cell().Nest( Tags.Link.Href("#").Text("Save").DataBind("click: function() { $parent.saveFeedback(); }")); var addBody = new HtmlTag("tbody").DataBind("with: NewFeedback"); addBody.Nest(addRow); var noteRow = new TableRowTag(); noteRow.AddClass("note"); noteRow.Cell().Nest(Tags.Span.DataBind("text: Date")); noteRow.Cell().Nest(Tags.Span.DataBind("text: Source")); noteRow.Cell().Nest(Tags.Span.DataBind("text: Rating")); noteRow.Cell().Nest(new HtmlTag("pre").Style("white-space", "pre-wrap").DataBind("text: Notes")); noteRow.Cell(); var notesBody = new HtmlTag("tbody").DataBind("foreach: Feedback"); notesBody.Nest(noteRow); table.Nest( addBody, notesBody ); table.AddClasses("report", "no-hover"); div.Nest(table); }
public static HtmlTag GetFeedbackTemplate() { var table = Tags.Table.Caption("Feedback"); var headerRow = table.AddHeaderRow(); headerRow.Cell("Date"); headerRow.Cell("From"); headerRow.Cell("Rating"); headerRow.Cell("Notes"); headerRow.Cell(); var addRow = new TableRowTag(); addRow.AddClass("top"); addRow.Cell().Nest(Tags.Span.DataBind("text: Date")); addRow.Cell().Nest(Tags.Span.DataBind("text: Source")); addRow.Cell().Nest(new GiveFeedback().InputFor(x => x.Rating).DataBind("value: Rating")); addRow.Cell().Nest(new HtmlTag("textarea").DataBind("text: Notes")); addRow.Cell().Nest(Tags.Link.Href("#").Text("Save").DataBind("click: function() { $parent.saveNote(); }")); var addBody = new HtmlTag("tbody").DataBind("with: Note"); addBody.Nest(addRow); var noteRow = new TableRowTag(); noteRow.AddClass("note"); noteRow.Cell().Nest(Tags.Span.DataBind("text: Date")); noteRow.Cell().Nest(Tags.Span.DataBind("text: Source")); noteRow.Cell().Nest(Tags.Span.DataBind("text: Rating")); noteRow.Cell().Nest(Tags.Span.DataBind("text: Notes")); noteRow.Cell(); var notesBody = new HtmlTag("tbody").DataBind("foreach: Feedback"); notesBody.Nest(noteRow); table.Nest( addBody, notesBody ); return table.AddClasses("report", "no-hover"); }
private void addJobRow(TableRowTag row, JobStatusDTO job, IUrlRegistry urls) { row.Cell().Add("a").Text(job.JobKey).Attr("href", urls.UrlFor(new ScheduledJobRequest{Job = job.JobKey})); row.Cell(job.NextTime.HasValue ? job.NextTime.Value.ToLocalTime().ToString() : "Not scheduled"); row.Cell(job.GetStatusDescription()); row.Cell(job.GetLastExecutionDescription()); var url = urls.UrlFor(new RunJobRequest {Name = job.JobKey}); row.Cell().Add("button").Text("Execute").Attr("data-url", url).AddClass("button").AddClass("executor").Attr("onclick", "if (window.confirm('Ok to run this job?')) window.location='" + url + "'"); }
private static void addMessageCell(TableRowTag row, HandlerChain chain) { var messageCell = row.Cell().AddClass("message"); messageCell.Add("h4").Text(chain.InputType().Name); messageCell.Add("p").Text(chain.InputType().Namespace); }
private void addQueueRow(TableRowTag row, IQueueManager queueManager, string queueName, IUrlRegistry urls, string displayForCount = null) { var url = urls.UrlFor(new MessagesInputModel {Port = queueManager.Endpoint.Port, QueueName = queueName}); row.Cell().Add("a") .Attr("href", url) .Text(queueName); row.Cell(displayForCount ?? queueManager.GetNumberOfMessages(queueName).ToString(CultureInfo.InvariantCulture)); }
private static void writeHeaderValue(string headerValue, TableRowTag tr) { var parts = headerValue.Split('='); tr.Cell(parts.First() + " = ").Attr("valign", "top").Style("text-align", "right").Attr("nowrap", "true"); tr.Cell(parts.Last()).Attr("valign", "top").Attr("nowrap", "true"); }
private void addMessageRow(TableRowTag row, PersistentMessage message) { row.Cell(message.Id.ToString()); row.Cell(message.Status.ToString()); row.Cell(message.SentAt.ToString()); var cell = row.Cell(); var list = new HtmlTag("ul", cell); foreach (var key in message.Headers.AllKeys) { list.Add("li").Text("{0}&{1}".ToFormat(key, message.Headers[key])); } }