Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xterm NgRx and HTTP binding #57

Open
hadrien-toma opened this issue May 5, 2020 · 0 comments
Open

Xterm NgRx and HTTP binding #57

hadrien-toma opened this issue May 5, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request front-end Contains front-end parts
Milestone

Comments

@hadrien-toma
Copy link
Collaborator

hadrien-toma commented May 5, 2020

Enhancement

Metadata

key value
name xterm-ngrx-and-http-binding

Description

As a system user/owner, I want to be able to open a terminal communicating with the devices through HTTP and I want to have this communication traced in a state in order to be able to trouble shoot any issues.

As a developer I want to have a generic component that I will be able to import and configure in several routes.

Implementation ideas

Here is the route to instanciate a terminal: libs/apps/embedded-device-manager/routes/routes/terminal/route

Interfaces

export interface NgTerminalState {
    configuration: {
                // all inputs of [ng-terminal component](https://github.com/qwefgh90/ng-terminal/blob/master/projects/ng-terminal/src/lib/ng-terminal.component.ts)
    },
    api: {
        // cf  libs/apps/embedded-device-manager/routes/route/src/lib/reducers/lang-menu-list/api/get.reducer.ts
    },
    events: {
        keyEventInput: 
	    historySize: number;
	    list: {
		key: string;
		keyCode: number;
	    }[];
        },
        keyInput: 
	    historySize: number;
	    list: {
		//useful params of keyInput's events
	    }[];
        },
    }
}
export interface State {
    [ngTerminalId: string]: NgTerminalState;
}

NgRx flow

  • see TODOs in libs/apps/embedded-device-manager/routes/routes/terminal/route/src/lib/components/index.component.ts
  • Store API request and response as it is done in libs/apps/embedded-device-manager/routes/route/src/lib/reducers/lang-menu-list/api/get.reducer.ts but adapt it for POST requests/responses instead of the GET ones. The payload of the POST request will be the command to execute.
  • Create the Nest.js API endpoint handling the previous POST request, executing this command and responding the stdout, stderr, and other useful outputs from the process execution.

References

@hadrien-toma hadrien-toma added enhancement New feature or request front-end Contains front-end parts labels May 5, 2020
@hadrien-toma hadrien-toma added this to the v1.0.0 milestone May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request front-end Contains front-end parts
Projects
None yet
Development

No branches or pull requests

2 participants