delete topic
This commit is contained in:
@@ -61,4 +61,8 @@ export const KafkaTopicApi = {
|
||||
url: "/topic/list",
|
||||
method: "get",
|
||||
},
|
||||
deleteTopic: {
|
||||
url: "/topic",
|
||||
method: "delete",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -8,12 +8,7 @@
|
||||
:footer="null"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<a-form
|
||||
:form="form"
|
||||
:label-col="{ span: 5 }"
|
||||
:wrapper-col="{ span: 12 }"
|
||||
@submit="handleSubmit"
|
||||
>
|
||||
<a-form :form="form" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }">
|
||||
<a-form-item label="用户名">
|
||||
<span>{{ user.username }}</span>
|
||||
</a-form-item>
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
:title="'删除topic: ' + record.name + '?'"
|
||||
ok-text="确认"
|
||||
cancel-text="取消"
|
||||
@confirm="handleReset(record)"
|
||||
@confirm="deleteTopic(record.name)"
|
||||
>
|
||||
<a-button size="small" href="javascript:;" class="operation-btn"
|
||||
>删除</a-button
|
||||
@@ -74,6 +74,7 @@
|
||||
<script>
|
||||
import request from "@/utils/request";
|
||||
import { KafkaTopicApi } from "@/utils/api";
|
||||
import notification from "ant-design-vue/es/notification";
|
||||
export default {
|
||||
name: "Topic",
|
||||
components: {},
|
||||
@@ -113,6 +114,22 @@ export default {
|
||||
this.data = res.data;
|
||||
});
|
||||
},
|
||||
deleteTopic(topic) {
|
||||
request({
|
||||
url: KafkaTopicApi.deleteTopic.url + "?topic=" + topic,
|
||||
method: KafkaTopicApi.deleteTopic.method,
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success(res.msg);
|
||||
this.getTopicList();
|
||||
} else {
|
||||
notification.error({
|
||||
message: "error",
|
||||
description: res.msg,
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getTopicList();
|
||||
|
||||
Reference in New Issue
Block a user