Opensearch embed changes

This commit is contained in:
Darren Clarke 2024-11-28 08:27:20 +01:00
parent 130554d86b
commit a8dd53507d
11 changed files with 237 additions and 178 deletions

View file

@ -6,12 +6,12 @@ import { Box } from "@mui/material";
interface OpenSearchWrapperProps {
url: string;
marginTop: string;
margin: number;
}
export const OpenSearchWrapper: FC<OpenSearchWrapperProps> = ({
url,
marginTop,
margin,
}) => (
<Box sx={{ position: "relative", marginTop: "-100px" }}>
<Box
@ -26,15 +26,16 @@ export const OpenSearchWrapper: FC<OpenSearchWrapperProps> = ({
/>
<Box
sx={{
marginTop,
marginTop: `-${margin}px`,
zIndex: 1,
position: "relative",
height: "100vh",
height: `calc(100vh + ${margin}px)`,
}}
>
<Iframe
id="opensearch"
url={`/dashboards/${url}&_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-3y%2Cto%3Anow))`}
url={`/dashboards/${url}`}
// url={`/dashboards/${url}&_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-3y%2Cto%3Anow))`}
width="100%"
height="100%"
frameBorder={0}

View file

@ -28,7 +28,7 @@ export const QueryDateRangeSelector: FC<QueryDateRangeSelectorProps> = () => {
<Select
fullWidth
size="small"
placeholder={t("relativeDate")}
// placeholder={t("relativeDate")}
value={relativeDate}
onChange={(event: any) => {
setStartDate(null);

View file

@ -10,12 +10,6 @@ const userMetadataIndexName = "user_metadata";
// const baseURL = `https://${process.env.OPENSEARCH_USERNAME}:${process.env.OPENSEARCH_ADMIN_PASSWORD}@${process.env.OPENSEARCH_URL}`;
console.log({
url: process.env.OPENSEARCH_URL,
username: process.env.OPENSEARCH_USERNAME,
password: process.env.OPENSEARCH_ADMIN_PASSWORD,
});
const createClient = () =>
new Client({
node: process.env.OPENSEARCH_URL!,