- onDeployxApp(event): void {
- const dialogRef = this.dialog.open(AppCatalogDeployDialog, {
- width: '400px',
- data: { name: event.data.name }
- });
-
- dialogRef.afterClosed().subscribe(result => {
- console.log('The dialog was closed');
- });
- }
-
-}
-
-@Component({
- selector: 'app-catalog-deploy-dialog',
- templateUrl: 'catalog.component.deploy-dialog.html',
- styleUrls: ['./catalog.component.css']
-})
-
-export class AppCatalogDeployDialog{
-
- constructor(
- public dialogRef: MatDialogRef<AppCatalogDeployDialog>,
- private service: CatalogService,
- @Inject(MAT_DIALOG_DATA) public data: DialogData) { }
-
- onNoClick(): void {
- this.dialogRef.close();
- }
-
- deployXapp(): void {
- this.service.deployXapp(this.data.name).subscribe((val: any[]) => { });
- this.dialogRef.close();
- }
+ onDeployxApp(name: string): void {
+ this.confirmDialogService.openConfirmDialog('Are you sure you want to deploy this xApp?')
+ .afterClosed().subscribe(res => {
+ if (res) {
+ this.xappMgrSvc.deployXapp(name).subscribe(
+ response => {
+ switch (response.status) {
+ case 200:
+ this.notification.success('xApp deploy succeeded!');
+ break;
+ default:
+ this.notification.warn('xApp deploy failed.');
+ }
+ }
+ );
+ }
+ });