-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NAS-133481 / 25.04 / Changes for VMs in new virtualization #11323
Open
denysbutenko
wants to merge
5
commits into
master
Choose a base branch
from
NAS-133481
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+346
−269
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
14f7327
NAS-133481: Changes for VMs in new virtualization
denysbutenko bc1c56c
NAS-133481: Changes for VMs in new virtualization
denysbutenko cdfa413
NAS-133481: Changes for VMs in new virtualization
denysbutenko b5c0ae5
NAS-133481: Changes for VMs in new virtualization
denysbutenko 1d21cda
Merge branch 'master' into NAS-133481
denysbutenko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -7,8 +7,8 @@ import { MatCard, MatCardContent } from '@angular/material/card'; | |
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; | ||
import { TranslateModule, TranslateService } from '@ngx-translate/core'; | ||
import { Observable, of } from 'rxjs'; | ||
import { VirtualizationDeviceType } from 'app/enums/virtualization.enum'; | ||
import { VirtualizationDisk } from 'app/interfaces/virtualization.interface'; | ||
import { VirtualizationDeviceType, VirtualizationType } from 'app/enums/virtualization.enum'; | ||
import { VirtualizationDisk, VirtualizationInstance } from 'app/interfaces/virtualization.interface'; | ||
import { FormActionsComponent } from 'app/modules/forms/ix-forms/components/form-actions/form-actions.component'; | ||
import { IxExplorerComponent } from 'app/modules/forms/ix-forms/components/ix-explorer/ix-explorer.component'; | ||
import { IxFieldsetComponent } from 'app/modules/forms/ix-forms/components/ix-fieldset/ix-fieldset.component'; | ||
|
@@ -22,7 +22,7 @@ import { ApiService } from 'app/modules/websocket/api.service'; | |
import { FilesystemService } from 'app/services/filesystem.service'; | ||
|
||
interface InstanceDiskFormOptions { | ||
instanceId: string; | ||
instance: VirtualizationInstance; | ||
disk: VirtualizationDisk | undefined; | ||
} | ||
|
||
|
@@ -50,7 +50,7 @@ export class InstanceDiskFormComponent implements OnInit { | |
private existingDisk = signal<VirtualizationDisk | null>(null); | ||
|
||
protected readonly isLoading = signal(false); | ||
protected readonly directoryNodeProvider = this.filesystem.getFilesystemNodeProvider({ directoriesOnly: false }); | ||
protected readonly directoryNodeProvider = this.filesystem.getFilesystemNodeProvider({ datasetsAndZvols: true }); | ||
|
||
protected form = this.formBuilder.nonNullable.group({ | ||
source: ['', Validators.required], | ||
|
@@ -63,6 +63,8 @@ export class InstanceDiskFormComponent implements OnInit { | |
return !this.isNew() ? this.translate.instant('Edit Disk') : this.translate.instant('Add Disk'); | ||
}); | ||
|
||
protected instance = computed(() => this.slideInRef.getData().instance); | ||
|
||
constructor( | ||
private formBuilder: FormBuilder, | ||
private errorHandler: FormErrorHandlerService, | ||
|
@@ -86,6 +88,9 @@ export class InstanceDiskFormComponent implements OnInit { | |
destination: disk.destination || '', | ||
}); | ||
} | ||
if (this.instance().type === VirtualizationType.Vm) { | ||
this.form.controls.destination.disable(); | ||
} | ||
} | ||
|
||
onSubmit(): void { | ||
|
@@ -112,7 +117,7 @@ export class InstanceDiskFormComponent implements OnInit { | |
} | ||
|
||
private prepareRequest(): Observable<unknown> { | ||
const instanceId = this.slideInRef.getData().instanceId; | ||
const instanceId = this.slideInRef.getData().instance.id; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can reuse the signal |
||
|
||
const payload = { | ||
...this.form.value, | ||
|
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The computed callback doesn't have a signal call. This could just be a signal.
protected instance = signal(this.slideInRef.getData().instance);
Or maybe doesn't need to be a signal