@kui-shell/plugin-kubectl
Version:
Kubernetes visualization plugin for kubernetes
59 lines (58 loc) • 2.01 kB
TypeScript
import React from 'react';
import { KubeContext } from '@kui-shell/plugin-kubectl';
import { ViewLevel, Options as TextWithIconWidgetOptions } from '@kui-shell/plugin-client-common/mdist/components/Client/StatusStripe/TextWithIconWidget';
type Props = TextWithIconWidgetOptions;
interface State {
currentContext: string | null;
allContexts: KubeContext[];
options: {
label: string;
isSelected: boolean;
description: string;
command: string;
}[];
viewLevel: ViewLevel;
}
export declare let ready: boolean;
export default class CurrentContext extends React.PureComponent<Props, State> {
private readonly handler;
private readonly handlerForCommandComplete;
private readonly handlerForConfigChange;
private readonly handlerNotCallingKubectl;
constructor(props: Props);
/** @return e.g. name/uuid -> name; or name:nnnn -> name */
private renderName;
/** So we don't handle events after unmounting */
private _unmounted;
private get unmounted();
private set unmounted(value);
/** Avoid recomputation for a flurry of events */
private last;
private debounce;
private getCurrentContextFromChange;
private options;
private setNoContext;
private reportCurrentContextFromCommandComplete;
private reportCurrentContext;
private getCurrentContextFromTab;
/** @return UI for listing full context table */
private listContext;
/** @return the header for the Popover component */
private popoverHeader;
private switchContext;
/** @return the body for the Popover component */
private popoverBody;
/** @return desired Popover model */
private popover;
private setLoadingMessage;
/**
* Once we have mounted, we immediately check the current branch,
* and schedule an update based on standard REPL events.
*
*/
componentDidMount(): void;
/** Bye! */
componentWillUnmount(): void;
render(): JSX.Element;
}
export {};