use of j2html.tags.specialized.DivTag in project datarouter by hotpads.
the class AwsMemcachedWebInspector method getDetails.
@Override
protected Pair<Integer, DivTag> getDetails(ClientId clientId) {
MemcachedClientMode mode = options.getClientMode(clientId.getName());
Pair<Integer, DivTag> nodeCountByNodeTag = new Pair<>();
if (mode == MemcachedClientMode.DYNAMIC) {
List<AwsMemcachedNodeEndpointDto> nodeEndpointDtos = Scanner.of(getSpyClient(clientId).getAllNodeEndPoints()).map(nodeEndPoint -> new AwsMemcachedNodeEndpointDto(nodeEndPoint.getHostName(), nodeEndPoint.getIpAddress(), nodeEndPoint.getPort())).list();
var table = new J2HtmlTable<AwsMemcachedNodeEndpointDto>().withClasses("sortable table table-sm table-striped my-4 border").withColumn("HostName", dto -> dto.hostName).withColumn("IpAddress", dto -> dto.ipAddress).withColumn("Port", dto -> dto.port).build(nodeEndpointDtos);
DivTag divTable = div(table).withClass("container-fluid my-4").withStyle("padding-left: 0px");
nodeCountByNodeTag.setLeft(nodeEndpointDtos.size());
nodeCountByNodeTag.setRight(divTable);
} else {
List<LiTag> socketAddresses = Scanner.of(getSpyClient(clientId).getAvailableServers()).map(Object::toString).map(TagCreator::li).list();
DivTag div = div(ul(socketAddresses.toArray(new ContainerTag[0])));
nodeCountByNodeTag.setLeft(socketAddresses.size());
nodeCountByNodeTag.setRight(div);
}
return nodeCountByNodeTag;
}
use of j2html.tags.specialized.DivTag in project openapi-diff by OpenAPITools.
the class HtmlRender method div_changedSchema.
private DivTag div_changedSchema(ChangedSchema schema) {
DivTag div = div();
div.with(h3("Schema" + (schema.isIncompatible() ? " incompatible" : "")));
return div;
}
use of j2html.tags.specialized.DivTag in project datarouter by hotpads.
the class SqsUpdateQueueHandler method buildPage.
private Mav buildPage(String href, String message) {
DivTag backButton = div(a(i().withClass("fas fa-angle-left")).withText("Go back to client details").withHref(href).withClass("btn btn-primary"));
DivTag content = div(backButton, div(message).withClass("my-4")).withClass("container my-4");
return pageFactory.startBuilder(request).withContent(content).withTitle("Update Sqs Queue").buildMav();
}
use of j2html.tags.specialized.DivTag in project datarouter by hotpads.
the class MetricLinksHandler method view.
@Handler
public Mav view() {
List<ContainerTag<DivTag>> tags = pluginInjector.scanInstances(MetricLinkPage.KEY).sort(Comparator.comparing(MetricLinkPage::getHtmlName)).exclude(page -> page.getMetricLinks().isEmpty()).map(this::makeContent).collect(Collectors.toList());
DivTag content = div(each(tags, item -> TagCreator.div(item)));
return pageFactory.startBuilder(request).withTitle("Metric Links").withContent(content).withRequires(DatarouterWebRequireJsV2.SORTTABLE).buildMav();
}
use of j2html.tags.specialized.DivTag in project datarouter by hotpads.
the class MemcachedWebInspector method getDetails.
protected Pair<Integer, DivTag> getDetails(ClientId clientId) {
Pair<Integer, DivTag> nodeCountByNodeTag = new Pair<>();
List<LiTag> socketAddresses = Scanner.of(memcachedOptions.getServers(clientId.getName())).map(InetSocketAddress::toString).map(TagCreator::li).list();
DivTag div = div(ul(socketAddresses.toArray(new ContainerTag[0])));
nodeCountByNodeTag.setLeft(socketAddresses.size());
nodeCountByNodeTag.setRight(div);
return nodeCountByNodeTag;
}
Aggregations