UNPKG

@kui-shell/plugin-kubectl

Version:

Kubernetes visualization plugin for kubernetes

46 lines (45 loc) 1.59 kB
import React from 'react'; import { ViewLevel, Options as TextWithIconWidgetOptions } from '@kui-shell/plugin-client-common/mdist/components/Client/StatusStripe/TextWithIconWidget'; type Props = TextWithIconWidgetOptions; interface State { currentNamespace: string | null; allNamespaces: string[]; viewLevel: ViewLevel; } export default class CurrentNamespace extends React.PureComponent<Props, State> { private readonly handler; private readonly handlerForCommandComplete; private readonly handlerNotCallingKubectl; constructor(props: Props); /** @return a short string that we can fit into a context UI widget */ private renderNamespace; /** Avoid recomputation for a flurry of events */ private last; private debounce; private reportCurrentNamespaceFromCommandComplete; private reportCurrentNamespace; private getCurrentNamespaceFromTab; private setLoadingMessage; /** * Once we have mounted, we immediately check the current branch, * and schedule an update based on standard REPL events. * */ componentDidMount(): void; /** So we don't handle events after unmounting */ private _unmounted; private get unmounted(); private set unmounted(value); /** Bye! */ componentWillUnmount(): void; private kubectl; private listNamespace; private popoverHeader; /** @return the options model for the given namespace named `ns` */ private optionFor; private switchNamespace; private popoverBody; private popover; render(): JSX.Element; } export {};