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

View File

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

View File

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

View File

@ -59,23 +59,30 @@ function visTimeline() {
}; };
}); });
const items: any = new DataSet(events); const items: any = new DataSet(events);
const options = { const options: any = {
height: h, height: h,
width: "100%", width: "100%",
minHeight: "150px",
locale: "en", locale: "en",
autoResize: false, autoResize: false,
tooltip: { tooltip: {
overflowMethod: "cap",
template(item) { template(item) {
const data = item.data || {}; const data = item.data || {};
return `<div>ID: ${data.uuid || ""}</div> let tmp = `<div>ID: ${data.uuid || ""}</div>
<div>Name: ${data.name || ""}</div> <div>Name: ${data.name || ""}</div>
<div>Event Type: ${data.type || ""}</div> <div>Event Type: ${data.type || ""}</div>
<div>Start Time: ${data.startTime ? visDate(data.startTime) : ""}</div> <div>Start Time: ${data.startTime ? visDate(data.startTime) : ""}</div>
<div>End Time: ${data.endTime ? visDate(data.endTime) : ""}</div> <div>End Time: ${data.endTime ? visDate(data.endTime) : ""}</div>
<div>Message: ${data.message || ""}</div> <div>Message: ${data.message || ""}</div>
<div>Service: ${data.source.service || ""}</div> <div>Service: ${data.source.service || ""}</div>`;
<div>Endpoint: ${data.source.endpoint || ""}</div> if (data.source.endpoint) {
<div>Service Instance: ${data.source.instance || ""}</div>`; 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; width: 120px;
} }
.row {
position: relative;
}
.inputs-max { .inputs-max {
width: 270px; width: 270px;
} }
.search-btn { .search-btn {
position: absolute;
top: 0;
right: 10px;
cursor: pointer; cursor: pointer;
width: 120px; width: 120px;
} }