Commit d3f8eb9c authored by Jan Marchel's avatar Jan Marchel
Browse files

adding automate option

parent 97ccfa47
Pipeline #19449 passed with stage
in 6 minutes and 3 seconds
......@@ -68,13 +68,14 @@ export class ByonService {
);
}
addByonDefinitionToProactive(byonDefinitionId: string): Observable<Byon> {
addByonDefinitionToProactive(byonDefinitionId: string, automate: boolean): Observable<Byon> {
const requestUrl = `${this.apiUrl}/proactive/${byonDefinitionId}`;
console.log(`addByonDefinitionToProactive-> localStorage appId: ${localStorage.getItem('appId')}`);
//let params = new HttpParams().set('applicationId', localStorage.getItem('appId'));
httpOptions.params = httpOptions.params.set('applicationId', localStorage.getItem('appId'));
httpOptions.params = httpOptions.params.set('automate', String(automate));
console.log(`addByonDefinitionToProactive-> post request with httpOptions.params: ${httpOptions.params.toString()}`);
return this.http.post(requestUrl,null, httpOptions).pipe(
return this.http.post(requestUrl, null, httpOptions).pipe(
tap((response: Byon) => {
console.log(`Byon as byon with id ${response.id} from byon definition with id ${byonDefinitionId}
successfully added to Proactive`);
......
<div>
<p>
<mat-card-subtitle>
<h3>
Byon Definitions
</h3>
<h3>Byon Definitions</h3>
<button mat-raised-button color="primary" (click)="onByonButtonClick()">
Byon definitions configuration
</button>
......@@ -68,6 +66,15 @@
<td mat-cell *matCellDef="let row">{{row.diagnostic}}</td>
</ng-container>
<ng-container matColumnDef="automate">
<th mat-header-cell *matHeaderCellDef>Automate</th>
<td mat-cell *matCellDef="let row">
<section class="example-section">
<mat-checkbox class="example-margin" [(ngModel)]="automate"></mat-checkbox>
</section>
</td>
</ng-container>
<ng-container matColumnDef="add">
<th mat-header-cell *matHeaderCellDef>Add</th>
<td mat-cell *matCellDef="let row">
......
......@@ -12,11 +12,12 @@ import {ByonListCommonComponent} from '../../byon/byon-list-common/byon-list-com
export class ByonDefinitionsComponent extends ByonListCommonComponent implements OnInit {
byonLoadingInProgress = false;
automate = false;
byonInCloudiatorList: Array<Byon>;
data: MatTableDataSource<Byon>;
displayedColumns: string[] = ['no', 'name', 'publicIpAddress', 'cores', 'memory', 'disk', 'system', 'location',
'diagnostic', 'add', 'delete'];
'diagnostic', 'automate', 'add', 'delete'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
......@@ -37,7 +38,8 @@ export class ByonDefinitionsComponent extends ByonListCommonComponent implements
onAddByonToCloudiatorClick(byon: Byon) {
console.log(`Add byon node with name: ${byon.name} and id: ${byon.id} click`);
this.byonLoadingInProgress = true;
this.byonService.addByonDefinitionToProactive(byon.id).subscribe(value => {
console.log(this.automate);
this.byonService.addByonDefinitionToProactive(byon.id, this.automate).subscribe(value => {
this.snackBar.open(`New byon ${value.name} successfully added to Proactive`, 'Close');
this.getByonDefinitionList();
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment