How to use the argo-ui.Utils.toObservable function in argo-ui

To help you get started, we’ve selected a few argo-ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github argoproj / argo-cd / ui / src / app / shared / components / page / page.tsx View on Github external
export const AddAuthToToolbar = (init: Toolbar | Observable, ctx: ContextApis): Observable => {
    return Utils.toObservable(init).map(toolbar => {
        toolbar = toolbar || {};
        toolbar.tools = [
            toolbar.tools,
             isLoggedIn()}>
                {loggedIn =>
                    loggedIn ? (
                        <button> (window.location.href = requests.toAbsURL('/auth/logout'))}&gt;
                            Log out
                        </button>
                    ) : (
                        <button> ctx.navigation.goto(`/login?return_url=${encodeURIComponent(location.href)}`)}&gt;
                            Log in
                        </button>
                    )
                }