集群名称支持中文,消息查询可选择时间展示顺序
This commit is contained in:
@@ -27,7 +27,7 @@ request.interceptors.request.use((config) => {
|
|||||||
const clusterInfo = getClusterInfo();
|
const clusterInfo = getClusterInfo();
|
||||||
if (clusterInfo) {
|
if (clusterInfo) {
|
||||||
config.headers["X-Cluster-Info-Id"] = clusterInfo.id;
|
config.headers["X-Cluster-Info-Id"] = clusterInfo.id;
|
||||||
config.headers["X-Cluster-Info-Name"] = clusterInfo.clusterName;
|
// config.headers["X-Cluster-Info-Name"] = encodeURIComponent(clusterInfo.clusterName);
|
||||||
}
|
}
|
||||||
return config;
|
return config;
|
||||||
}, errorHandler);
|
}, errorHandler);
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ export default {
|
|||||||
this.$emit("closeDetailDialog", { refresh: false });
|
this.$emit("closeDetailDialog", { refresh: false });
|
||||||
},
|
},
|
||||||
formatTime(time) {
|
formatTime(time) {
|
||||||
return moment(time).format("YYYY-MM-DD HH:mm:ss:SSS");
|
return time == -1 ? -1 : moment(time).format("YYYY-MM-DD HH:mm:ss:SSS");
|
||||||
},
|
},
|
||||||
keyDeserializerChange() {
|
keyDeserializerChange() {
|
||||||
this.getMessageDetail();
|
this.getMessageDetail();
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
@change="handleChange"
|
||||||
>
|
>
|
||||||
<div slot="operation" slot-scope="record">
|
<div slot="operation" slot-scope="record">
|
||||||
<a-button
|
<a-button
|
||||||
@@ -41,9 +42,9 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
columns: columns,
|
|
||||||
showDetailDialog: false,
|
showDetailDialog: false,
|
||||||
record: {},
|
record: {},
|
||||||
|
sortedInfo: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -54,42 +55,56 @@ export default {
|
|||||||
closeDetailDialog() {
|
closeDetailDialog() {
|
||||||
this.showDetailDialog = false;
|
this.showDetailDialog = false;
|
||||||
},
|
},
|
||||||
},
|
handleChange() {
|
||||||
};
|
this.sortedInfo = arguments[2];
|
||||||
const columns = [
|
|
||||||
{
|
|
||||||
title: "topic",
|
|
||||||
dataIndex: "topic",
|
|
||||||
key: "topic",
|
|
||||||
width: 300,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "分区",
|
|
||||||
dataIndex: "partition",
|
|
||||||
key: "partition",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "偏移",
|
|
||||||
dataIndex: "offset",
|
|
||||||
key: "offset",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "时间",
|
|
||||||
dataIndex: "timestamp",
|
|
||||||
key: "timestamp",
|
|
||||||
slots: { title: "timestamp" },
|
|
||||||
scopedSlots: { customRender: "timestamp" },
|
|
||||||
customRender: (text) => {
|
|
||||||
return moment(text).format("YYYY-MM-DD HH:mm:ss:SSS");
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
computed: {
|
||||||
title: "操作",
|
columns() {
|
||||||
key: "operation",
|
let sortedInfo = this.sortedInfo || {};
|
||||||
scopedSlots: { customRender: "operation" },
|
const columns = [
|
||||||
width: 200,
|
{
|
||||||
|
title: "topic",
|
||||||
|
dataIndex: "topic",
|
||||||
|
key: "topic",
|
||||||
|
width: 300,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "分区",
|
||||||
|
dataIndex: "partition",
|
||||||
|
key: "partition",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "偏移",
|
||||||
|
dataIndex: "offset",
|
||||||
|
key: "offset",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "时间",
|
||||||
|
dataIndex: "timestamp",
|
||||||
|
key: "timestamp",
|
||||||
|
slots: { title: "timestamp" },
|
||||||
|
scopedSlots: { customRender: "timestamp" },
|
||||||
|
customRender: (text) => {
|
||||||
|
return text == -1
|
||||||
|
? -1
|
||||||
|
: moment(text).format("YYYY-MM-DD HH:mm:ss:SSS");
|
||||||
|
},
|
||||||
|
sorter: (a, b) => a.timestamp - b.timestamp,
|
||||||
|
sortOrder: sortedInfo.columnKey === "timestamp" && sortedInfo.order,
|
||||||
|
sortDirections: ["ascend", "descend"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
key: "operation",
|
||||||
|
scopedSlots: { customRender: "operation" },
|
||||||
|
width: 200,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
return columns;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
];
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|||||||
@@ -69,6 +69,9 @@ sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule require
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
import { KafkaClusterApi } from "@/utils/api";
|
import { KafkaClusterApi } from "@/utils/api";
|
||||||
import notification from "ant-design-vue/es/notification";
|
import notification from "ant-design-vue/es/notification";
|
||||||
|
import { getClusterInfo } from "@/utils/local-cache";
|
||||||
|
import { mapMutations } from "vuex";
|
||||||
|
import { CLUSTER } from "@/store/mutation-types";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AddClusterInfo",
|
name: "AddClusterInfo",
|
||||||
@@ -124,6 +127,17 @@ export default {
|
|||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.$message.success(res.msg);
|
this.$message.success(res.msg);
|
||||||
this.$emit(this.closeDialogEvent, { refresh: true });
|
this.$emit(this.closeDialogEvent, { refresh: true });
|
||||||
|
if (this.isModify) {
|
||||||
|
let clusterInfo = getClusterInfo();
|
||||||
|
if (
|
||||||
|
clusterInfo &&
|
||||||
|
clusterInfo.id &&
|
||||||
|
clusterInfo.id == this.clusterInfo.id &&
|
||||||
|
clusterInfo.clusterName != data.clusterName
|
||||||
|
) {
|
||||||
|
this.switchCluster(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
notification.error({
|
notification.error({
|
||||||
message: "error",
|
message: "error",
|
||||||
@@ -138,6 +152,9 @@ export default {
|
|||||||
this.data = [];
|
this.data = [];
|
||||||
this.$emit(this.closeDialogEvent, { refresh: false });
|
this.$emit(this.closeDialogEvent, { refresh: false });
|
||||||
},
|
},
|
||||||
|
...mapMutations({
|
||||||
|
switchCluster: CLUSTER.SWITCH,
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const defaultInfo = { clusterName: "", address: "", properties: "" };
|
const defaultInfo = { clusterName: "", address: "", properties: "" };
|
||||||
|
|||||||
Reference in New Issue
Block a user