From c5810a1fc60ccaff15abbd9a3fbae94d5df4ad2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=AE=B8=E6=99=93=E4=B8=9C?= <763795151@qq.com>
Date: Sat, 6 Nov 2021 23:39:54 +0800
Subject: [PATCH] topoc config
---
src/main/resources/application.yml | 5 +-
ui/src/utils/api.js | 12 ++
ui/src/views/topic/EditConfig.vue | 114 ++++++++++++++++
ui/src/views/topic/Topic.vue | 29 ++++-
ui/src/views/topic/TopicConfig.vue | 203 +++++++++++++++++++++++++++++
5 files changed, 360 insertions(+), 3 deletions(-)
create mode 100644 ui/src/views/topic/EditConfig.vue
create mode 100644 ui/src/views/topic/TopicConfig.vue
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 615382e..8aa0f33 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -29,7 +29,7 @@ spring:
name: kafka-console-ui
# h2 database
datasource:
- url: jdbc:h2:file:${data.dir:${user.dir}}/data/db/kafak-console
+ url: jdbc:h2:file:${data.dir:${user.dir}}/data/db/kafka-console
# url: jdbc:h2:mem:testdb
driver-class-name: org.h2.Driver
username: kafka
@@ -40,7 +40,8 @@ spring:
h2:
console:
enabled: true
-
+# settings:
+# web-allow-others: true
logging:
home: ./
diff --git a/ui/src/utils/api.js b/ui/src/utils/api.js
index 99d972f..e89eef7 100644
--- a/ui/src/utils/api.js
+++ b/ui/src/utils/api.js
@@ -54,6 +54,10 @@ export const KafkaConfigApi = {
url: "/config",
method: "get",
},
+ getTopicConfig: {
+ url: "/config/topic",
+ method: "get",
+ },
getBrokerConfig: {
url: "/config/broker",
method: "get",
@@ -78,6 +82,14 @@ export const KafkaConfigApi = {
url: "/config/broker/logger",
method: "delete",
},
+ setTopicConfig: {
+ url: "/config/topic",
+ method: "post",
+ },
+ deleteTopicConfig: {
+ url: "/config/topic",
+ method: "delete",
+ },
};
export const KafkaTopicApi = {
diff --git a/ui/src/views/topic/EditConfig.vue b/ui/src/views/topic/EditConfig.vue
new file mode 100644
index 0000000..e94a95a
--- /dev/null
+++ b/ui/src/views/topic/EditConfig.vue
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 提交
+
+
+
+
+
+
+
+
+
+
diff --git a/ui/src/views/topic/Topic.vue b/ui/src/views/topic/Topic.vue
index f5dc171..bafa48d 100644
--- a/ui/src/views/topic/Topic.vue
+++ b/ui/src/views/topic/Topic.vue
@@ -91,6 +91,13 @@
@click="openConsumedDetailDialog(record.name)"
>消费详情
+ 属性配置
+
+
@@ -127,10 +139,17 @@ import PartitionInfo from "@/views/topic/PartitionInfo";
import CreateTopic from "@/views/topic/CreateTopic";
import AddPartition from "@/views/topic/AddPartition";
import ConsumedDetail from "@/views/topic/ConsumedDetail";
+import TopicConfig from "@/views/topic/TopicConfig";
export default {
name: "Topic",
- components: { PartitionInfo, CreateTopic, AddPartition, ConsumedDetail },
+ components: {
+ PartitionInfo,
+ CreateTopic,
+ AddPartition,
+ ConsumedDetail,
+ TopicConfig,
+ },
data() {
return {
queryParam: { type: "normal" },
@@ -150,6 +169,7 @@ export default {
showCreateTopic: false,
showAddPartition: false,
showConsumedDetailDialog: false,
+ showTopicConfigDialog: false,
};
},
methods: {
@@ -223,6 +243,13 @@ export default {
closeConsumedDetailDialog() {
this.showConsumedDetailDialog = false;
},
+ openTopicConfigDialog(topic) {
+ this.showTopicConfigDialog = true;
+ this.selectDetail.resourceName = topic;
+ },
+ closeTopicConfigDialog() {
+ this.showTopicConfigDialog = false;
+ },
},
created() {
this.getTopicList();
diff --git a/ui/src/views/topic/TopicConfig.vue b/ui/src/views/topic/TopicConfig.vue
new file mode 100644
index 0000000..e23e78e
--- /dev/null
+++ b/ui/src/views/topic/TopicConfig.vue
@@ -0,0 +1,203 @@
+
+
+
+
+
+
+
+
+