@@ -31,6 +31,7 @@ interface EventState {
31
31
torchEvents : TorchEvent [ ]
32
32
}
33
33
34
+ /** State for the `<Events/>` component */
34
35
type State = EventState & {
35
36
/** Total number of Kubernetes events */
36
37
nKubeEvents : number
@@ -48,6 +49,7 @@ type State = EventState & {
48
49
catastrophicError ?: Error
49
50
}
50
51
52
+ /** Props for the `<Events/>` component */
51
53
type Props = EventState & {
52
54
/** Follow kube events? */
53
55
onKube ?( eventType : "data" , cb : ( data : any ) => void ) : void
@@ -61,7 +63,11 @@ type Props = EventState & {
61
63
62
64
/**
63
65
* 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).
65
71
*
66
72
*/
67
73
class Events extends React . PureComponent < Props , State > {
@@ -170,6 +176,12 @@ class Events extends React.PureComponent<Props, State> {
170
176
}
171
177
}
172
178
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
+ */
173
185
async function eventsUI ( filepath : string , REPL : Arguments [ "REPL" ] ) {
174
186
const jobFilepath = join ( expand ( filepath ) , "logs/job.txt" )
175
187
const kubeFilepath = join ( expand ( filepath ) , "events/kubernetes.txt" )
0 commit comments