2 |
8 |
9 |
10 | no command enter (min. 3 char)
11 | {{ activeCommand?.suggestion }}
12 | = 3">
19 | command not found
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/app/features/command/command-line/command-line.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, EventEmitter, Input, OnInit, Output, ChangeDetectionStrategy } from '@angular/core';
2 | import { FormControl, Validators } from '@angular/forms';
3 | import { debounceTime, distinctUntilChanged, filter, map } from 'rxjs/operators';
4 |
5 | import { allowedCommandValidator } from './command-line.validator';
6 | import { Command } from '@app/shared/models/command.interface';
7 |
8 | @Component({
9 | selector: 'tr-command-line',
10 | templateUrl: './command-line.component.html',
11 | styles: [
12 | `
13 | .input-group-text {
14 | background: white;
15 | font-size: .9em;
16 | }
17 |
18 | .form-control {
19 | font-size: .9em;
20 | }
21 | `
22 | ],
23 | changeDetection: ChangeDetectionStrategy.OnPush
24 | })
25 | export class CommandLineComponent implements OnInit {
26 | commandLine: FormControl;
27 | commandsHistory: string[] = [];
28 | commandsHistoryCursor = 0;
29 |
30 | @Input() allowedCommands: Array