Skip to content

Commit d1d1a15

Browse files
committed
Fix: cannot get support
1 parent be762ee commit d1d1a15

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

api/src/main/java/io/kafbat/ui/controller/ApplicationConfigController.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.springframework.http.ResponseEntity;
2929
import org.springframework.http.codec.multipart.FilePart;
3030
import org.springframework.http.codec.multipart.Part;
31-
import org.springframework.web.bind.annotation.GetMapping;
3231
import org.springframework.web.bind.annotation.RestController;
3332
import org.springframework.web.server.ServerWebExchange;
3433
import reactor.core.publisher.Flux;
@@ -57,6 +56,7 @@ default ActionDTO stringToActionDto(String str) {
5756
}
5857
}
5958

59+
private final ClustersProperties clustersProperties;
6060
private final DynamicConfigOperations dynamicConfigOperations;
6161
private final ApplicationRestarter restarter;
6262
private final KafkaClusterFactory kafkaClusterFactory;
@@ -83,10 +83,11 @@ public Mono<ResponseEntity<ApplicationConfigDTO>> getCurrentConfig(ServerWebExch
8383

8484
@Override
8585
public Mono<ResponseEntity<String>> getSupportUrl(ServerWebExchange exchange) {
86-
var kafkaClusters = dynamicConfigOperations.getCurrentProperties().getKafka().getClusters();
87-
88-
String supportUrl = kafkaClusters != null && !kafkaClusters.isEmpty()
89-
? kafkaClusters.get(0).getSupportUrl()
86+
var clusters = clustersProperties.getClusters();
87+
88+
// Check if clusters are available and extract the support URL from the first one
89+
String supportUrl = clusters != null && !clusters.isEmpty()
90+
? clusters.get(0).getSupportUrl()
9091
: null;
9192

9293
return Mono.just(ResponseEntity.ok(supportUrl));

0 commit comments

Comments
 (0)