Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dashboard/origin-mlx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export REACT_APP_API="localhost:8080"
export REACT_APP_RUN="false"
export REACT_APP_UPLOAD="true"
export REACT_APP_DISABLE_LOGIN="true"
export REACT_APP_KFP_STANDALONE="true" # KFP is standalone deployment or not
export REACT_APP_TTL="0" # Disable the cache
export REACT_APP_CACHE_INTERVAL="0" # Ignore checking cache
```
Expand Down Expand Up @@ -173,6 +174,7 @@ There are a few environment variables that can be defined that dictate how MLX i
http://<ip_address>:<port>/<basepath>)
* `REACT_APP_BRAND` - The brand name to use on the website
* `REACT_APP_DISABLE_LOGIN` - A switch to turn off login mechanism
* `REACT_APP_KFP_STANDALONE` - The KFP is standalone deployment or not
* `REACT_APP_TTL` - The amount of seconds a cached entry remains valid for (24 hours by default)
* `REACT_APP_CACHE_INTERVAL` - The minimum amount of time in seconds between two checks on the validity of the cache's contents (24 hours by default)

Expand Down
17 changes: 10 additions & 7 deletions dashboard/origin-mlx/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const isAdmin = hasRole(getUserInfo(), 'admin');
function App() {

var prefix = process.env.REACT_APP_BASE_PATH || ""
var kfpStandalone = process.env.REACT_APP_KFP_STANDALONE === 'true'

// Removes the stored path if the user navigated away from the /experiments page
if (!window.location.pathname.substring(0, prefix.length+12).includes(prefix + "/experiments"))
Expand All @@ -63,13 +64,15 @@ function App() {
const { data, origin } = event;
switch (data.type) {
case 'iframe-connected':
['iframe', 'iframe-run'].forEach((id) => {
const element = document.getElementById(id) as HTMLIFrameElement;
if (element) {
// TODO: get namespace from user info, use fixed value: mlx for now
element.contentWindow.postMessage({type: 'namespace-selected', value: 'mlx'}, origin);
}
})
if (!kfpStandalone) {
['iframe', 'iframe-run'].forEach((id) => {
const element = document.getElementById(id) as HTMLIFrameElement;
if (element) {
// TODO: get namespace from user info, use fixed value: mlx for now
element.contentWindow.postMessage({type: 'namespace-selected', value: 'mlx'}, origin);
}
})
}
break;
}
});
Expand Down