This commit is contained in:
Fine 2022-11-23 17:46:05 +08:00
parent e9543ff31d
commit ba916a942b
4 changed files with 19 additions and 17 deletions

View File

@ -176,21 +176,6 @@ export const traceStore = defineStore({
return res.data; return res.data;
} }
const data = res.data.data.trace.spans; const data = res.data.data.trace.spans;
data[4].attachedEvents = [
{
startTime: {
seconds: 1669102205296,
nanos: 1669102205296,
},
event: "event",
endTime: {
seconds: 1669102212791,
nanos: 1669102212791,
},
tags: [{ key: "test", value: "test" }],
summary: [{ key: "test", value: 123 }],
},
];
this.setTraceSpans(data || []); this.setTraceSpans(data || []);
return res.data; return res.data;
}, },

View File

@ -81,14 +81,14 @@ limitations under the License. -->
</div> </div>
<h5 <h5
class="mb-10" class="mb-10"
v-if="currentSpan.attachedEvent && currentSpan.attachedEvent.length" v-if="currentSpan.attachedEvents && currentSpan.attachedEvents.length"
> >
{{ t("events") }}. {{ t("events") }}.
</h5> </h5>
<div <div
class="attach-events" class="attach-events"
ref="timeline" ref="timeline"
v-if="currentSpan.attachedEvent && currentSpan.attachedEvent.length" v-if="currentSpan.attachedEvents && currentSpan.attachedEvents.length"
></div> ></div>
<el-button class="popup-btn" type="primary" @click="getTaceLogs"> <el-button class="popup-btn" type="primary" @click="getTaceLogs">
{{ t("relatedTraceLogs") }} {{ t("relatedTraceLogs") }}
@ -190,6 +190,7 @@ const total = computed(() =>
? pageSize * pageNum.value + 1 ? pageSize * pageNum.value + 1
: pageSize * pageNum.value : pageSize * pageNum.value
); );
console.log(props.currentSpan);
const visDate = (date: number, pattern = "YYYY-MM-DD HH:mm:ss") => const visDate = (date: number, pattern = "YYYY-MM-DD HH:mm:ss") =>
dayjs(date).format(pattern); dayjs(date).format(pattern);

View File

@ -112,6 +112,9 @@ limitations under the License. -->
> >
<span>{{ t("view") }}</span> <span>{{ t("view") }}</span>
</div> </div>
<div class="application" v-show="headerType !== 'profile'">
<span>{{ data.attachedEvents && data.attachedEvents.length }}</span>
</div>
</div> </div>
<div <div
v-show="data.children && data.children.length > 0 && displayChildren" v-show="data.children && data.children.length > 0 && displayChildren"
@ -247,6 +250,15 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
@import "./table.scss"; @import "./table.scss";
.event-tag {
width: 12px;
height: 12px;
border-radius: 12px;
border: 1px solid #e66;
color: #e66;
display: inline-block;
}
.trace-item.level0 { .trace-item.level0 {
color: #448dfe; color: #448dfe;

View File

@ -79,6 +79,10 @@ export const TraceConstant = [
label: "application", label: "application",
value: "Service", value: "Service",
}, },
{
label: "application",
value: "Attached Events",
},
]; ];
export const StatisticsConstant = [ export const StatisticsConstant = [