Example #1
0
        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 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");
        }
        public static HtmlTag DisplayCell <T>(this TableRowTag row, T model, Expression <Func <T, object> > expression)
            where T : class
        {
            var cellContents = model.DisplayFor(expression);
            var cell         = row.Cell();

            cell.Nest(cellContents);
            return(cell);
        }
        public static HtmlTag InputCell <T>(this TableRowTag row, T model, Expression <Func <T, object> > expression,
                                            string prepend)
            where T : class
        {
            var cellContents = model.InputFor(expression);
            var cell         = row.Cell();

            cell.Nest(cellContents).Prepend(prepend);
            return(cell);
        }
Example #5
0
        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));
            });
        }
Example #6
0
        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);
            }
        }
Example #7
0
        private void addRow(TableRowTag row, ChannelNode channel)
        {
            addDescriptionCell(row, channel);

            addSchedulers(row, channel);

            addRoutingRules(row, channel);

            addSerialization(row, channel);

            addModifiers(row, channel);
        }
Example #8
0
        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);
            }
        }
Example #9
0
        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);
                });
            });
        }
        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));
        }
Example #11
0
        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");
            }
        }
Example #12
0
        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(new StubCurrentHttpRequest("http://server")).WriteBody(chain, row, tag);

            row.HasClass(BehaviorGraphWriter.FUBU_INTERNAL_CLASS).ShouldBeTrue();
        }
Example #13
0
        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");
            }
        }
Example #14
0
        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(new StubCurrentHttpRequest("http://server")).WriteBody(chain, null, tag);

            tag.FirstChild().Text().ShouldEqual(chain.Route.Pattern);
            row.HasClass(BehaviorGraphWriter.FUBU_INTERNAL_CLASS).ShouldBeFalse();
        }
Example #15
0
        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");
            }
        }
        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 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 showSnippet(TableRowTag tr, Snippet snippet, IUrlRegistry urls)
        {
            var request = new SnippetRequest(snippet);
            var url     = urls.UrlFor(request, "GET");

            tr.Cell().Add("a").Attr("href", "#").Data("url", url).AddClass("snippet-link").Text(snippet.Name);
            tr.Cell(snippet.BottleName);


            var editUrl = urls.UrlFor(request, "POST");

            tr.Cell().Add("a").Data("url", editUrl)
            .Data("name", snippet.Name)
            .Data("bottle", snippet.BottleName)
            .Attr("href", "#").AddClass("edit-snippet").Text(snippet.File);
        }
 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");
     }
 }
        protected void AddMessageRow(TableRowTag row, QueueMessage queueMessage)
        {
            var message = queueMessage.InternalMessage;
            var url     = BuildUrlForMessage(queueMessage);

            row.Cell().Add("a").Attr("href", url).Text(message.Id.ToString());
            row.Cell(message.Status.ToString());
            row.Cell(message.SentAt.ToString());
            var list = new HtmlTag("dl", row.Cell());

            foreach (var key in message.Headers.AllKeys)
            {
                var label = new HtmlTag("dt").Text(key + ":");
                var value = new HtmlTag("dd").Text(message.Headers[key]);
                list.Append(label).Append(value);
            }
        }
Example #21
0
        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");
            }
        }
Example #22
0
        public StoryTellerTableTag(Table table, IStep step)
        {
            AddClass("table");
            AddClass(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));
            });
        }
Example #23
0
 public static TableRowTag AddCell(this TableRowTag row, string text)
 {
     row.Cell().Text(text);
     return(row);
 }
Example #24
0
 public Element TableCellByRowAndColumn(int row, int column) => TableTag
 .WithId("large-table")
 .Child(TableBodyTag)
 .Child(TableRowTag.AtPosition(row))
 .Child(TableCellTag.AtPosition(column));