Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/Components/Diagram/ComponentNodeWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ export class ComponentNodeWidget extends React.Component<ComponentNodeWidgetProp
private hasDownload:boolean;
private hasWebsite:boolean;

private hasTerminal:boolean;

private executor?: Executor<Uint8Array,any>;
generatePort: (port: any) => React.FunctionComponentElement<{ engine: DiagramEngine; port: any; key: any; }>;

Expand All @@ -169,6 +171,8 @@ export class ComponentNodeWidget extends React.Component<ComponentNodeWidgetProp
this.hasStatus = this.props.node.hasCommand(KeyCommand.STATUS);
this.hasDownload = this.props.node.hasCommand(KeyCommand.DOWNLOAD);
this.hasWebsite = this.props.node.hasCommand(KeyCommand.WEBSITE);
this.hasTerminal = this.props.node.hasCommand(KeyCommand.TERMINAL);


this.state = {
status: ComponentStyleStatus.UNKNOWN,
Expand Down Expand Up @@ -254,6 +258,11 @@ export class ComponentNodeWidget extends React.Component<ComponentNodeWidgetProp
this.run(this.props.node.component.commands?.website!, ComponentStyleStatus.STARTING, KeyCommand.WEBSITE);
}

terminal = () => {
if(this.state.connected)
this.run(this.props.node.component.commands?.terminal!, ComponentStyleStatus.CHECKING, KeyCommand.TERMINAL);
}

async componentDidMount() {
await this.initializeConnection();
}
Expand Down Expand Up @@ -315,6 +324,12 @@ export class ComponentNodeWidget extends React.Component<ComponentNodeWidgetProp
<this.Icon className="fa fa-globe"></this.Icon>
</this.Button_other>
}

{this.hasTerminal &&
<this.Button_other onClick={this.terminal}>
<this.Icon className="fa fa-terminal"></this.Icon>
</this.Button_other>
}

</this.ButtonsPanel>

Expand Down
3 changes: 2 additions & 1 deletion src/Model/Model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export enum KeyCommand {
STOP = "stop",
STATUS = "status",
DOWNLOAD = "download",
WEBSITE = "website"
WEBSITE = "website",
TERMINAL = "terminal"
}

export namespace AppArray.Model {
Expand Down