feat: support Tabs in the widget visiable when MQE expressions (#353)

This commit is contained in:
Fine0830
2023-12-20 17:58:00 +08:00
committed by GitHub
parent 0d82507a87
commit 001fa25a3b
26 changed files with 379 additions and 224 deletions

View File

@@ -29,6 +29,7 @@ limitations under the License. -->
import { useAppStoreWithOut } from "@/store/modules/app";
import dateFormatStep, { dateFormatTime } from "@/utils/dateFormat";
import getLocalTime from "@/utils/localtime";
import { WidgetType } from "@/views/dashboard/data";
const eventStore = useEventStore();
/*global defineProps, Nullable */
@@ -122,7 +123,9 @@ limitations under the License. -->
}[],
dashboard: LayoutConfig[],
) {
const widgets = dashboard.filter((d: { type: string }) => ["Trace", "Log"].includes(d.type));
const widgets = dashboard.filter((d: { type: string }) =>
([WidgetType.Trace, WidgetType.Log] as string[]).includes(d.type),
);
const index = items[0];
const i = events[index - 1 || 0];
for (const widget of widgets) {

View File

@@ -41,6 +41,7 @@ limitations under the License. -->
import { useDashboardStore } from "@/store/modules/dashboard";
import type { LayoutConfig } from "@/types/dashboard";
import { dateFormat } from "@/utils/dateFormat";
import { WidgetType } from "@/views/dashboard/data";
/*global defineProps, defineEmits, Recordable */
const props = defineProps({
@@ -78,7 +79,7 @@ limitations under the License. -->
traceId: id,
id: props.data.serviceId || "",
},
"Trace",
WidgetType.Trace,
);
}
</script>

View File

@@ -101,6 +101,7 @@ limitations under the License. -->
import type { LayoutConfig } from "@/types/dashboard";
import { dateFormat } from "@/utils/dateFormat";
import { useAppStoreWithOut } from "@/store/modules/app";
import { WidgetType } from "@/views/dashboard/data";
const props = {
serviceId: { type: String, default: "" },
@@ -145,7 +146,7 @@ limitations under the License. -->
traceId: traceId.value || traceStore.currentTrace.traceIds[0].value,
id: props.serviceId || undefined,
},
"Log",
WidgetType.Log,
);
}
return {