Skip to content

Commit b51bfc4

Browse files
committed
feat: change terminal to support *above* terminal rather than *below* terminal component
1 parent 28af9e7 commit b51bfc4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: plugins/plugin-codeflare/src/controller/terminal.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ export type Props = Pick<BaseProps, "tab" | "REPL" | "onExit" | "searchable" | "
6767
/** Callback when user selects a profile */
6868
onSelectProfile?(profile: string, profiles?: import("madwizard").Profiles.Profile[]): void
6969

70-
/** Content to place below the terminal */
71-
belowTerminal?: React.ReactNode
70+
/** Content to place above the terminal */
71+
aboveTerminal?: React.ReactNode
7272
}
7373

7474
type State = Partial<Pick<BaseProps, "cmdline" | "env">> & {
@@ -95,8 +95,8 @@ export class TaskTerminal extends React.PureComponent<Props, State> {
9595
/** Allotment initial split ... allotments */
9696
private readonly splits = {
9797
horizontal: [25, 75],
98-
vertical1: [100], // no `this.props.belowTerminal`
99-
vertical2: [40, 60], // yes
98+
vertical1: [100], // no `this.props.aboveTerminal`
99+
vertical2: [60, 40], // yes
100100
}
101101

102102
private readonly tasks = [{ label: "Run a Job", argv: ["codeflare", "-p", "${SELECTED_PROFILE}"] }]
@@ -203,9 +203,10 @@ export class TaskTerminal extends React.PureComponent<Props, State> {
203203
) : (
204204
<Allotment
205205
vertical
206-
defaultSizes={!this.props.belowTerminal ? this.splits.vertical1 : this.splits.vertical2}
206+
defaultSizes={!this.props.aboveTerminal ? this.splits.vertical1 : this.splits.vertical2}
207207
snap
208208
>
209+
{this.props.aboveTerminal && <AllotmentFillPane>{this.props.aboveTerminal}</AllotmentFillPane>}
209210
<AllotmentFillPane>
210211
<SelectedProfileTerminal
211212
key={this.state.initCount + "_" + this.state.cmdline + "-" + this.state.selectedProfile}
@@ -215,7 +216,6 @@ export class TaskTerminal extends React.PureComponent<Props, State> {
215216
selectedProfile={this.state.selectedProfile}
216217
/>
217218
</AllotmentFillPane>
218-
{this.props.belowTerminal && <AllotmentFillPane>{this.props.belowTerminal}</AllotmentFillPane>}
219219
</Allotment>
220220
)}
221221
</AllotmentFillPane>

0 commit comments

Comments
 (0)