minor fixes

This commit is contained in:
iliax 2023-07-24 21:22:20 +04:00
parent 79ba8313f7
commit 4f27a39b68
2 changed files with 8 additions and 6 deletions

View file

@ -64,12 +64,14 @@ public class GraphsController extends AbstractController implements GraphsApi {
@Override
public Mono<ResponseEntity<GraphDescriptionsDTO>> getGraphsList(String clusterName,
ServerWebExchange exchange) {
var context = AccessContext.builder()
.cluster(clusterName)
.operationName("getGraphsList")
.build();
var graphs = graphsService.getGraphs(getCluster(clusterName));
return Mono.just(
ResponseEntity.ok(
new GraphDescriptionsDTO().graphs(graphs.map(this::map).toList())
)
);
return accessControlService.validateAccess(context).then(
Mono.just(ResponseEntity.ok(new GraphDescriptionsDTO().graphs(graphs.map(this::map).toList()))));
}
private GraphDescriptionDTO map(GraphDescription graph) {

View file

@ -42,7 +42,7 @@ public interface MetricsSink {
return compoundSink(sinks);
}
static MetricsSink compoundSink(List<MetricsSink> sinks) {
private static MetricsSink compoundSink(List<MetricsSink> sinks) {
return metricsStream -> {
var materialized = metricsStream.toList();
return Flux.fromIterable(sinks)