add action box

This commit is contained in:
Fine 2025-04-14 11:33:29 +08:00
parent 319f9bbc30
commit 464827e8a1
4 changed files with 31 additions and 13 deletions

View File

@ -162,6 +162,9 @@ limitations under the License. -->
} }
} }
function viewParentSpan(span: Recordable) { function viewParentSpan(span: Recordable) {
if (props.type === TraceGraphType.TABLE) {
return;
}
tree.value.highlightParents(span); tree.value.highlightParents(span);
} }
function traverseTree(node: Recordable, spanId: string, segmentId: string, data: Recordable) { function traverseTree(node: Recordable, spanId: string, segmentId: string, data: Recordable) {

View File

@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. --> limitations under the License. -->
<template> <template>
<div class="charts"> <div class="trace-table-charts">
<Graph :data="data" :traceId="traceId" :type="TraceGraphType.TABLE" :headerType="headerType" /> <Graph :data="data" :traceId="traceId" :type="TraceGraphType.TABLE" :headerType="headerType" />
</div> </div>
</template> </template>
@ -29,10 +29,11 @@ limitations under the License. -->
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.charts { .trace-table-charts {
overflow: auto; overflow: auto;
padding: 10px; padding: 10px;
height: 100%; height: 100%;
width: 100%; width: 100%;
position: relative;
} }
</style> </style>

View File

@ -47,7 +47,7 @@ limitations under the License. -->
:key="`key${index}`" :key="`key${index}`"
:type="type" :type="type"
:headerType="headerType" :headerType="headerType"
@click="selectItem()" @click="selectItem"
/> />
<slot></slot> <slot></slot>
</div> </div>
@ -104,8 +104,24 @@ limitations under the License. -->
}; };
}; };
}); });
function selectItem() { function selectItem(event: MouseEvent) {
emits("select", traceStore.selectedSpan); emits("select", traceStore.selectedSpan);
if (props.headerType === WidgetType.Profile) {
return;
}
if (props.type === TraceGraphType.STATISTICS) {
return;
}
const item: any = document.querySelector("#trace-action-box");
const tableBox = document.querySelector(".trace-table-charts")?.getBoundingClientRect();
if (!tableBox) {
return;
}
const offsetX = event.x - tableBox.x;
const offsetY = event.y - tableBox.y;
item.style.display = "block";
item.style.top = `${offsetY + 20}px`;
item.style.left = `${offsetX + 10}px`;
} }
function sortStatistics(key: string) { function sortStatistics(key: string) {
const element = props.tableData; const element = props.tableData;

View File

@ -17,14 +17,14 @@ limitations under the License. -->
<div v-if="type === TraceGraphType.STATISTICS"> <div v-if="type === TraceGraphType.STATISTICS">
<div class="trace-item"> <div class="trace-item">
<div :class="['method']"> <div :class="['method']">
<el-tooltip :content="data.groupRef.endpointName" placement="bottom" :show-after="300"> <el-tooltip :content="data.groupRef.endpointName" placement="top" :show-after="300">
<span> <span>
{{ data.groupRef.endpointName }} {{ data.groupRef.endpointName }}
</span> </span>
</el-tooltip> </el-tooltip>
</div> </div>
<div :class="['type']"> <div :class="['type']">
<el-tooltip :content="data.groupRef.type" placement="bottom" :show-after="300"> <el-tooltip :content="data.groupRef.type" placement="top" :show-after="300">
<span> <span>
{{ data.groupRef.type }} {{ data.groupRef.type }}
</span> </span>
@ -75,7 +75,7 @@ limitations under the License. -->
/> />
<el-tooltip <el-tooltip
:content="data.type === 'Entry' ? 'Entry' : 'Exit'" :content="data.type === 'Entry' ? 'Entry' : 'Exit'"
placement="bottom" placement="top"
:show-after="300" :show-after="300"
v-if="['Entry', 'Exit'].includes(data.type)" v-if="['Entry', 'Exit'].includes(data.type)"
> >
@ -83,12 +83,12 @@ limitations under the License. -->
<Icon :iconName="data.type === 'Entry' ? 'entry' : 'exit'" size="sm" class="mr-5" /> <Icon :iconName="data.type === 'Entry' ? 'entry' : 'exit'" size="sm" class="mr-5" />
</span> </span>
</el-tooltip> </el-tooltip>
<el-tooltip v-if="isCrossThread" content="CROSS_THREAD" placement="bottom" :show-after="300"> <el-tooltip v-if="isCrossThread" content="CROSS_THREAD" placement="top" :show-after="300">
<span> <span>
<Icon iconName="cross" size="sm" class="mr-5" /> <Icon iconName="cross" size="sm" class="mr-5" />
</span> </span>
</el-tooltip> </el-tooltip>
<el-tooltip :content="data.endpointName" placement="bottom" :show-after="300"> <el-tooltip :content="data.endpointName" placement="top" :show-after="300">
<span> <span>
{{ data.endpointName }} {{ data.endpointName }}
</span> </span>
@ -109,12 +109,12 @@ limitations under the License. -->
{{ data.dur ? data.dur + "" : "0" }} {{ data.dur ? data.dur + "" : "0" }}
</div> </div>
<div class="api"> <div class="api">
<el-tooltip :show-after="300" :content="data.component || '-'" placement="bottom"> <el-tooltip :show-after="300" :content="data.component || '-'" placement="top">
<span>{{ data.component || "-" }}</span> <span>{{ data.component || "-" }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
<div class="application"> <div class="application">
<el-tooltip :show-after="300" :content="data.serviceCode || '-'" placement="bottom"> <el-tooltip :show-after="300" :content="data.serviceCode || '-'" placement="top">
<span>{{ data.serviceCode }}</span> <span>{{ data.serviceCode }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
@ -284,8 +284,6 @@ limitations under the License. -->
} }
.trace-item.level0 { .trace-item.level0 {
color: #448dfe;
&:hover { &:hover {
background: rgb(0 0 0 / 4%); background: rgb(0 0 0 / 4%);
} }