消费详情fixed,在线发送页面调整.
This commit is contained in:
@@ -49,17 +49,10 @@ public class MessageController {
|
|||||||
return messageService.deserializerList();
|
return messageService.deserializerList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ControllerLog("在线发送消息")
|
|
||||||
@Permission("message:send")
|
|
||||||
@PostMapping("/send")
|
@PostMapping("/send")
|
||||||
public Object send(@RequestBody SendMessage message) {
|
|
||||||
return messageService.send(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/sendWithHeader")
|
|
||||||
@ControllerLog("在线发送消息")
|
@ControllerLog("在线发送消息")
|
||||||
@Permission("message:send")
|
@Permission("message:send")
|
||||||
public Object sendWithHeader(@RequestBody SendMessage message) {
|
public Object send(@RequestBody SendMessage message) {
|
||||||
return messageService.sendWithHeader(message);
|
return messageService.sendWithHeader(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class ConsumerConsole(config: KafkaConfig) extends KafkaConsole(config: KafkaCon
|
|||||||
t.lag = t.logEndOffset - t.consumerOffset
|
t.lag = t.logEndOffset - t.consumerOffset
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
t.lag = t.logEndOffset - t.consumerOffset
|
// t.lag = t.logEndOffset - t.consumerOffset
|
||||||
(topicPartition, t)
|
(topicPartition, t)
|
||||||
}).toMap
|
}).toMap
|
||||||
|
|
||||||
|
|||||||
@@ -288,10 +288,6 @@ export const KafkaMessageApi = {
|
|||||||
url: "/message/send",
|
url: "/message/send",
|
||||||
method: "post",
|
method: "post",
|
||||||
},
|
},
|
||||||
sendWithHeader: {
|
|
||||||
url: "/message/sendWithHeader",
|
|
||||||
method: "post",
|
|
||||||
},
|
|
||||||
resend: {
|
resend: {
|
||||||
url: "/message/resend",
|
url: "/message/resend",
|
||||||
method: "post",
|
method: "post",
|
||||||
|
|||||||
@@ -15,15 +15,20 @@
|
|||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
placeholder="请选择一个topic"
|
placeholder="请选择一个topic"
|
||||||
>
|
>
|
||||||
<a-select-option v-for="v in topicList" :key="v" :value="v">
|
<a-select-option v-for="v in topicList" :key="v" :value="v">
|
||||||
{{ v }}
|
{{ v }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="分区">
|
<a-form-item label="分区">
|
||||||
<a-select class="type-select" show-search option-filter-prop="children" v-model="selectPartition"
|
<a-select
|
||||||
placeholder="请选择一个分区">
|
class="type-select"
|
||||||
|
show-search
|
||||||
|
option-filter-prop="children"
|
||||||
|
v-model="selectPartition"
|
||||||
|
placeholder="请选择一个分区"
|
||||||
|
>
|
||||||
<a-select-option v-for="v in partitions" :key="v" :value="v">
|
<a-select-option v-for="v in partitions" :key="v" :value="v">
|
||||||
<span v-if="v == -1">默认</span> <span v-else>{{ v }}</span>
|
<span v-if="v == -1">默认</span> <span v-else>{{ v }}</span>
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
@@ -31,20 +36,32 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="消息头">
|
<a-form-item label="消息头">
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>header key</th>
|
|
||||||
<th>header value</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(row, index) in rows" :key="index">
|
<tr v-for="(row, index) in rows" :key="index">
|
||||||
<td> <a-input v-model="row.headerKey" /></td>
|
<td class="w-30">
|
||||||
<td> <a-input v-model="row.headerValue" /></td>
|
<a-input v-model="row.headerKey" placeholder="key" />
|
||||||
<td><a-button type="primary" @click="deleteRow(index)">删除</a-button></td>
|
</td>
|
||||||
|
<td class="w-60">
|
||||||
|
<a-input v-model="row.headerValue" placeholder="value" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a-button
|
||||||
|
type="danger"
|
||||||
|
@click="deleteRow(index)"
|
||||||
|
v-show="rows.length > 1"
|
||||||
|
>删除</a-button
|
||||||
|
>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a-button
|
||||||
|
type="primary"
|
||||||
|
@click="addRow"
|
||||||
|
v-show="index == rows.length - 1"
|
||||||
|
>添加</a-button
|
||||||
|
>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
<a-button type="primary" @click="addRow">添加</a-button>
|
|
||||||
</table>
|
</table>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="消息Key">
|
<a-form-item label="消息Key">
|
||||||
@@ -52,35 +69,37 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="消息体" has-feedback>
|
<a-form-item label="消息体" has-feedback>
|
||||||
<a-textarea
|
<a-textarea
|
||||||
v-decorator="[
|
v-decorator="[
|
||||||
'body',
|
'body',
|
||||||
{
|
{
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '输入消息体!',
|
message: '输入消息体!',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
placeholder="输入消息体!" />
|
placeholder="输入消息体!"
|
||||||
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="发送的消息数">
|
<a-form-item label="发送的消息数">
|
||||||
<a-input-number v-decorator="[
|
<a-input-number
|
||||||
'num',
|
v-decorator="[
|
||||||
{
|
'num',
|
||||||
initialValue: 1,
|
{
|
||||||
rules: [
|
initialValue: 1,
|
||||||
{
|
rules: [
|
||||||
required: true,
|
{
|
||||||
message: '输入消息数!',
|
required: true,
|
||||||
},
|
message: '输入消息数!',
|
||||||
],
|
},
|
||||||
},
|
],
|
||||||
]"
|
},
|
||||||
:min="1"
|
]"
|
||||||
:max="32"
|
:min="1"
|
||||||
/>
|
:max="32"
|
||||||
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :wrapper-col="{ span: 12, offset: 5 }">
|
<a-form-item :wrapper-col="{ span: 12, offset: 5 }">
|
||||||
<a-button type="primary" html-type="submit"> 提交 </a-button>
|
<a-button type="primary" html-type="submit"> 提交 </a-button>
|
||||||
@@ -97,18 +116,15 @@ import notification from "ant-design-vue/lib/notification";
|
|||||||
export default {
|
export default {
|
||||||
name: "SendMessage",
|
name: "SendMessage",
|
||||||
components: {},
|
components: {},
|
||||||
props: {
|
props: {},
|
||||||
topicList: {
|
|
||||||
type: Array,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: this.$form.createForm(this, { name: "message_send" }),
|
form: this.$form.createForm(this, { name: "message_send" }),
|
||||||
loading: false,
|
loading: false,
|
||||||
partitions: [],
|
partitions: [],
|
||||||
selectPartition: undefined,
|
selectPartition: undefined,
|
||||||
rows: [{ headerKey: '', headerValue: '' }],
|
rows: [{ headerKey: "", headerValue: "" }],
|
||||||
|
topicList: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -150,15 +166,15 @@ export default {
|
|||||||
this.getPartitionInfo(topic);
|
this.getPartitionInfo(topic);
|
||||||
},
|
},
|
||||||
addRow() {
|
addRow() {
|
||||||
if(this.rows.length<32){
|
if (this.rows.length < 32) {
|
||||||
this.rows.push({ HeaderKey: '', HeaderValue: '' });
|
this.rows.push({ HeaderKey: "", HeaderValue: "" });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deleteRow(index) {
|
deleteRow(index) {
|
||||||
this.rows.splice(index, 1);
|
this.rows.splice(index, 1);
|
||||||
},
|
},
|
||||||
handleSubmit(e) {
|
handleSubmit(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.form.validateFields((err, values) => {
|
this.form.validateFields((err, values) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
const param = Object.assign({}, values, {
|
const param = Object.assign({}, values, {
|
||||||
@@ -167,8 +183,8 @@ export default {
|
|||||||
});
|
});
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
request({
|
request({
|
||||||
url: KafkaMessageApi.sendWithHeader.url,
|
url: KafkaMessageApi.send.url,
|
||||||
method: KafkaMessageApi.sendWithHeader.method,
|
method: KafkaMessageApi.send.method,
|
||||||
data: param,
|
data: param,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@@ -190,5 +206,11 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style scoped>
|
||||||
<style scoped></style>
|
.w-30 {
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
|
.w-60 {
|
||||||
|
width: 500px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user