use of io.datarouter.web.metriclinks.MetricLinkPage 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 io.datarouter.web.metriclinks.MetricLinkPage in project datarouter by hotpads.
the class MetricNamesSubnavFactory method build.
public Subnav build(String contextPath) {
Subnav subnav = new Subnav("Metric Links", "", ID);
pluginInjector.scanInstances(MetricLinkPage.KEY).sort(Comparator.comparing(dto -> dto.getCategory().getName())).collect(Collectors.groupingBy(MetricLinkPage::getCategory)).entrySet().stream().sorted(Comparator.comparing((Entry<MetricLinkCategory, List<MetricLinkPage>> entry) -> entry.getKey().getName())).forEach(entry -> {
Dropdown dropdown = new Dropdown(entry.getKey().getName());
entry.getValue().forEach(page -> dropdown.addItem(page.getName(), contextPath + paths.datarouter.metric.metricLinks.view.toSlashedString() + "#" + page.getHtmlId()));
subnav.add(dropdown);
});
subnav.add(other(contextPath));
return subnav;
}
Aggregations