component: RbdFormComponent,
canActivate: [AuthGuardService]
},
+ {
+ path: 'rbd/copy/:pool/:name/:snap',
+ component: RbdFormComponent,
+ canActivate: [AuthGuardService]
+ },
{
path: 'perf_counters/:type/:id',
component: PerformanceCounterComponent,
if (this.mode === this.rbdFormMode.cloning) {
this.rbdForm.get('parent').setValue(`${response.pool_name}/${response.name}@${snapName}`);
} else if (this.mode === this.rbdFormMode.copying) {
- this.rbdForm.get('parent').setValue(`${response.pool_name}/${response.name}`);
+ if (snapName) {
+ this.rbdForm.get('parent').setValue(`${response.pool_name}/${response.name}@${snapName}`);
+ } else {
+ this.rbdForm.get('parent').setValue(`${response.pool_name}/${response.name}`);
+ }
} else if (response.parent) {
const parent = response.parent;
this.rbdForm.get('parent')
copyRequest(): RbdFormCopyRequestModel {
const request = new RbdFormCopyRequestModel();
+ if (this.snapName) {
+ request.snapshot_name = this.snapName;
+ }
request.dest_pool_name = this.rbdForm.get('pool').value;
request.dest_image_name = this.rbdForm.get('name').value;
request.obj_size = this.formatter.toBytes(this.rbdForm.get('obj_size').value);
<i class="fa fa-fw fa-clone"></i><span i18n>Clone</span>
</a>
</li>
+ <li role="menuitem"
+ [ngClass]="{'disabled': !selection.hasSingleSelection || selection.first().executing}">
+ <a class="dropdown-item" routerLink="/rbd/copy/{{ poolName }}/{{ rbdName }}/{{ selection.first()?.name }}">
+ <i class="fa fa-fw fa-copy"></i><span i18n>Copy</span>
+ </a>
+ </li>
<li role="menuitem"
[ngClass]="{'disabled': !selection.hasSingleSelection || selection.first().executing}">
<a class="dropdown-item" (click)="rollbackModal()"><i class="fa fa-fw fa-undo"></i><span i18n>Rollback</span></a>