-
Notifications
You must be signed in to change notification settings - Fork 16
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
Philip Prinz
authored and
Philip Prinz
committed
Apr 9, 2024
1 parent
ec9c226
commit a179c5e
Showing
12 changed files
with
199 additions
and
18 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
2 changes: 1 addition & 1 deletion
2
.../configuration/code-with-syntax-highlighting/code-with-syntax-highlighting.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 @@ | ||
<div class="code-editor" #codeEditor> | ||
<textarea (input)="onValueChange($event)" (resize)="manualResizeEvent($event)" [(ngModel)]="_textValue" #textarea> | ||
<textarea (input)="onValueChange($event)" (resize)="manualResizeEvent($event)" [(ngModel)]="_textValue" readonly="readonly" #textarea> | ||
</textarea> | ||
<code #code class="{{ language }}" [innerHTML]="highlightedText"></code> | ||
</div> |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#single-column-block ::ng-deep .stack-block-label { | ||
max-width: 100%; | ||
flex-basis: 100%; | ||
} | ||
|
||
#single-column-block ::ng-deep .stack-view-key { | ||
min-width: 100%; | ||
// max-width: 100%; | ||
// flex-basis: 100%; | ||
// flex: 0 0 100%; | ||
} | ||
|
||
#single-column-block ::ng-deep .stack-block-content { | ||
display: none; | ||
} |
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
102 changes: 102 additions & 0 deletions
102
src/app/scenario/task/readonly-task/readonly-task.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 |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<div class="container"> | ||
<div class="clr-row"> | ||
<!-- <div class="clr-col-6"></div> --> | ||
<div class="clr-col-5"> | ||
<h6><b>Node</b></h6> | ||
</div> | ||
<div class="clr-col-6"> | ||
<p>{{ editTask.vmName }}</p> | ||
</div> | ||
</div> | ||
|
||
<div class="clr-row"> | ||
<!-- <div class="clr-col-6"></div> --> | ||
<div class="clr-col-5"> | ||
<h6><b>Name</b></h6> | ||
</div> | ||
<div class="clr-col-6"> | ||
<p>{{ editTask.name }}</p> | ||
</div> | ||
</div> | ||
|
||
<div class="clr-row"> | ||
<!-- <div class="clr-col-6"></div> --> | ||
<div class="clr-col-5"> | ||
<h6><b>Description</b></h6> | ||
</div> | ||
<div class="clr-col-6"> | ||
<p>{{ editTask.description }}</p> | ||
</div> | ||
</div> | ||
|
||
<div class="clr-row"> | ||
<!-- <div class="clr-col-6"></div> --> | ||
<div class="clr-col-5"> | ||
<h6><b>Command</b></h6> | ||
</div> | ||
<div class="clr-col-6"> | ||
<p></p> | ||
<app-code-with-syntax-highlighting | ||
[language]="supportedLanguages.BASH" | ||
[readonly]="true" | ||
[height]="'2rem'" | ||
[width]="'90%'" | ||
[outline]="'none'" | ||
[textValue]="editTask.command" | ||
></app-code-with-syntax-highlighting> | ||
</div> | ||
</div> | ||
|
||
<div class="clr-row"> | ||
<!-- <div class="clr-col-6"></div> --> | ||
<div class="clr-col-5"> | ||
<h6><b>Return Type</b></h6> | ||
</div> | ||
<div class="clr-col-6"> | ||
<p>{{ translateReturnType(editTask.return_type) }}</p> | ||
</div> | ||
</div> | ||
<div | ||
class="clr-row" | ||
*ngIf="isOfReturnType(['Return Text', 'Return Code and Text'])" | ||
> | ||
<!-- <div class="clr-col-6"></div> --> | ||
<div class="clr-col-5"> | ||
<h6><b>Expected Output</b></h6> | ||
</div> | ||
<div class="clr-col-6"> | ||
<p>{{ editTask.expected_output_value }}</p> | ||
</div> | ||
</div> | ||
|
||
<div class="clr-row" *ngIf="isOfReturnType(['Match Regex'])"> | ||
<!-- <div class="clr-col-6"></div> --> | ||
<div class="clr-col-5"> | ||
<h6><b>Regex to match</b></h6> | ||
</div> | ||
<div class="clr-col-6"> | ||
<p></p> | ||
<app-code-with-syntax-highlighting | ||
[language]="supportedLanguages.REGEX" | ||
[readonly]="true" | ||
[height]="'2rem'" | ||
[width]="'90%'" | ||
[outline]="'none'" | ||
[textValue]="editTask.expected_output_value" | ||
></app-code-with-syntax-highlighting> | ||
</div> | ||
</div> | ||
|
||
<div | ||
class="clr-row" | ||
*ngIf="isOfReturnType(['Return Code', 'Return Code and Text'])" | ||
> | ||
<!-- <div class="clr-col-6"></div> --> | ||
<div class="clr-col-5"> | ||
<h6><b>Return Code</b></h6> | ||
</div> | ||
<div class="clr-col-6"> | ||
<p>{{ editTask.expected_return_code }}</p> | ||
</div> | ||
</div> | ||
</div> |
5 changes: 5 additions & 0 deletions
5
src/app/scenario/task/readonly-task/readonly-task.component.scss
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,5 @@ | ||
.container { | ||
margin-bottom: 1rem; | ||
margin-left: 1.5rem; | ||
// width: 80%; | ||
} |
29 changes: 29 additions & 0 deletions
29
src/app/scenario/task/readonly-task/readonly-task.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,29 @@ | ||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; | ||
import { FormGroup, FormControl, Validators } from '@angular/forms'; | ||
import { ReturnType, Task } from 'src/app/data/vm-tasks'; | ||
import { supportedLanguages } from 'src/app/configuration/code-with-syntax-highlighting/code-with-syntax-highlighting.component'; | ||
|
||
export interface EditTask extends Task { | ||
id: string; | ||
vmName: string; | ||
} | ||
|
||
@Component({ | ||
selector: 'app-readonly-task', | ||
templateUrl: './readonly-task.component.html', | ||
styleUrls: ['./readonly-task.component.scss'], | ||
}) | ||
export class ReadonlyTaskComponent { | ||
|
||
@Input() editTask: EditTask; | ||
|
||
supportedLanguages = supportedLanguages; | ||
|
||
translateReturnType(rtype: string) { | ||
return ReturnType[rtype] | ||
} | ||
|
||
isOfReturnType(returnTypes: string[]): boolean { | ||
return returnTypes.includes(this.translateReturnType(this.editTask.return_type)); | ||
} | ||
} |
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