diff --git a/src/store/modules/log.ts b/src/store/modules/log.ts index 9e24fa32..2bb56ea5 100644 --- a/src/store/modules/log.ts +++ b/src/store/modules/log.ts @@ -21,6 +21,7 @@ import graphql from "@/graphql"; import { useAppStoreWithOut } from "@/store/modules/app"; import { useSelectorStore } from "@/store/modules/selectors"; import { useDashboardStore } from "@/store/modules/dashboard"; +import { useDuration } from "@/hooks/useDuration"; import { EndpointsTopNDefault } from "../data"; interface LogState { @@ -33,6 +34,7 @@ interface LogState { logs: Recordable[]; loadLogs: boolean; } +const { getDurationTime } = useDuration(); export const logStore = defineStore({ id: "log", @@ -41,7 +43,7 @@ export const logStore = defineStore({ instances: [{ value: "0", label: "All" }], endpoints: [{ value: "0", label: "All" }], conditions: { - queryDuration: useAppStoreWithOut().durationTime, + queryDuration: getDurationTime(), paging: { pageNum: 1, pageSize: 15 }, }, supportQueryLogsByKeywords: true, @@ -56,7 +58,7 @@ export const logStore = defineStore({ resetState() { this.logs = []; this.conditions = { - queryDuration: useAppStoreWithOut().durationTime, + queryDuration: getDurationTime(), paging: { pageNum: 1, pageSize: 15 }, }; }, diff --git a/src/types/dashboard.d.ts b/src/types/dashboard.d.ts index e89740a6..acd07815 100644 --- a/src/types/dashboard.d.ts +++ b/src/types/dashboard.d.ts @@ -60,10 +60,7 @@ export type Filters = { dataIndex: number; sourceId: string; isRange?: boolean; - duration?: { - startTime: string; - endTime: string; - }; + duration?: DurationTime; traceId?: string; spanId?: string; segmentId?: string; diff --git a/src/views/dashboard/related/log/Header.vue b/src/views/dashboard/related/log/Header.vue index 9f256e80..856b366b 100644 --- a/src/views/dashboard/related/log/Header.vue +++ b/src/views/dashboard/related/log/Header.vue @@ -56,6 +56,16 @@ limitations under the License. --> @change="changeField('category', $event)" /> +
+ {{ t("timeRange") }}: + +
{{ t("search") }} @@ -119,20 +129,21 @@ limitations under the License. -->