fix: trace associate with log

This commit is contained in:
Fine 2023-02-07 18:06:07 +08:00
parent 1768a1641c
commit dfb1874454
4 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import { dashboardStore } from "./../store/modules/dashboard";
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -15,9 +16,11 @@
* limitations under the License.
*/
import { useAppStoreWithOut } from "@/store/modules/app";
import { useDashboardStore } from "@/store/modules/dashboard";
import dateFormatStep from "@/utils/dateFormat";
import getLocalTime from "@/utils/localtime";
import type { EventParams } from "@/types/app";
import type { LayoutConfig } from "@/types/dashboard";
export default function associateProcessor(props: any) {
function eventAssociate() {
@ -115,5 +118,13 @@ export default function associateProcessor(props: any) {
item.metricValue = value;
return item;
}
return { eventAssociate, traceFilters };
function removeAssociationFilters(config: LayoutConfig) {
const dashboardStore = useDashboardStore();
if (!config.filters) {
return;
}
delete config.filters;
dashboardStore.setWidget(config);
}
return { eventAssociate, traceFilters, removeAssociationFilters };
}

View File

@ -129,6 +129,7 @@ limitations under the License. -->
import { ErrorCategory } from "./data";
import type { LayoutConfig } from "@/types/dashboard";
import type { DurationTime } from "@/types/app";
import removeAssociationFilters from "@/hooks/useAssociateProcessor";
/*global defineProps, Recordable */
const props = defineProps({
@ -319,6 +320,7 @@ limitations under the License. -->
}
onUnmounted(() => {
logStore.resetState();
removeAssociationFilters(props.data);
});
watch(
() => selectorStore.currentService,

View File

@ -89,6 +89,7 @@ limitations under the License. -->
import { ElMessage } from "element-plus";
import { EntityType, QueryOrders, Status } from "../../data";
import type { LayoutConfig } from "@/types/dashboard";
import removeAssociationFilters from "@/hooks/useAssociateProcessor";
/*global defineProps, Recordable */
const props = defineProps({
@ -245,6 +246,7 @@ limitations under the License. -->
}
onUnmounted(() => {
traceStore.resetState();
removeAssociationFilters(props.data);
});
watch(
() => [selectorStore.currentPod],

View File

@ -86,6 +86,7 @@ limitations under the License. -->
import { ElMessage } from "element-plus";
import { EntityType, QueryOrders, Status } from "../../data";
import type { LayoutConfig } from "@/types/dashboard";
import removeAssociationFilters from "@/hooks/useAssociateProcessor";
const FiltersKeys: { [key: string]: string } = {
status: "traceState",
@ -229,6 +230,7 @@ limitations under the License. -->
}
onUnmounted(() => {
traceStore.resetState();
removeAssociationFilters(props.data);
});
</script>
<style lang="scss" scoped>