Commit 2766f7d8 authored by Marta Różańska's avatar Marta Różańska
Browse files

Merge branch 'byonfix' into 'morphemic-rc1.5'

Byonfix

See merge request !23
parents 9b4d0fd8 a0e79b09
Pipeline #18725 passed with stages
in 6 minutes and 55 seconds
......@@ -6,11 +6,12 @@ build-angular-ui:
stage: build-angular-ui
image: trion/ng-cli
artifacts:
expire_in: 1 week
paths:
- dist/melodic-frontend
before_script:
- npm install -g --save-dev @angular/cli@latest
- npm install --save-dev --unsafe-perm node-sass@4.14.1
- npm install --save-dev --unsafe-perm sass
- npm install
script:
- ng build --prod
......@@ -22,10 +23,8 @@ build-ui-docker:
- rc3.0
- rc3.1
- morphemic-rc1.5
- feature-byon-proactive-support
- feature-mor-20-dev
- undeploy_button
- no_node_candidates_found
- morphemic-rc2.0
- byonfix
image: docker:19.03.1
services:
- docker:19.03.1-dind
......
......@@ -26,7 +26,8 @@
"src/styles.css",
"src/theme.scss"
],
"scripts": []
"scripts": [],
"es5BrowserSupport": true
},
"configurations": {
"production": {
......
This diff is collapsed.
......@@ -25,9 +25,7 @@
"core-js": "^2.5.4",
"hammerjs": "^2.0.8",
"ng-block-ui": "^2.1.8",
"node-sass": "^4.14.1",
"rxjs": "~6.3.3",
"saas": "^1.0.0",
"tslib": "^1.14.1",
"zone.js": "~0.8.26"
},
......
......@@ -13,6 +13,14 @@
Create new byon definition
</button>
<p>
<button color="warn" mat-raised-button
(click)="onCleanByonDefinitionsClick()">
<mat-icon>restart_alt</mat-icon>
Clean Byon Nodes
</button>
</p>
<mat-form-field>
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
</mat-form-field>
......
......@@ -18,6 +18,8 @@ export class ByonListComponent extends ByonListCommonComponent implements OnInit
'diagnostic', 'sshConnection', 'edit', 'delete'];
byonDefinitionDialog: MatDialogRef<ByonDefinitionFormComponent>;
confirmationDialog: MatDialogRef<ConfirmationDialogComponent>;
preparationInProgress = false;
operationInfo = '';
constructor(private processOfferService: ProcessOfferService,
private dialog: MatDialog,
......@@ -29,28 +31,59 @@ export class ByonListComponent extends ByonListCommonComponent implements OnInit
localStorage.setItem('viewTitle', 'Byon definitions');
this.getByonDefinitionList();
}
onCleanByonDefinitionsClick() {
this.confirmationDialog = this.createConfirmationDialog();
this.confirmationDialog.afterClosed().subscribe(value => {
if (value) {
console.log(`Confirmed cleaning of databases.`);
this.cleanByon();
} else {
console.log(`Cancel cleaning of databases.`);
}
});
}
createConfirmationDialog(): MatDialogRef<ConfirmationDialogComponent> {
return this.dialog.open(ConfirmationDialogComponent, {
hasBackdrop: false,
data: {
title: 'Cleaning Byon Nodes',
message: `All data will be permanently deleted.
Do you want to continue?`
},
width: '30%'
});
}
private cleanByon() {
this.preparationInProgress = true;
this.operationInfo = 'Cleaning byon nodes definitions...';
this.byonService.cleanByon().subscribe(() => {
this.preparationInProgress = false;
this.snackBar.open(`Cleaning Byon Nodes successfully started`, 'Close', {duration: 10000});
this.operationInfo = '';
},
error1 => {
this.preparationInProgress = false;
this.operationInfo = '';
this.snackBar.open(`Problem by deleting Byon Nodes: ${error1.error.message}. Please, try again.`, 'Close',
{duration: 10000});
});
}
getByonDefinitionList() {
this.byonLoadingInProgress = true;
this.processOfferService.getCloudList().subscribe(cloudsResposne => {
this.cloudsList = cloudsResposne;
this.byonService.getByonDefinitionList().subscribe(byonDefValue => {
console.log(`Successfully getting byon definitions`);
this.updateByonTableData(byonDefValue);
this.byonLoadingInProgress = false;
},
error1 => {
this.byonLoadingInProgress = false;
console.log('Error by getting byon definitions');
if (error1.status !== 404) {
this.snackBar.open(`Error by getting byon definitions: ${error1.error.message}`, 'Close');
}
});
this.byonService.getByonDefinitionList().subscribe(byonDefValue => {
console.log(`Successfully getting byon definitions`);
this.updateByonTableData(byonDefValue);
this.byonLoadingInProgress = false;
},
error1 => {
this.byonLoadingInProgress = false;
this.cloudsList = [];
this.snackBar.open(`Problem by getting data about clouds: ${error1.error.message}`, 'Close');
console.log('Error by getting byon definitions');
if (error1.status !== 404) {
this.snackBar.open(`Error by getting byon definitions: ${error1.error.message}`, 'Close');
}
});
}
......
......@@ -102,4 +102,12 @@ export class ByonService {
e => console.log(`Error by getting byon enums:`, e))
);
}
cleanByon() {
const requestUrl = `${this.apiUrl}/cleanByon`;
return this.http.put(requestUrl, httpOptions).pipe(
tap(() => console.log('Byon Nodes cleaning started.'),
e => console.error(`Error by cleaning Byon Nodes: `, e))
);
}
}
......@@ -99,7 +99,8 @@ export class DeploymentService {
private mapCloudConfForReadToCloudConf(cloudConf: CloudConfigurationForRead): CloudConfiguration {
const chosenProperty = cloudConf.properties.filter(value => value.checked);
return new CloudConfiguration(cloudConf.nodeGroup, chosenProperty, cloudConf.scopePrefix, cloudConf.scopeValue, cloudConf.identityVersion);
return new CloudConfiguration(cloudConf.nodeGroup, chosenProperty);
}
}
......@@ -71,14 +71,10 @@
'visibility'}}
</mat-icon>
</mat-form-field>
<mat-form-field *ngIf="isOpenstack(apiForm)">
<input matInput formControlName="domain" placeholder="domain">
</mat-form-field>
</form>
</mat-card>
<mat-card>
<form [formGroup]="cloudConfigurationForm">
<mat-form-field>
......@@ -93,19 +89,6 @@
{{getNodeGroupPatternMsg()}}
</mat-error>
</mat-form-field>
<div *ngIf="isOpenstack(apiForm)">
<mat-form-field>
<input matInput formControlName="identityVersion" placeholder="identityVersion" >
</mat-form-field>
<mat-form-field>
<input matInput formControlName="scopePrefix" placeholder="scopePrefix" >
</mat-form-field>
<mat-form-field>
<input matInput formControlName="scopeValue" placeholder="scopeValue" >
</mat-form-field>
</div>
<mat-card-subtitle><h3>Cloud properties</h3></mat-card-subtitle>
......
......@@ -75,19 +75,13 @@ export class CloudDefinitionFormComponent implements OnInit {
[Validators.required])
: ['', [Validators.required]],
secret: this.cloudData ? new FormControl({value: this.cloudData.credential.secret, disabled: this.isReadMode})
: ['', Validators.required],
domain: this.cloudData.credential.domain
: ['', Validators.required]
});
this.cloudConfigurationForm = this.formBuilder.group({
id: this.cloudData ? this.cloudData.cloudConfiguration.id : null,
nodeGroup: this.cloudData ? new FormControl({value: this.cloudData.cloudConfiguration.nodeGroup, disabled: this.isReadMode})
: ['', [Validators.required, Validators.pattern(this.nodeGroupPattern)]],
properties: this.cloudData ? this.cloudData.cloudConfiguration.properties : this.cloudProperties,
identityVersion: this.cloudData.cloudConfiguration.identityVersion,
scopePrefix: this.cloudData.cloudConfiguration.scopePrefix,
scopeValue: this.cloudData.cloudConfiguration.scopeValue
properties: this.cloudData ? this.cloudData.cloudConfiguration.properties : this.cloudProperties
});
this.cloudDefinitionForm = this.formBuilder.group({
id: this.cloudData ? this.cloudData.id : null,
......@@ -210,9 +204,6 @@ export class CloudDefinitionFormComponent implements OnInit {
});
}
isOpenstack(apiForm: FormGroup) {
return apiForm.value.providerName === 'openstack';
}
private deleteCloudProperty(row: ParentProperty) {
const deletedPropertyId = this.cloudProperties.findIndex(value => value.id === row.id);
this.cloudProperties.splice(deletedPropertyId, 1);
......
......@@ -2,18 +2,10 @@ export class CloudConfiguration {
id?: number;
nodeGroup: string;
properties: {};
scopePrefix: string;
scopeValue: string;
identityVersion: string;
constructor(nodeGroupArg: string, propertiesArg: {}, scopePrefixArg: string,
scopeValueArg: string, identityVersionArg: string, idArg?: number) {
constructor(nodeGroupArg: string, propertiesArg: {}, idArg?: number) {
this.id = idArg;
this.nodeGroup = nodeGroupArg;
this.properties = propertiesArg;
this.scopePrefix = scopePrefixArg;
this.scopeValue = scopeValueArg;
this.identityVersion = identityVersionArg;
}
}
......@@ -2,5 +2,4 @@ export class Credential {
id?: number;
user: string;
secret: string;
domain: string;
}
......@@ -4,7 +4,4 @@ export class CloudConfigurationForRead {
id?: number;
nodeGroup: string;
properties: Array<ParentProperty>;
identityVersion: string;
scopePrefix: string;
scopeValue: string;
}
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