This commit is contained in:
Fine 2022-10-24 11:18:19 +08:00
parent cd1d765fae
commit 212625862a
5 changed files with 21 additions and 21 deletions

View File

@ -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",

View File

@ -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",

View File

@ -158,6 +158,7 @@ const msg = {
relatedTraceOptions: "相关的Trace选项",
setLatencyDuration: "设置延时范围",
queryOrder: "查询顺序",
latency: "延迟",
seconds: "秒",
hourTip: "选择小时",
minuteTip: "选择分钟",

View File

@ -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();
}
);

View File

@ -17,11 +17,11 @@ limitations under the License. -->
<el-radio-group v-model="conditions" @change="changeCondition">
<el-radio-button
v-for="(item, index) in items"
:label="item.key"
:key="item.key + index"
:label="item.label"
:key="item.label + index"
border
>
{{ item.key }}
{{ t(item.label) }}
</el-radio-button>
</el-radio-group>
<Selector
@ -46,7 +46,7 @@ limitations under the License. -->
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<string[]>([]);
const tagsMap = ref<Option[]>([]);
const duration = ref<DurationTime>(filters.duration || appStore.durationTime);
const state = reactive<Recordable>({
instance: "",
endpoint: "",
service: "",
});
const conditions = ref<string>("");
const items = ref<{ key: string; value: string }[]>([]);
const items = ref<{ label: string; value: string }[]>([]);
const currentLatency = ref<number[]>(
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];
}
}
}