This commit is contained in:
Fine 2022-10-18 15:05:19 +08:00
parent a12d1080b4
commit ecb205d7ac

View File

@ -86,9 +86,10 @@ const items = Object.keys(filters).map((d: string) => {
}); });
const conditions = ref(items[0].key); const conditions = ref(items[0].key);
if (filters.id) { init();
init();
} else { async function init() {
if (!filters.id) {
state.service = selectorStore.currentService.id; state.service = selectorStore.currentService.id;
if (dashboardStore.entity === EntityType[2].value) { if (dashboardStore.entity === EntityType[2].value) {
state.instance = selectorStore.currentPod.id; state.instance = selectorStore.currentPod.id;
@ -96,9 +97,9 @@ if (filters.id) {
if (dashboardStore.entity === EntityType[3].value) { if (dashboardStore.entity === EntityType[3].value) {
state.endpoint = selectorStore.currentPod.id; state.endpoint = selectorStore.currentPod.id;
} }
queryTraces(); await queryTraces();
} return;
async function init() { }
if (dashboardStore.entity === EntityType[1].value) { if (dashboardStore.entity === EntityType[1].value) {
await getService(); await getService();
} }
@ -147,16 +148,12 @@ function setCondition() {
maxTraceDuration: undefined, maxTraceDuration: undefined,
tags: tagsMap.value.length ? tagsMap.value : undefined, tags: tagsMap.value.length ? tagsMap.value : undefined,
paging: { pageNum: 1, pageSize: 20 }, paging: { pageNum: 1, pageSize: 20 },
};
// topList
if (filters.id) {
params = {
...params,
serviceId: state.service || undefined, serviceId: state.service || undefined,
endpointId: state.endpoint || undefined, endpointId: state.endpoint || undefined,
serviceInstanceId: state.instance || undefined, serviceInstanceId: state.instance || undefined,
}; };
} else { // echarts
if (!filters.id) {
for (const k of items) { for (const k of items) {
if (k.key === conditions.value) { if (k.key === conditions.value) {
params[k.value] = filters[k.key]; params[k.value] = filters[k.key];