diff --git a/common/constants/data_sources.ts b/common/constants/data_sources.ts index 931f1f729..791851662 100644 --- a/common/constants/data_sources.ts +++ b/common/constants/data_sources.ts @@ -5,6 +5,8 @@ export const DATA_SOURCE_NAME_URL_PARAM_KEY = 'datasourceName'; export const DATA_SOURCE_TYPE_URL_PARAM_KEY = 'datasourceType'; +export const OLLY_QUESTION_URL_PARAM_KEY = 'olly_q'; +export const INDEX_URL_PARAM_KEY = 'indexPattern'; export const DEFAULT_DATA_SOURCE_TYPE = 'DEFAULT_INDEX_PATTERNS'; export const DEFAULT_DATA_SOURCE_NAME = 'Default cluster'; export const DEFAULT_DATA_SOURCE_OBSERVABILITY_DISPLAY_NAME = 'OpenSearch'; diff --git a/common/constants/explorer.ts b/common/constants/explorer.ts index 187d5d40c..d94957c3e 100644 --- a/common/constants/explorer.ts +++ b/common/constants/explorer.ts @@ -18,6 +18,7 @@ export const RAW_QUERY = 'rawQuery'; export const FINAL_QUERY = 'finalQuery'; export const SELECTED_DATE_RANGE = 'selectedDateRange'; export const INDEX = 'index'; +export const OLLY_QUERY_ASSISTANT = 'ollyQueryAssistant'; export const SELECTED_PATTERN_FIELD = 'selectedPatternField'; export const PATTERN_REGEX = 'patternRegex'; export const FILTERED_PATTERN = 'filteredPattern'; diff --git a/common/constants/query_assist.ts b/common/constants/query_assist.ts new file mode 100644 index 000000000..04b38c129 --- /dev/null +++ b/common/constants/query_assist.ts @@ -0,0 +1,12 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +const QUERY_ASSIST_API_PREFIX = '/api/observability/query_assist'; +export const QUERY_ASSIST_API = { + GENERATE_PPL: `${QUERY_ASSIST_API_PREFIX}/generate_ppl`, + SUMMARIZE: `${QUERY_ASSIST_API_PREFIX}/summarize`, +}; + +export const ML_COMMONS_API_PREFIX = '/_plugins/_ml'; diff --git a/common/constants/shared.ts b/common/constants/shared.ts index 9baffcf10..63437dcfa 100644 --- a/common/constants/shared.ts +++ b/common/constants/shared.ts @@ -256,3 +256,7 @@ export const S3_DATASOURCE_TYPE = 'S3_DATASOURCE'; export const ASYNC_QUERY_SESSION_ID = 'async-query-session-id'; export const DIRECT_DUMMY_QUERY = 'select 1'; + +export const DEFAULT_START_TIME = 'now-15m'; +export const QUERY_ASSIST_START_TIME = 'now-40y'; +export const QUERY_ASSIST_END_TIME = 'now'; diff --git a/opensearch_dashboards.json b/opensearch_dashboards.json index 98de7b088..1c41f1eac 100644 --- a/opensearch_dashboards.json +++ b/opensearch_dashboards.json @@ -18,8 +18,6 @@ "urlForwarding", "visualizations" ], - "optionalPlugins": [ - "managementOverview", - "assistantDashboards" - ] -} \ No newline at end of file + "optionalPlugins": ["managementOverview", "assistantDashboards"], + "configPath": ["observability"] +} diff --git a/public/.DS_Store b/public/.DS_Store deleted file mode 100644 index dbd07c1a1..000000000 Binary files a/public/.DS_Store and /dev/null differ diff --git a/public/components/common/live_tail/live_tail_button.tsx b/public/components/common/live_tail/live_tail_button.tsx index 0e53152fa..66bb91591 100644 --- a/public/components/common/live_tail/live_tail_button.tsx +++ b/public/components/common/live_tail/live_tail_button.tsx @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache-2.0 */ -//Define pop over interval options for live tail button in your plugin +// Define pop over interval options for live tail button in your plugin -import { EuiButton } from "@elastic/eui"; -import React, { useMemo } from "react"; -import { LiveTailProps } from "common/types/explorer"; +import { EuiButton } from '@elastic/eui'; +import React, { useMemo } from 'react'; +import { LiveTailProps } from 'common/types/explorer'; -//Live Tail Button +// Live Tail Button export const LiveTailButton = ({ isLiveTailOn, isLiveTailPopoverOpen, @@ -20,7 +20,7 @@ export const LiveTailButton = ({ const liveButton = useMemo(() => { return ( setIsLiveTailPopoverOpen(!isLiveTailPopoverOpen)} data-test-subj={dataTestSubj} diff --git a/public/components/common/search/__tests__/__snapshots__/search.test.tsx.snap b/public/components/common/search/__tests__/__snapshots__/search.test.tsx.snap index 4e2dfbde7..eb6a831c6 100644 --- a/public/components/common/search/__tests__/__snapshots__/search.test.tsx.snap +++ b/public/components/common/search/__tests__/__snapshots__/search.test.tsx.snap @@ -12,914 +12,1120 @@ exports[`Explorer Search component renders basic component 1`] = ` } } > - +
- +
- - PPL - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="smallContextMenuExample" - isOpen={false} - ownFocus={true} - panelPaddingSize="none" +
-
- - + PPL + , + "value": "PPL", + }, + Object { + "inputDisplay": + DQL + , + "value": "DQL", + }, + ] + } + valueOfSelected="PPL" + > + + PPL + , + "value": "PPL", + }, + Object { + "inputDisplay": + DQL + , + "value": "DQL", + }, + ] + } + value="PPL" + /> + } + isOpen={false} + panelPaddingSize="none" + > + + [Function] + + } + buttonRef={[Function]} + className="euiInputPopover euiSuperSelect" + closePopover={[Function]} + display="block" + hasArrow={true} + isOpen={false} + ownFocus={false} + panelPaddingSize="none" + panelRef={[Function]} + > + +
+
+ +
+ + PPL + , + "value": "PPL", + }, + Object { + "inputDisplay": + DQL + , + "value": "DQL", + }, + ] + } + value="PPL" + > + + +
+
+ + + + PPL + , + } + } + > + + PPL + + } + > + Select an option: + +
+ PPL +
+
+ , is selected +
+
+
+
+ + +
+ + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + +
+ - - - -
-
-
-
-
- -
- -
- + + + +
+ + - -