mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-02 18:15:22 +00:00
update
This commit is contained in:
parent
969ae4251c
commit
9f4b087ace
@ -77,6 +77,7 @@ limitations under the License. -->
|
|||||||
border-bottom: 1px solid $border-color-primary;
|
border-bottom: 1px solid $border-color-primary;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
min-height: 350px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log-header {
|
.log-header {
|
||||||
|
@ -18,10 +18,18 @@ limitations under the License. -->
|
|||||||
<div id="trace-action-box">
|
<div id="trace-action-box">
|
||||||
<div @click="showDetail = true">Span Details</div>
|
<div @click="showDetail = true">Span Details</div>
|
||||||
<div v-for="span in parentSpans" :key="span.parentSegmentId" @click="viewParentSpan(span)">{{
|
<div v-for="span in parentSpans" :key="span.parentSegmentId" @click="viewParentSpan(span)">{{
|
||||||
`Parent Span: ${span.parentSegmentId}`
|
`Parent Span: ${span.endpointName} -> Start Time: ${visDate(span.startTime)}`
|
||||||
}}</div>
|
}}</div>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog v-model="showDetail" :destroy-on-close="true" @closed="showDetail = false" v-if="currentSpan?.segmentId">
|
<el-dialog
|
||||||
|
v-model="showDetail"
|
||||||
|
width="60%"
|
||||||
|
center
|
||||||
|
align-center
|
||||||
|
:destroy-on-close="true"
|
||||||
|
@closed="showDetail = false"
|
||||||
|
v-if="currentSpan?.segmentId"
|
||||||
|
>
|
||||||
<SpanDetail :currentSpan="currentSpan" />
|
<SpanDetail :currentSpan="currentSpan" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
@ -29,6 +37,7 @@ limitations under the License. -->
|
|||||||
import { ref, watch, onBeforeUnmount, onMounted } from "vue";
|
import { ref, watch, onBeforeUnmount, onMounted } from "vue";
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import * as d3 from "d3";
|
import * as d3 from "d3";
|
||||||
|
import dayjs from "dayjs";
|
||||||
import ListGraph from "../../utils/d3-trace-list";
|
import ListGraph from "../../utils/d3-trace-list";
|
||||||
import TreeGraph from "../../utils/d3-trace-tree";
|
import TreeGraph from "../../utils/d3-trace-tree";
|
||||||
import type { Span, Ref } from "@/types/trace";
|
import type { Span, Ref } from "@/types/trace";
|
||||||
@ -52,8 +61,9 @@ limitations under the License. -->
|
|||||||
const refSpans = ref<Array<Ref>>([]);
|
const refSpans = ref<Array<Ref>>([]);
|
||||||
const tree = ref<Nullable<any>>(null);
|
const tree = ref<Nullable<any>>(null);
|
||||||
const traceGraph = ref<Nullable<HTMLDivElement>>(null);
|
const traceGraph = ref<Nullable<HTMLDivElement>>(null);
|
||||||
const parentSpans = ref<Array<Ref>>([]);
|
const parentSpans = ref<Array<Span>>([]);
|
||||||
const debounceFunc = debounce(draw, 500);
|
const debounceFunc = debounce(draw, 500);
|
||||||
|
const visDate = (date: number, pattern = "YYYY-MM-DD HH:mm:ss:SSS") => dayjs(date).format(pattern);
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
tree,
|
tree,
|
||||||
@ -99,22 +109,28 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function handleSelectSpan(i: Recordable) {
|
function handleSelectSpan(i: Recordable) {
|
||||||
|
const spans = [];
|
||||||
parentSpans.value = [];
|
parentSpans.value = [];
|
||||||
currentSpan.value = i.data;
|
currentSpan.value = i.data;
|
||||||
parentSpans.value = [];
|
|
||||||
if (!currentSpan.value) {
|
if (!currentSpan.value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (const ref of currentSpan.value.refs || []) {
|
for (const ref of currentSpan.value.refs || []) {
|
||||||
parentSpans.value.push(ref);
|
spans.push(ref);
|
||||||
}
|
}
|
||||||
if ((currentSpan.value.parentSpanId ?? -1) > -1) {
|
if (currentSpan.value.parentSpanId > -1) {
|
||||||
parentSpans.value.push({
|
spans.push({
|
||||||
parentSegmentId: currentSpan.value.segmentId,
|
parentSegmentId: currentSpan.value.segmentId,
|
||||||
parentSpanId: currentSpan.value.parentSpanId,
|
parentSpanId: currentSpan.value.parentSpanId,
|
||||||
traceId: currentSpan.value.traceId,
|
traceId: currentSpan.value.traceId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
for (const span of spans) {
|
||||||
|
const item = props.data.find(
|
||||||
|
(d) => d.segmentId === span.parentSegmentId && d.spanId === span.parentSpanId && d.traceId === span.traceId,
|
||||||
|
);
|
||||||
|
item && parentSpans.value.push(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function viewParentSpan(span: Recordable) {
|
function viewParentSpan(span: Recordable) {
|
||||||
tree.value.highlightParents(span);
|
tree.value.highlightParents(span);
|
||||||
@ -423,7 +439,7 @@ limitations under the License. -->
|
|||||||
|
|
||||||
.trace-node.highlightedParent .node-text {
|
.trace-node.highlightedParent .node-text {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
fill: #4caf50;
|
fill: #409eff;
|
||||||
}
|
}
|
||||||
|
|
||||||
#trace-action-box {
|
#trace-action-box {
|
||||||
|
@ -87,7 +87,14 @@ limitations under the License. -->
|
|||||||
{{ t("relatedTraceLogs") }}
|
{{ t("relatedTraceLogs") }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog v-model="showEventDetail" :destroy-on-close="true" @closed="showEventDetail = false">
|
<el-dialog
|
||||||
|
v-model="showEventDetail"
|
||||||
|
width="60%"
|
||||||
|
center
|
||||||
|
align-center
|
||||||
|
:destroy-on-close="true"
|
||||||
|
@closed="showEventDetail = false"
|
||||||
|
>
|
||||||
<div>
|
<div>
|
||||||
<div class="mb-10">
|
<div class="mb-10">
|
||||||
<span class="grey title">Name:</span>
|
<span class="grey title">Name:</span>
|
||||||
@ -115,7 +122,14 @@ limitations under the License. -->
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog v-model="showRelatedLogs" :destroy-on-close="true" @closed="showRelatedLogs = false">
|
<el-dialog
|
||||||
|
v-model="showRelatedLogs"
|
||||||
|
width="60%"
|
||||||
|
center
|
||||||
|
align-center
|
||||||
|
:destroy-on-close="true"
|
||||||
|
@closed="showRelatedLogs = false"
|
||||||
|
>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
v-model="pageNum"
|
v-model="pageNum"
|
||||||
:page-size="pageSize"
|
:page-size="pageSize"
|
||||||
|
@ -413,16 +413,14 @@ export default class ListGraph {
|
|||||||
});
|
});
|
||||||
const parentSpan = nodes.find(
|
const parentSpan = nodes.find(
|
||||||
(node: Recordable) =>
|
(node: Recordable) =>
|
||||||
span.parentSpanId === node.data.spanId &&
|
span.spanId === node.data.spanId &&
|
||||||
span.parentSegmentId === node.data.segmentId &&
|
span.segmentId === node.data.segmentId &&
|
||||||
span.traceId === node.data.traceId,
|
span.traceId === node.data.traceId,
|
||||||
);
|
);
|
||||||
if (parentSpan) {
|
if (!parentSpan) return;
|
||||||
d3.select(`#list-node-${parentSpan.id}`).classed("highlightedParent", true);
|
d3.select(`#list-node-${parentSpan.id}`).classed("highlightedParent", true);
|
||||||
}
|
|
||||||
d3.select("#trace-action-box").style("display", "none");
|
d3.select("#trace-action-box").style("display", "none");
|
||||||
this.selectedNode.classed("highlighted", false);
|
this.selectedNode.classed("highlighted", false);
|
||||||
if (!parentSpan) return;
|
|
||||||
const container = document.querySelector(".trace-chart .charts");
|
const container = document.querySelector(".trace-chart .charts");
|
||||||
const containerRect = container?.getBoundingClientRect();
|
const containerRect = container?.getBoundingClientRect();
|
||||||
if (!containerRect) return;
|
if (!containerRect) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user