Skip to content

Commit

Permalink
Add cloud context
Browse files Browse the repository at this point in the history
  • Loading branch information
efegurkan committed Aug 25, 2023
1 parent e4f0146 commit efd0ef6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { FormattedMessage } from '@kbn/i18n-react';

import { ConnectorStatus } from '../../../../../../common/types/connectors';
import { BetaConnectorCallout } from '../../../../shared/beta/beta_connector_callout';
import { useCloudDetails } from '../../../../shared/cloud_details/cloud_details';
import { docLinks } from '../../../../shared/doc_links';
import { generateEncodedPath } from '../../../../shared/encode_path_params';
import { EuiButtonTo, EuiLinkTo } from '../../../../shared/react_router_helpers';
Expand All @@ -53,6 +54,8 @@ export const ConnectorConfiguration: React.FC = () => {
const { index, recheckIndexLoading } = useValues(IndexViewLogic);
const { indexName } = useValues(IndexNameLogic);
const { recheckIndex } = useActions(IndexViewLogic);
const cloudContext = useCloudDetails();

if (!isConnectorIndex(index)) {
return <></>;
}
Expand Down Expand Up @@ -157,6 +160,7 @@ export const ConnectorConfiguration: React.FC = () => {
id: index.connector.id,
service_type: index.connector.service_type,
},
host: cloudContext.elasticsearchUrl,
})}
</EuiCodeBlock>
<EuiSpacer />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,14 @@ export const BETA_CONNECTORS = CONNECTORS.filter(({ isBeta }) => isBeta);
export const getConnectorTemplate = ({
apiKeyData,
connectorData,
host,
}: {
apiKeyData: ApiKey | undefined;
connectorData: {
id: string;
service_type: string | null;
};
host?: string;
}) => dedent`connectors:
-
connector_id: "${connectorData.id}"
Expand All @@ -187,6 +189,6 @@ export const getConnectorTemplate = ({
}
elasticsearch:
host: "https://locahost:9200",
host: "${host || 'https://locahost:9200'}"
api_key: "${apiKeyData?.encoded || ''}"
`;

0 comments on commit efd0ef6

Please sign in to comment.