Skip to content

Commit

Permalink
Add temporary caraml ai mockup ui
Browse files Browse the repository at this point in the history
  • Loading branch information
deadlycoconuts committed Jul 19, 2024
1 parent 69de678 commit 49dbeac
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
8 changes: 8 additions & 0 deletions ui/packages/app/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Route, Routes } from "react-router-dom";
import AppRoutes from "./AppRoutes";
import { PrivateLayout } from "./PrivateLayout";
import config from "./config";
import { CaraMLAIPage } from "./caraml_ai/CaraMLAIPage";

const App = () => (
<EuiProvider>
Expand All @@ -29,6 +30,13 @@ const App = () => (
</Route>

<Route path="/pages/404" element={<Page404 />} />

{
config.CARAML_AI_STREAMLIT_HOMEPAGE &&
<Route element={<PrivateLayout />}>
<Route path="/caraml-ai" element={<CaraMLAIPage />} />
</Route>
}
</Routes>
<Toast />
</AuthProvider>
Expand Down
24 changes: 24 additions & 0 deletions ui/packages/app/src/caraml_ai/CaraMLAIPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from "react";
import { EuiPageTemplate } from "@elastic/eui";
import config from "./../config";

export const CaraMLAIPage = () => {
const iframe = `<iframe src=${config.CARAML_AI_STREAMLIT_HOMEPAGE} style="height: 80vh; width: 100%;"></iframe>`

function Iframe(props) {
return (<div dangerouslySetInnerHTML={ {__html: props.iframe?props.iframe:""}} />);
}
return (
<EuiPageTemplate restrictWidth="90%" panelled={false}>
<EuiPageTemplate.Header
bottomBorder={false}
iconType="timelionApp"
pageTitle="CaraML AI"
/>

<EuiPageTemplate.Section paddingSize="none">
<Iframe iframe={iframe} />
</EuiPageTemplate.Section>
</EuiPageTemplate>
);
};
2 changes: 1 addition & 1 deletion ui/packages/app/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const config = {
MAX_AUTHZ_CACHE_EXPIRY_MINUTES: parseInt(
getEnv("REACT_APP_MAX_AUTHZ_CACHE_EXPIRY_MINUTES") || "0"
),

CLOCKWORK_UI_HOMEPAGE: getEnv("REACT_APP_CLOCKWORK_UI_HOMEPAGE"),
KUBEFLOW_UI_HOMEPAGE: getEnv("REACT_APP_KUBEFLOW_UI_HOMEPAGE"),
CARAML_AI_STREAMLIT_HOMEPAGE: getEnv("REACT_APP_CARAML_AI_STREAMLIT_HOMEPAGE"),
ALLOW_CUSTOM_STREAM:
getEnv("REACT_APP_ALLOW_CUSTOM_STREAM") != null
? getEnv("REACT_APP_ALLOW_CUSTOM_STREAM")
Expand Down
5 changes: 2 additions & 3 deletions ui/packages/lib/src/components/nav_drawer/NavDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,12 @@ export const NavDrawer = ({ docLinks }) => {
className: isAppActive
? "euiTreeView__node---small---active"
: "euiTreeView__node---small",

callback: () =>
!children || !currentProject
a.is_project_agnostic ? (window.location.href = a.homepage) : (!children || !currentProject
? (window.location.href = !!currentProject
? urlJoin(a.homepage, "projects", currentProject.id)
: a.homepage)
: {},
: {}),
children: children
};
});
Expand Down

0 comments on commit 49dbeac

Please sign in to comment.