fix: trace id

This commit is contained in:
Fine 2023-11-13 18:58:29 +08:00
parent 50ca810c7e
commit 618d4fc3bb
4 changed files with 13 additions and 3 deletions

View File

@ -142,6 +142,7 @@ limitations under the License. -->
/*global defineProps, Nullable, Recordable */
const props = defineProps({
currentSpan: { type: Object as PropType<Recordable>, default: () => ({}) },
traceId: { type: String, default: "" },
});
const { t } = useI18n();
const traceStore = useTraceStore();
@ -167,7 +168,7 @@ limitations under the License. -->
const res = await traceStore.getSpanLogs({
condition: {
relatedTrace: {
traceId: props.currentSpan.traceId,
traceId: props.currentSpan.traceId || props.traceId,
segmentId: props.currentSpan.segmentId,
spanId: props.currentSpan.spanId,
},

View File

@ -17,7 +17,13 @@ limitations under the License. -->
<div class="trace-t-loading" v-show="loading">
<Icon iconName="spinner" size="sm" />
</div>
<TableContainer :tableData="tableData" type="table" :headerType="headerType" @select="handleSelectSpan">
<TableContainer
:tableData="tableData"
type="table"
:headerType="headerType"
:traceId="traceId"
@select="handleSelectSpan"
>
<div class="trace-tips" v-if="!tableData.length">{{ $t("noData") }}</div>
</TableContainer>
</div>

View File

@ -41,6 +41,7 @@ limitations under the License. -->
</div>
<TableItem
:method="method"
:traceId="traceId"
v-for="(item, index) in tableData"
:data="item"
:key="'key' + index"
@ -63,6 +64,7 @@ limitations under the License. -->
tableData: { type: Array as PropType<Recordable>, default: () => [] },
type: { type: String, default: "" },
headerType: { type: String, default: "" },
traceId: { type: String, default: "" },
});
const emits = defineEmits(["select"]);
const method = ref<number>(300);

View File

@ -137,7 +137,7 @@ limitations under the License. -->
/>
</div>
<el-dialog v-model="showDetail" :destroy-on-close="true" fullscreen @closed="showDetail = false">
<SpanDetail :currentSpan="data" />
<SpanDetail :currentSpan="data" :traceId="traceId" />
</el-dialog>
</div>
</template>
@ -156,6 +156,7 @@ limitations under the License. -->
method: { type: Number, default: 0 },
type: { type: String, default: "" },
headerType: { type: String, default: "" },
traceId: { type: String, traceId: "" },
};
export default defineComponent({
name: "TableItem",