diff --git a/src/assets/icons/info_outline.svg b/src/assets/icons/info_outline.svg index c9a2b468..3ba1c393 100644 --- a/src/assets/icons/info_outline.svg +++ b/src/assets/icons/info_outline.svg @@ -13,6 +13,5 @@ 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. --> -info_outline diff --git a/src/hooks/useAssociateProcessor.ts b/src/hooks/useAssociateProcessor.ts index a3be902c..5992261a 100644 --- a/src/hooks/useAssociateProcessor.ts +++ b/src/hooks/useAssociateProcessor.ts @@ -1,4 +1,3 @@ -import { Option } from "@/types/app"; /** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -96,11 +95,14 @@ export default function associateProcessor(props: any) { const status = relatedTrace.status; const queryOrder = relatedTrace.queryOrder; const latency = relatedTrace.latency; - let latencyList = undefined; - const series = props.option.series; - // console.log(series); - if (latency && series) { - latencyList = series.map( + const series = props.option.series || []; + const item: any = { + duration, + queryOrder, + status, + }; + if (latency) { + const latencyList = series.map( (d: { name: string; data: number[][] }, index: number) => { const data = [ d.data[currentParams.dataIndex][1], @@ -118,13 +120,18 @@ export default function associateProcessor(props: any) { }; } ); + item.latency = latencyList; } - const item = { - duration, - queryOrder, - status, - latency: latencyList, - }; + const value = series.map( + (d: { name: string; data: number[][] }, index: number) => { + return { + label: d.name, + value: String(index), + data: d.data[currentParams.dataIndex][1], + }; + } + ); + item.metricValue = value; return item; } return { eventAssociate, traceFilters }; diff --git a/src/locales/lang/en.ts b/src/locales/lang/en.ts index 0a4266b0..3bd2af59 100644 --- a/src/locales/lang/en.ts +++ b/src/locales/lang/en.ts @@ -162,6 +162,7 @@ const msg = { setLatencyDuration: "Set Latency Range", queryOrder: "Query Order", latency: "Latency", + metricValues: "Metric Values", seconds: "Seconds", hourTip: "Select Hour", minuteTip: "Select Minute", diff --git a/src/locales/lang/es.ts b/src/locales/lang/es.ts index 3bd081cf..3141dce6 100644 --- a/src/locales/lang/es.ts +++ b/src/locales/lang/es.ts @@ -159,6 +159,7 @@ const msg = { apisix: "APISIX", queryOrder: "Orden de consulta", latency: "Retraso", + metricValues: "Valor métrico", seconds: "Segundos", hourTip: "Seleccione Hora", minuteTip: "Seleccione Minuto", diff --git a/src/locales/lang/zh.ts b/src/locales/lang/zh.ts index de10a25e..4b7c0317 100644 --- a/src/locales/lang/zh.ts +++ b/src/locales/lang/zh.ts @@ -159,6 +159,7 @@ const msg = { setLatencyDuration: "设置延时范围", queryOrder: "查询顺序", latency: "延迟", + metricValues: "指标值", seconds: "秒", hourTip: "选择小时", minuteTip: "选择分钟", diff --git a/src/views/dashboard/related/trace/Header.vue b/src/views/dashboard/related/trace/Header.vue index d13e24c8..91be116d 100644 --- a/src/views/dashboard/related/trace/Header.vue +++ b/src/views/dashboard/related/trace/Header.vue @@ -25,13 +25,26 @@ limitations under the License. --> + + +
+
{{ t("metricValues") }}
+
+ {{ metric.label }}: {{ metric.data }} +
+
+
@@ -94,10 +107,10 @@ const currentLatency = ref( init(); async function init() { - // console.log(filters); + console.log(filters); if (!filters.id) { for (const d of Object.keys(filters)) { - if (filters[d] && d !== "duration") { + if (filters[d] && !["metricValue", "duration"].includes(d)) { items.value.push({ label: d, value: FiltersKeys[d] }); } } @@ -219,4 +232,8 @@ onUnmounted(() => { .search-btn { margin-top: 2px; } + +.metric-value { + padding: 10px 5px; +}