-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
677 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
apps/angular-console/src/app/background-tasks.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { Component } from '@angular/core'; | ||
import { CommandRunner, Settings } from '@angular-console/utils'; | ||
import { first } from 'rxjs/operators'; | ||
|
||
/** | ||
* Delete this component once background tasks functionality is fully implemented | ||
*/ | ||
@Component({ | ||
selector: 'angular-console-background-tasks', | ||
template: ` | ||
<div *ngIf="settings.showBackgroundTasks()" style="top: 500px; background-color: green; width: 800px;"> | ||
<h1>background tasks</h1> | ||
<div *ngFor="let task of allCommands|async"> | ||
<div>id: {{ task.id }}</div> | ||
<div>status: {{ task.status }}</div> | ||
<div>workspace: {{ task.workspace }}</div> | ||
<div>command: {{ task.command }}</div> | ||
<div> | ||
<button *ngIf="task.status == 'inprogress'" (click)="stop(task.id)">stop</button> | ||
<button *ngIf="task.status !== 'inprogress'" (click)="restart(task.id)">restart</button> | ||
<button (click)="open(task.id)">open</button> | ||
<button (click)="remove(task.id)">remove</button> | ||
</div> | ||
</div> | ||
</div> | ||
` | ||
}) | ||
export class BackgroundTasksComponent { | ||
allCommands = this.runner.listAllCommands(); | ||
|
||
constructor(public settings: Settings, public runner: CommandRunner) {} | ||
|
||
stop(id: string) { | ||
this.runner.stopCommand(id); | ||
} | ||
|
||
restart(id: string) { | ||
this.runner.restartCommand(id); | ||
} | ||
|
||
remove(id: string) { | ||
this.runner.removeCommand(id); | ||
} | ||
|
||
open(id: string) { | ||
this.runner | ||
.getCommand(id) | ||
.pipe(first()) | ||
.subscribe(v => { | ||
console.log(JSON.stringify(v, null, 2)); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
libs/feature-generate/src/lib/schematic/schematic.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<ui-task-runner *ngIf="schematic$ | async as schematic" [terminalWindowTitle]="schematic.collection + ' - ' + schematic.name"> | ||
<ui-flags [prefix]="getPrefix(schematic)" [fields]="schematic.schema" (value)="onFlagsChange($event)" | ||
[init]="initValues$ | async" [path]="path()"></ui-flags> | ||
<ui-terminal [command]="command$|async" [input]="(combinedOutput$|async)?.out"></ui-terminal> | ||
<ui-terminal [command]="command$|async" [input]="(combinedOutput$|async)?.outChunk"></ui-terminal> | ||
</ui-task-runner> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<ui-task-runner *ngIf="script$ | async as script" terminalWindowTitle="Task output"> | ||
<ui-flags [fields]="script.schema" [prefix]="['run', script.name]" | ||
(value)="onFlagsChange($event)" (action)="onRun()" (stop)="onStop()" [path]="path()"></ui-flags> | ||
<ui-terminal [command]="command$ | async" [input]="(commandOutput$|async)?.out"></ui-terminal> | ||
(value)="onFlagsChange($event)" (action)="onRun()" [path]="path()"></ui-flags> | ||
<ui-terminal [command]="command$ | async" [input]="(commandOutput$|async)?.outChunk"></ui-terminal> | ||
</ui-task-runner> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<ui-task-runner *ngIf="project$ | async as project" terminalWindowTitle="Task output"> | ||
<ui-flags [configurations]="project.architect[0].configurations" [prefix]="[project.architect[0].name, project.name]" [fields]="project.architect[0].schema" | ||
(value)="onFlagsChange($event)" (action)="onRun()" (stop)="onStop()" [path]="path()"></ui-flags> | ||
<ui-terminal [command]="command$ | async" [input]="(commandOutput$|async)?.out" #output></ui-terminal> | ||
(value)="onFlagsChange($event)" (action)="onRun()" [path]="path()"></ui-flags> | ||
<ui-terminal [command]="command$ | async" [input]="(commandOutput$|async)?.outChunk" #output></ui-terminal> | ||
</ui-task-runner> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.