update timeline

This commit is contained in:
Qiuxia Fan 2022-06-22 11:30:32 +08:00
parent 930a0b43f9
commit 4ecb047700
5 changed files with 14 additions and 18 deletions

View File

@ -110,9 +110,6 @@ export const dashboardStore = defineStore({
: 3,
};
}
if (type === "Event") {
newItem.h = 24;
}
if (["Trace", "Profile", "Log", "DemandLog", "Ebpf"].includes(type)) {
newItem.h = 36;
}
@ -168,9 +165,6 @@ export const dashboardStore = defineStore({
showDepth: true,
};
}
if (type === "Event") {
newItem.h = 24;
}
if (["Trace", "Profile", "Log", "DemandLog", "Ebpf"].includes(type)) {
newItem.h = 32;
}

View File

@ -160,6 +160,7 @@ div.vis-tooltip {
overflow: hidden;
background-color: #fff !important;
white-space: normal !important;
font-size: 12px !important;
}
.vis-item {

View File

@ -72,6 +72,7 @@ function removeWidget() {
position: absolute;
top: 5px;
right: 3px;
z-index: 9999;
}
.header {

View File

@ -59,23 +59,30 @@ function visTimeline() {
};
});
const items: any = new DataSet(events);
const options = {
const options: any = {
height: h,
width: "100%",
minHeight: "150px",
locale: "en",
autoResize: false,
tooltip: {
overflowMethod: "cap",
template(item) {
const data = item.data || {};
return `<div>ID: ${data.uuid || ""}</div>
let tmp = `<div>ID: ${data.uuid || ""}</div>
<div>Name: ${data.name || ""}</div>
<div>Event Type: ${data.type || ""}</div>
<div>Start Time: ${data.startTime ? visDate(data.startTime) : ""}</div>
<div>End Time: ${data.endTime ? visDate(data.endTime) : ""}</div>
<div>Message: ${data.message || ""}</div>
<div>Service: ${data.source.service || ""}</div>
<div>Endpoint: ${data.source.endpoint || ""}</div>
<div>Service Instance: ${data.source.instance || ""}</div>`;
<div>Service: ${data.source.service || ""}</div>`;
if (data.source.endpoint) {
tmp += `<div>Endpoint: ${data.source.endpoint}</div>`;
}
if (data.source.instance) {
tmp += `<div>Service Instance: ${data.source.instance}</div>`;
}
return tmp;
},
},
};

View File

@ -213,18 +213,11 @@ watch(
width: 120px;
}
.row {
position: relative;
}
.inputs-max {
width: 270px;
}
.search-btn {
position: absolute;
top: 0;
right: 10px;
cursor: pointer;
width: 120px;
}