-
Notifications
You must be signed in to change notification settings - Fork 448
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI: Select namespace from Kubeflow dashboard (#982)
* Init commit * Add namespace check in Experiments monitor Submit yaml Submit experiment by parameters * Add redirect to home page when changing namespace * Remove redirect * Fix namespace filter * Change key to index and let to const
- Loading branch information
1 parent
685c0a3
commit 59a4880
Showing
14 changed files
with
295 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
pkg/ui/v1alpha3/frontend/src/components/KubeflowDashboard.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from 'react'; | ||
import {CHANGE_GLOBAL_NAMESPACE} from '../actions/generalActions'; | ||
import generalReducer from '../reducers/general'; | ||
|
||
// TODO: Think about better way of update namespace | ||
// Right now, after updating namespace in select list | ||
// user must go to Kubeflow dashboard home page to update Global Namespace in Katib UI | ||
function onGlobalNamespaceChange(namespace) { | ||
generalReducer(undefined, {type: CHANGE_GLOBAL_NAMESPACE, globalNamespace: namespace}) | ||
} | ||
|
||
class KubeflowDashboard extends React.Component { | ||
|
||
componentDidMount() { | ||
window.addEventListener('DOMContentLoaded', function (event) { | ||
if (window.centraldashboard && window.centraldashboard.CentralDashboardEventHandler) { | ||
// Init method will invoke the callback with the event handler instance | ||
// and a boolean indicating whether the page is iframed or not | ||
window.centraldashboard.CentralDashboardEventHandler.init(function (cdeh) { | ||
// Binds a callback that gets invoked anytime the Dashboard's | ||
// namespace is changed | ||
cdeh.onNamespaceSelected = (namespace) => { | ||
onGlobalNamespaceChange(namespace) | ||
} | ||
}); | ||
} | ||
}); | ||
} | ||
|
||
render () { | ||
return ( | ||
<div/> | ||
) | ||
} | ||
} | ||
|
||
|
||
export default KubeflowDashboard; |
Oops, something went wrong.