Copilot commented on code in PR #823:
URL: 
https://github.com/apache/skywalking-banyandb/pull/823#discussion_r2463194952


##########
ui/src/components/TraceTree/Table/Index.vue:
##########
@@ -0,0 +1,65 @@
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+  http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License. -->
+<template>
+  <div class="trace-table-charts">
+    <TableContainer
+      :tableData="segmentId"
+      :selectedMaxTimestamp="selectedMaxTimestamp"
+      :selectedMinTimestamp="selectedMinTimestamp"
+      @select="handleSelectSpan"
+    >
+      <div class="trace-tips" v-if="!segmentId.length">No data</div>
+    </TableContainer>
+  </div>
+</template>
+<script setup>
+  import { ref, onMounted } from 'vue';
+  import TableContainer from '../Table/TableContainer.vue';
+
+  const props = defineProps({
+    data: Array,
+    selectedMaxTimestamp: Number,
+    selectedMinTimestamp: Number,
+  });
+  const emits = defineEmits(['select']);
+  const segmentId = ref([]);
+  onMounted(() => {
+    segmentId.value = setLevel(props.data);
+    console.log(segmentId.value);

Review Comment:
   Debug console.log statement should be removed before merging to production.
   ```suggestion
   
   ```



##########
ui/src/components/TraceTree/TraceContent.vue:
##########
@@ -0,0 +1,143 @@
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License. -->
+<template>
+  <div class="detail-section-timeline" style="display: flex; flex-direction: 
column">
+    <MinTimeline
+      v-show="minTimelineVisible"
+      :spanList="spanList"
+      :minTimestamp="minTimestamp"
+      :maxTimestamp="maxTimestamp"
+      @updateSelectedMaxTimestamp="handleSelectedMaxTimestamp"
+      @updateSelectedMinTimestamp="handleSelectedMinTimestamp"
+    />
+    <div class="timeline-tool">
+      <el-button :icon="DCaret" size="small" @click="toggleMinTimeline" />
+    </div>
+    <TableGraph
+      :data="traceData"
+      :selectedMaxTimestamp="selectedMaxTimestamp"
+      :selectedMinTimestamp="selectedMinTimestamp"
+      :minTimestamp="minTimestamp"
+      :maxTimestamp="maxTimestamp"
+    />
+  </div>
+</template>
+
+<script setup>
+  import { ref, computed } from 'vue';
+  import { DCaret } from '@element-plus/icons-vue';
+  import MinTimeline from './MinTimeline.vue';
+  import TableGraph from './Table/Index.vue';
+
+  const props = defineProps({
+    trace: Object,
+  });
+  const traceData = computed(() => {
+    return props.trace.spans.map((span) => convertTree(span));
+  });
+  const spanList = computed(() => {
+    return getAllNodes({ label: 'TRACE_ROOT', children: traceData.value });
+  });
+  // Time range like xScale domain [0, max]
+  const minTimestamp = computed(() => {
+    if (!traceData.value.length) return 0;
+    return Math.min(...spanList.value.filter((s) => s.startTime > 0).map((s) 
=> s.startTime));
+  });
+
+  const maxTimestamp = computed(() => {
+    const timestamps = spanList.value.map((span) => span.endTime || 0);
+    if (timestamps.length === 0) return 0;
+
+    return Math.max(...timestamps);
+  });
+  const selectedMaxTimestamp = ref(maxTimestamp.value);
+  const selectedMinTimestamp = ref(minTimestamp.value);
+  const minTimelineVisible = ref(true);
+
+  function handleSelectedMaxTimestamp(value) {
+    selectedMaxTimestamp.value = value;
+  }
+
+  function handleSelectedMinTimestamp(value) {
+    selectedMinTimestamp.value = value;
+  }
+
+  function toggleMinTimeline() {
+    minTimelineVisible.value = !minTimelineVisible.value;
+  }
+
+  function convertTree(d, spans) {

Review Comment:
   The 'spans' parameter is declared but never used in the function. Remove 
this unused parameter.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to