@@ -31,6 +31,7 @@ interface EventState {
3131 torchEvents : TorchEvent [ ]
3232}
3333
34+ /** State for the `<Events/>` component */
3435type State = EventState & {
3536 /** Total number of Kubernetes events */
3637 nKubeEvents : number
@@ -48,6 +49,7 @@ type State = EventState & {
4849 catastrophicError ?: Error
4950}
5051
52+ /** Props for the `<Events/>` component */
5153type Props = EventState & {
5254 /** Follow kube events? */
5355 onKube ?( eventType : "data" , cb : ( data : any ) => void ) : void
@@ -61,7 +63,11 @@ type Props = EventState & {
6163
6264/**
6365 * This component manages the `Event` state for the events UI. It uses
64- * the `Grid` component to render the UI.
66+ * the `<Grid/>` component to render the UI, and requires a controller
67+ * (see below) to feed it an initial set of parsed `Event` objects,
68+ * and a stream of unparsed log lines. (why unparsed for the streaming
69+ * case? because some kinds of events require some recent
70+ * history/context in order to be meaningfully parsed).
6571 *
6672 */
6773class Events extends React . PureComponent < Props , State > {
@@ -170,6 +176,12 @@ class Events extends React.PureComponent<Props, State> {
170176 }
171177}
172178
179+ /**
180+ * Controller portion of the events UI. It will set up the data
181+ * streams, and feed parsed events to the `<Events/>` component. That
182+ * component will manage the state of the events, and in turn pass off
183+ * to the `<Grid/>` component for final rendering.
184+ */
173185async function eventsUI ( filepath : string , REPL : Arguments [ "REPL" ] ) {
174186 const jobFilepath = join ( expand ( filepath ) , "logs/job.txt" )
175187 const kubeFilepath = join ( expand ( filepath ) , "events/kubernetes.txt" )
0 commit comments