deploymentOption: DeploymentOptions;
selectedOption = {};
simpleDeployment = true;
+ stepsToSkip: { [steps: string]: boolean } = {};
@Output()
submitAction = new EventEmitter();
this.deploymentOption = options;
this.selectedOption = { option: options.recommended_option };
});
+
+ this.stepTitles.forEach((stepTitle) => {
+ this.stepsToSkip[stepTitle] = false;
+ });
}
createCluster() {
}
onSubmit() {
- this.hostService.list('false').subscribe((hosts) => {
- hosts.forEach((host) => {
- const index = host['labels'].indexOf('_no_schedule', 0);
- if (index > -1) {
- host['labels'].splice(index, 1);
- this.observables.push(this.hostService.update(host['hostname'], true, host['labels']));
- }
- });
- forkJoin(this.observables)
- .pipe(
- finalize(() =>
- this.clusterService.updateStatus('POST_INSTALLED').subscribe(() => {
- this.notificationService.show(
- NotificationType.success,
- $localize`Cluster expansion was successful`
- );
- this.router.navigate(['/dashboard']);
- })
- )
- )
- .subscribe({
- error: (error) => error.preventDefault()
+ if (!this.stepsToSkip['Add Hosts']) {
+ this.hostService.list('false').subscribe((hosts) => {
+ hosts.forEach((host) => {
+ const index = host['labels'].indexOf('_no_schedule', 0);
+ if (index > -1) {
+ host['labels'].splice(index, 1);
+ this.observables.push(this.hostService.update(host['hostname'], true, host['labels']));
+ }
});
- });
-
- if (this.driveGroup) {
- const user = this.authStorageService.getUsername();
- this.driveGroup.setName(`dashboard-${user}-${_.now()}`);
- this.driveGroups.push(this.driveGroup.spec);
+ forkJoin(this.observables)
+ .pipe(
+ finalize(() =>
+ this.clusterService.updateStatus('POST_INSTALLED').subscribe(() => {
+ this.notificationService.show(
+ NotificationType.success,
+ $localize`Cluster expansion was successful`
+ );
+ this.router.navigate(['/dashboard']);
+ })
+ )
+ )
+ .subscribe({
+ error: (error) => error.preventDefault()
+ });
+ });
}
- if (this.simpleDeployment) {
- const title = this.deploymentOption?.options[this.selectedOption['option']].title;
- const trackingId = $localize`${title} deployment`;
- this.taskWrapper
- .wrapTaskAroundCall({
- task: new FinishedTask('osd/' + URLVerbs.CREATE, {
- tracking_id: trackingId
- }),
- call: this.osdService.create([this.selectedOption], trackingId, 'predefined')
- })
- .subscribe({
- error: (error) => error.preventDefault(),
- complete: () => {
- this.submitAction.emit();
- }
- });
- } else {
- if (this.osdService.osdDevices['totalDevices'] > 0) {
- this.driveGroup.setFeature('encrypted', this.selectedOption['encrypted']);
- const trackingId = _.join(_.map(this.driveGroups, 'service_id'), ', ');
+ if (!this.stepsToSkip['Create OSDs']) {
+ if (this.driveGroup) {
+ const user = this.authStorageService.getUsername();
+ this.driveGroup.setName(`dashboard-${user}-${_.now()}`);
+ this.driveGroups.push(this.driveGroup.spec);
+ }
+
+ if (this.simpleDeployment) {
+ const title = this.deploymentOption?.options[this.selectedOption['option']].title;
+ const trackingId = $localize`${title} deployment`;
this.taskWrapper
.wrapTaskAroundCall({
task: new FinishedTask('osd/' + URLVerbs.CREATE, {
tracking_id: trackingId
}),
- call: this.osdService.create(this.driveGroups, trackingId)
+ call: this.osdService.create([this.selectedOption], trackingId, 'predefined')
})
.subscribe({
error: (error) => error.preventDefault(),
complete: () => {
this.submitAction.emit();
- this.osdService.osdDevices = [];
}
});
+ } else {
+ if (this.osdService.osdDevices['totalDevices'] > 0) {
+ this.driveGroup.setFeature('encrypted', this.selectedOption['encrypted']);
+ const trackingId = _.join(_.map(this.driveGroups, 'service_id'), ', ');
+ this.taskWrapper
+ .wrapTaskAroundCall({
+ task: new FinishedTask('osd/' + URLVerbs.CREATE, {
+ tracking_id: trackingId
+ }),
+ call: this.osdService.create(this.driveGroups, trackingId)
+ })
+ .subscribe({
+ error: (error) => error.preventDefault(),
+ complete: () => {
+ this.submitAction.emit();
+ this.osdService.osdDevices = [];
+ }
+ });
+ }
}
}
}
}
}
+ onSkip() {
+ const stepTitle = this.stepTitles[this.currentStep.stepIndex - 1];
+ this.stepsToSkip[stepTitle] = true;
+ this.onNextStep();
+ }
+
showSubmitButtonLabel() {
return !this.wizardStepsService.isLastStep()
? this.actionLabels.NEXT