mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-14 17:05:10 +00:00
update timeline
This commit is contained in:
parent
5fd9a2d37a
commit
a9f4fdd5ec
@ -154,3 +154,17 @@ pre {
|
|||||||
.switch {
|
.switch {
|
||||||
margin: 0 5px;
|
margin: 0 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.vis-tooltip {
|
||||||
|
max-width: 600px;
|
||||||
|
overflow: hidden;
|
||||||
|
background-color: #fff !important;
|
||||||
|
|
||||||
|
div {
|
||||||
|
word-wrap: break-word !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.vis-item {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
export const dragIgnoreFrom =
|
export const dragIgnoreFrom =
|
||||||
"svg.d3-trace-tree, .dragger, .micro-topo-chart, .schedules";
|
"svg.d3-trace-tree, .dragger, .micro-topo-chart, .schedules, .vis-item";
|
||||||
|
|
||||||
export const PodsChartTypes = ["EndpointList", "InstanceList"];
|
export const PodsChartTypes = ["EndpointList", "InstanceList"];
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ limitations under the License. -->
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch } from "vue";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { useEventStore } from "@/store/modules/event";
|
import { useEventStore } from "../../../../store/modules/event";
|
||||||
import { DataSet, Timeline } from "vis-timeline/standalone";
|
import { DataSet, Timeline } from "vis-timeline/standalone";
|
||||||
import "vis-timeline/styles/vis-timeline-graph2d.css";
|
import "vis-timeline/styles/vis-timeline-graph2d.css";
|
||||||
const eventStore = useEventStore();
|
const eventStore = useEventStore();
|
||||||
@ -27,6 +27,8 @@ const timeline = ref<Nullable<HTMLDivElement>>(null);
|
|||||||
const visGraph = ref<Nullable<any>>(null);
|
const visGraph = ref<Nullable<any>>(null);
|
||||||
const dateFormat = (date: number, pattern = "YYYY-MM-DD HH:mm:ss") =>
|
const dateFormat = (date: number, pattern = "YYYY-MM-DD HH:mm:ss") =>
|
||||||
new Date(dayjs(date).format(pattern));
|
new Date(dayjs(date).format(pattern));
|
||||||
|
const visDate = (date: number, pattern = "YYYY-MM-DD HH:mm:ss") =>
|
||||||
|
dayjs(date).format(pattern);
|
||||||
|
|
||||||
function visTimeline() {
|
function visTimeline() {
|
||||||
if (!timeline.value) {
|
if (!timeline.value) {
|
||||||
@ -48,27 +50,20 @@ function visTimeline() {
|
|||||||
width: "100%",
|
width: "100%",
|
||||||
locale: "en",
|
locale: "en",
|
||||||
tooltip: {
|
tooltip: {
|
||||||
template: function (originalItemData) {
|
template(originalItemData) {
|
||||||
const data = originalItemData.data || {};
|
const data = originalItemData.data || {};
|
||||||
return ` <div class="mb-5"><span class="grey">Event ID: </span>${
|
return `<div><span>Event ID: </span>${data.uuid || ""}</div>
|
||||||
data.uuid || ""
|
<div><span>Event Name: </span>${data.name || ""}</div>
|
||||||
}</div>
|
<div class="mb-5"><span>Event Type: </span>${data.type || ""}</div>
|
||||||
<div class="mb-5"><span class="grey">Event Name: </span>${
|
<div class="mb-5"><span>Start Time: </span>${
|
||||||
data.name || ""
|
data.startTime ? visDate(data.startTime) : ""
|
||||||
}</div>
|
}</div>
|
||||||
<div class="mb-5"><span class="grey">Event Type: </span>${
|
<div class="mb-5"><span>End Time: </span>${
|
||||||
data.type || ""
|
data.endTime ? visDate(data.endTime) : ""
|
||||||
}</div>
|
|
||||||
<div class="mb-5"><span class="grey">Start Time: </span>${
|
|
||||||
data.startTime || ""
|
|
||||||
}</div>
|
|
||||||
<div class="mb-5"><span class="grey">End Time: </span>${
|
|
||||||
data.endTime || ""
|
|
||||||
}</div>
|
}</div>
|
||||||
<div class="mb-5"><span class="grey">Event Message: </span>${
|
<div style="minHeight: 30px;word-wrap:break-word; max-width:400px">Event Message: ${
|
||||||
data.message || ""
|
data.message
|
||||||
}</div>
|
}</div>
|
||||||
<div class="mb-5"><span class="grey">Event Source: </span>
|
|
||||||
<div>Service:
|
<div>Service:
|
||||||
${data.source.service || ""}</div>
|
${data.source.service || ""}</div>
|
||||||
<div>
|
<div>
|
||||||
@ -98,4 +93,10 @@ watch(
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
min-height: 150px;
|
min-height: 150px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.message {
|
||||||
|
max-width: 400px;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user