diff --git a/components/log-viewer-webui/client/src/typings/query.ts b/components/log-viewer-webui/client/src/typings/query.ts index d8ef5e29d..44852890d 100644 --- a/components/log-viewer-webui/client/src/typings/query.ts +++ b/components/log-viewer-webui/client/src/typings/query.ts @@ -1,3 +1,4 @@ + enum QUERY_LOADING_STATE { SUBMITTING = 0, WAITING, @@ -11,12 +12,26 @@ const QUERY_LOADING_STATE_VALUES = Object.freeze( Object.values(QUERY_LOADING_STATE).filter((value) => "number" === typeof value) ); +/** + * Enum of job type, matching the `QueryJobType` class in + * `job_orchestration.query_scheduler.constants`. + * + * @enum {number} + */ enum QUERY_JOB_TYPE { SEARCH_OR_AGGREGATION = 0, EXTRACT_IR, EXTRACT_JSON, } +/** + * Mapping between job type enums and stream type + */ +const EXTRACT_JOB_TYPE = Object.freeze({ + ir: QUERY_JOB_TYPE.EXTRACT_IR, + json: QUERY_JOB_TYPE.EXTRACT_JSON, +}); + interface QueryLoadingStateDescription { label: string; description: string; @@ -43,6 +58,7 @@ const QUERY_LOADING_STATE_DESCRIPTIONS }); export { + EXTRACT_JOB_TYPE, QUERY_JOB_TYPE, QUERY_LOADING_STATE, QUERY_LOADING_STATE_DESCRIPTIONS, diff --git a/components/log-viewer-webui/client/src/ui/QueryStatus.tsx b/components/log-viewer-webui/client/src/ui/QueryStatus.tsx index 1787af399..b6b90aca4 100644 --- a/components/log-viewer-webui/client/src/ui/QueryStatus.tsx +++ b/components/log-viewer-webui/client/src/ui/QueryStatus.tsx @@ -9,20 +9,12 @@ import {isAxiosError} from "axios"; import {submitExtractStreamJob} from "../api/query"; import {Nullable} from "../typings/common"; import { - QUERY_JOB_TYPE, + EXTRACT_JOB_TYPE, QUERY_LOADING_STATE, } from "../typings/query"; import Loading from "./Loading"; -/** - * Mapping between job type enums and stream type - */ -const EXTRACT_JOB_TYPE = Object.freeze({ - ir: QUERY_JOB_TYPE.EXTRACT_IR, - json: QUERY_JOB_TYPE.EXTRACT_JSON, -}); - /** * Submits queries and renders the query states. *