@kinvolk/headlamp-plugin
Version:
The needed infrastructure for building Headlamp plugins.
60 lines (59 loc) • 1.69 kB
TypeScript
import React from 'react';
interface Cluster {
name: string;
cluster: {
server: string;
[key: string]: any;
};
}
interface User {
name: string;
user: {
token: string;
[key: string]: any;
};
}
interface kubeconfig {
clusters: Cluster[];
users: User[];
contexts: {
name: string;
context: {
cluster: string;
user: string;
};
}[];
currentContext: string;
}
export declare enum Step {
LoadKubeConfig = 0,
SelectClusters = 1,
ValidateKubeConfig = 2,
ConfigureClusters = 3,
Success = 4
}
export interface PureKubeConfigLoaderProps {
/** The current step in the loading process */
step: Step;
/** Error message to display */
error?: string;
/** The parsed kubeconfig file content */
fileContent: kubeconfig;
/** List of selected cluster names */
selectedClusters: string[];
/** Callback for when a file is dropped or chosen */
onDrop: (acceptedFiles: File[]) => void;
/** Callback for checkbox changes in cluster selection */
onCheckboxChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
/** Callback for 'Next' button */
onNext: () => void;
/** Callback for 'Back' button */
onBack: () => void;
/** Callback for 'Finish' button */
onFinish: () => void;
/** Callback for 'Cancel/Back' button in initial step */
onCancel: () => void;
}
export declare function PureKubeConfigLoader(props: PureKubeConfigLoaderProps): import("react/jsx-runtime").JSX.Element;
declare function KubeConfigLoader(): import("react/jsx-runtime").JSX.Element;
export default KubeConfigLoader;