From 6b8cf40ce23ee5d96a90a05cc480735eef153593 Mon Sep 17 00:00:00 2001 From: Benedetto Marco Serinelli Date: Sat, 10 Feb 2024 16:38:43 +0100 Subject: [PATCH] feat: prepare api for custom --- .../ui/controller/PreferencesController.java | 26 +++++++++++++++++++ .../src/main/resources/application.yml | 4 +++ .../main/resources/swagger/kafka-ui-api.yaml | 26 ++++++++++++++++++- 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/PreferencesController.java diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/PreferencesController.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/PreferencesController.java new file mode 100644 index 0000000000..06141fea67 --- /dev/null +++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/PreferencesController.java @@ -0,0 +1,26 @@ +package com.provectus.kafka.ui.controller; + +import com.provectus.kafka.ui.api.PreferenceseApi; +import com.provectus.kafka.ui.model.ApplicationsPreferencesDTO; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Mono; + +@RestController +@RequiredArgsConstructor +@Slf4j +public class PreferencesController implements PreferenceseApi { + + @Value("${kafka.ui.preferences.removegitlink}") + private String kafkaUiRemoveGitLink; + + + @Override + public Mono> getPreferences(ServerWebExchange exchange) { + return null; + } +} diff --git a/kafka-ui-api/src/main/resources/application.yml b/kafka-ui-api/src/main/resources/application.yml index e879920613..4fb7cd6bea 100644 --- a/kafka-ui-api/src/main/resources/application.yml +++ b/kafka-ui-api/src/main/resources/application.yml @@ -19,3 +19,7 @@ logging: reactor.netty.http.server.AccessLog: INFO org.hibernate.validator: WARN +kafka: + ui: + preferences: + removegitlink: ${OPENSHIFT_DIY_PORT:true} diff --git a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml index ae51d31568..d12e247dc2 100644 --- a/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml +++ b/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml @@ -15,6 +15,19 @@ servers: - url: /localhost paths: + /api/preferences: + get: + tags: + - Preferencese + summary: getPreferences + operationId: getPreferences + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationsPreferences' /api/clusters: get: tags: @@ -2058,6 +2071,17 @@ paths: components: schemas: + + ApplicationsPreferences: + type: object + properties: + removeGitLink: + type: boolean + removeDiscordLink: + type: boolean + appName: + type: string + example: "App Kafka UI My Preferences" TopicSerdeSuggestion: type: object properties: @@ -3968,7 +3992,7 @@ components: keystoreLocation: type: string keystorePassword: - type: string + type: string ksqldbServerAuth: type: object properties: