fix: set the step to SECOND in the duration for Log/Trace/Alarm/Tag (#537)

This commit is contained in:
Fine0830
2026-03-30 12:36:59 +08:00
committed by GitHub
parent 370bfbc87d
commit 431bcc0891
5 changed files with 21 additions and 13 deletions

View File

@@ -105,6 +105,7 @@ limitations under the License. -->
import { EntityType, QueryOrders, Status } from "@/views/dashboard/data";
import type { LayoutConfig, FilterDuration } from "@/types/dashboard";
import { useDuration } from "@/hooks/useDuration";
import { TimeType } from "@/constants/data";
/*global defineProps, defineEmits, Recordable */
const emits = defineEmits(["get", "search"]);
@@ -126,7 +127,7 @@ limitations under the License. -->
const { duration: filtersDuration } = filters.value;
const duration = ref<DurationTime | FilterDuration>(
filtersDuration
? { start: filtersDuration.startTime || "", end: filtersDuration.endTime || "", step: filtersDuration.step || "" }
? { start: filtersDuration.startTime || "", end: filtersDuration.endTime || "", step: TimeType.SECOND_TIME }
: getDurationTime(),
);
const minTraceDuration = ref<number>();
@@ -152,7 +153,6 @@ limitations under the License. -->
}
async function init() {
duration.value = filters.value.duration || appStore.durationTime;
if (dashboardStore.entity === EntityType[1].value) {
await getServices();
}
@@ -335,7 +335,7 @@ limitations under the License. -->
? {
start: filtersDuration.startTime || "",
end: filtersDuration.endTime || "",
step: filtersDuration.step || "",
step: TimeType.SECOND_TIME,
}
: getDurationTime();
init();

View File

@@ -93,6 +93,8 @@ limitations under the License. -->
import { ElMessage } from "element-plus";
import { EntityType, QueryOrders, Status } from "@/views/dashboard/data";
import type { LayoutConfig } from "@/types/dashboard";
import { TimeType } from "@/constants/data";
import { useDuration } from "@/hooks/useDuration";
const FiltersKeys: { [key: string]: string } = {
status: "traceState",
@@ -130,10 +132,11 @@ limitations under the License. -->
const tagsMap = ref<Option[]>([]);
const traceId = ref<string>(filters.refId || "");
const { duration: filtersDuration } = props.data.filters || {};
const { getDurationTime } = useDuration();
const duration = ref<DurationTime>(
filtersDuration
? { start: filtersDuration.startTime || "", end: filtersDuration.endTime || "", step: filtersDuration.step || "" }
: appStore.durationTime,
? { start: filtersDuration.startTime || "", end: filtersDuration.endTime || "", step: TimeType.SECOND_TIME }
: getDurationTime(),
);
const state = reactive<Recordable>({
instance: "",