copy trace Id works

This commit is contained in:
Peter Olu 2022-05-18 11:32:46 +01:00
parent ca83e55315
commit 4b4970f214

View File

@ -81,12 +81,27 @@
@change="changeTraceId" @change="changeTraceId"
class="trace-detail-ids" class="trace-detail-ids"
/> />
<Icon <el-tooltip
class="box-item"
effect="dark"
content="Copy Id"
placement="bottom-start"
>
<el-button
size="small"
class="mr-10 filter-btn"
type="primary"
@click="handleClick(traceStore.currentTrace.traceIds)"
>
<Icon iconSize="sm" iconName="review-list" />
</el-button>
</el-tooltip>
<!-- <Icon
size="sm" size="sm"
class="icon grey link-hover cp ml-5" class="icon grey link-hover cp ml-5"
iconName="review-list" iconName="review-list"
@click="handleClick" @click="handleClick"
/> /> -->
</div> </div>
<div class="flex-h item"> <div class="flex-h item">
<div> <div>
@ -191,11 +206,13 @@ export default defineComponent({
traceStore.setCurrentView("traceList"); traceStore.setCurrentView("traceList");
} }
function handleClick(ids: string[] | any) { function handleClick(ids: string[] | any) {
let copyValue = null; let copyValue = null;
if (ids.length === 1) { if (ids.length === 1) {
copyValue = ids[0]; console.log(ids)
copyValue = ids[0].value;
} else { } else {
copyValue = ids.join(","); copyValue = ids.map((trace: any) => trace.value).join(",");
} }
copy(copyValue); copy(copyValue);
} }