From 212625862a1d04a170f5b23218e5a9b9a88b8bd6 Mon Sep 17 00:00:00 2001 From: Fine Date: Mon, 24 Oct 2022 11:18:19 +0800 Subject: [PATCH] update --- src/locales/lang/en.ts | 1 + src/locales/lang/es.ts | 1 + src/locales/lang/zh.ts | 1 + src/views/dashboard/related/trace/Filter.vue | 8 ----- src/views/dashboard/related/trace/Header.vue | 31 ++++++++++++-------- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/locales/lang/en.ts b/src/locales/lang/en.ts index a700b93d..0a4266b0 100644 --- a/src/locales/lang/en.ts +++ b/src/locales/lang/en.ts @@ -161,6 +161,7 @@ const msg = { relatedTraceOptions: "Related Trace Options", setLatencyDuration: "Set Latency Range", queryOrder: "Query Order", + latency: "Latency", seconds: "Seconds", hourTip: "Select Hour", minuteTip: "Select Minute", diff --git a/src/locales/lang/es.ts b/src/locales/lang/es.ts index 7c830e47..3bd081cf 100644 --- a/src/locales/lang/es.ts +++ b/src/locales/lang/es.ts @@ -158,6 +158,7 @@ const msg = { endpointTips: "Aquí, la tabla muestra hasta 20 punto final.", apisix: "APISIX", queryOrder: "Orden de consulta", + latency: "Retraso", seconds: "Segundos", hourTip: "Seleccione Hora", minuteTip: "Seleccione Minuto", diff --git a/src/locales/lang/zh.ts b/src/locales/lang/zh.ts index 9b54385a..de10a25e 100644 --- a/src/locales/lang/zh.ts +++ b/src/locales/lang/zh.ts @@ -158,6 +158,7 @@ const msg = { relatedTraceOptions: "相关的Trace选项", setLatencyDuration: "设置延时范围", queryOrder: "查询顺序", + latency: "延迟", seconds: "秒", hourTip: "选择小时", minuteTip: "选择分钟", diff --git a/src/views/dashboard/related/trace/Filter.vue b/src/views/dashboard/related/trace/Filter.vue index 9ea4fa6e..fd9c369c 100644 --- a/src/views/dashboard/related/trace/Filter.vue +++ b/src/views/dashboard/related/trace/Filter.vue @@ -302,14 +302,6 @@ watch( } traceId.value = props.data.filters.traceId || ""; duration.value = props.data.filters.duration || appStore.durationTime; - // if (props.data.filters.queryOrder) { - // traceStore.setTraceCondition({ - // queryOrder: props.data.filters.queryOrder, - // }); - // } - // if (props.data.filters.status) { - // state.status = filters.status === "ERROR" ? Status[2] : Status[0]; - // } init(); } ); diff --git a/src/views/dashboard/related/trace/Header.vue b/src/views/dashboard/related/trace/Header.vue index f73e0e25..d13e24c8 100644 --- a/src/views/dashboard/related/trace/Header.vue +++ b/src/views/dashboard/related/trace/Header.vue @@ -17,11 +17,11 @@ limitations under the License. --> - {{ item.key }} + {{ t(item.label) }} import { ref, reactive, onUnmounted } from "vue"; import type { PropType } from "vue"; import { useI18n } from "vue-i18n"; -import { Option } from "@/types/app"; +import { Option, DurationTime } from "@/types/app"; import { useTraceStore } from "@/store/modules/trace"; import { useDashboardStore } from "@/store/modules/dashboard"; import { useAppStoreWithOut } from "@/store/modules/app"; @@ -79,13 +79,14 @@ const dashboardStore = useDashboardStore(); const traceStore = useTraceStore(); const tagsList = ref([]); const tagsMap = ref([]); +const duration = ref(filters.duration || appStore.durationTime); const state = reactive({ instance: "", endpoint: "", service: "", }); const conditions = ref(""); -const items = ref<{ key: string; value: string }[]>([]); +const items = ref<{ label: string; value: string }[]>([]); const currentLatency = ref( filters.latency ? filters.latency[0].data : [] ); @@ -97,10 +98,10 @@ async function init() { if (!filters.id) { for (const d of Object.keys(filters)) { if (filters[d] && d !== "duration") { - items.value.push({ key: d, value: FiltersKeys[d] }); + items.value.push({ label: d, value: FiltersKeys[d] }); } } - conditions.value = (items.value[0] && items.value[0].key) || ""; + conditions.value = (items.value[0] && items.value[0].label) || ""; state.service = selectorStore.currentService.id; if (dashboardStore.entity === EntityType[2].value) { state.instance = selectorStore.currentPod.id; @@ -132,6 +133,7 @@ function changeCondition() { function changeLatency(options: any[]) { currentLatency.value = options[0].data; + console.log(options); queryTraces(); } @@ -163,13 +165,16 @@ function setCondition() { let params: any = { traceState: Status[0].value, queryOrder: QueryOrders[0].value, - queryDuration: appStore.durationTime, + queryDuration: duration.value, minTraceDuration: isNaN(currentLatency.value[0]) ? undefined + : currentLatency.value[0] === currentLatency.value[1] + ? currentLatency.value[0] - 10 : currentLatency.value[0], - maxTraceDuration: isNaN(currentLatency.value[1]) - ? undefined - : currentLatency.value[0], + maxTraceDuration: + isNaN(currentLatency.value[1]) || currentLatency.value[1] === Infinity + ? undefined + : currentLatency.value[1], tags: tagsMap.value.length ? tagsMap.value : undefined, paging: { pageNum: 1, pageSize: 20 }, serviceId: state.service || undefined, @@ -179,8 +184,8 @@ function setCondition() { // echarts if (!filters.id) { for (const k of items.value) { - if (k.key === conditions.value && FiltersKeys[k.key]) { - params[k.value] = filters[k.key]; + if (k.label === conditions.value && FiltersKeys[k.label]) { + params[k.value] = filters[k.label]; } } }