feat: reset service

This commit is contained in:
Fine 2024-01-29 22:18:46 +08:00
parent 7e19a751d6
commit e21c65b65f
3 changed files with 17 additions and 4 deletions

View File

@ -150,7 +150,13 @@ limitations under the License. -->
ElMessage.error(resp.errors); ElMessage.error(resp.errors);
return; return;
} }
state.service = getCurrentNode(traceStore.services) || traceStore.services[0]; if (props.data.filters && props.data.filters.id === "0") {
state.service = { value: "", label: "" };
return;
} else {
state.service = getCurrentNode(traceStore.services) || traceStore.services[0];
}
emits("get", state.service.id); emits("get", state.service.id);
getEndpoints(state.service.id); getEndpoints(state.service.id);

View File

@ -81,7 +81,6 @@ limitations under the License. -->
showDetail.value = true; showDetail.value = true;
} }
function traverseTree(node: Recordable, spanId: string, segmentId: string, data: Recordable) { function traverseTree(node: Recordable, spanId: string, segmentId: string, data: Recordable) {
console.log(data);
if (!node || node.isBroken) { if (!node || node.isBroken) {
return; return;
} }

View File

@ -45,7 +45,11 @@ limitations under the License. -->
<h5 class="mb-10" v-if="diffRefs.length"> {{ t("traceID") }}. </h5> <h5 class="mb-10" v-if="diffRefs.length"> {{ t("traceID") }}. </h5>
<div class="mb-10 clear item" v-for="(item, index) in diffRefs" :key="item.traceId"> <div class="mb-10 clear item" v-for="(item, index) in diffRefs" :key="item.traceId">
<span class="g-sm-4 grey">No.{{ index + 1 }}</span> <span class="g-sm-4 grey">No.{{ index + 1 }}</span>
<span class="g-sm-8 wba link cp" @click="viewRelateTrace(item)"> <span
class="g-sm-8 wba cp"
:class="dashboardStore.entity === EntityType[1].value ? 'link' : ''"
@click="viewRelateTrace(item)"
>
{{ item.traceId }} {{ item.traceId }}
</span> </span>
</div> </div>
@ -149,6 +153,7 @@ limitations under the License. -->
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
import { WidgetType } from "@/views/dashboard/data"; import { WidgetType } from "@/views/dashboard/data";
import type { LayoutConfig } from "@/types/dashboard"; import type { LayoutConfig } from "@/types/dashboard";
import { EntityType } from "@/views/dashboard/data";
/*global defineProps, Nullable, Recordable */ /*global defineProps, Nullable, Recordable */
const props = defineProps({ const props = defineProps({
@ -234,12 +239,16 @@ limitations under the License. -->
} }
function viewRelateTrace(item: Recordable) { function viewRelateTrace(item: Recordable) {
if (dashboardStore.entity !== EntityType[1].value) {
return;
}
const { associationWidget } = getDashboard(dashboardStore.currentDashboard); const { associationWidget } = getDashboard(dashboardStore.currentDashboard);
associationWidget( associationWidget(
(options.id as any) || "", (options.id as any) || "",
{ {
sourceId: options.id || "", sourceId: options.id || "",
traceId: item.traceId, traceId: item.traceId,
id: "0",
}, },
WidgetType.Trace, WidgetType.Trace,
); );
@ -293,7 +302,6 @@ limitations under the License. -->
} }
.link { .link {
color: var(--el-color-primary);
text-decoration: underline; text-decoration: underline;
} }
</style> </style>