From ef563c36fc1747a21eb74bf2d7a899c314bcd8d7 Mon Sep 17 00:00:00 2001 From: Ricardo Marques Date: Thu, 19 Apr 2018 17:54:45 +0100 Subject: [PATCH] mgr/dashboard: RBD copy (frontend) Signed-off-by: Ricardo Marques --- .../frontend/src/app/app-routing.module.ts | 5 ++ .../rbd-form/rbd-form-copy-request.model.ts | 9 +++ .../ceph/block/rbd-form/rbd-form-mode.enum.ts | 3 +- .../block/rbd-form/rbd-form.component.html | 8 +-- .../ceph/block/rbd-form/rbd-form.component.ts | 70 ++++++++++++++++++- .../block/rbd-list/rbd-list.component.html | 4 ++ .../ceph/block/rbd-list/rbd-list.component.ts | 7 ++ .../src/app/shared/api/rbd.service.ts | 5 ++ .../services/task-manager-message.service.ts | 11 +++ 9 files changed, 116 insertions(+), 6 deletions(-) create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form-copy-request.model.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts index a015eebe050..6bb94b7425d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts @@ -54,6 +54,11 @@ const routes: Routes = [ component: RbdFormComponent, canActivate: [AuthGuardService] }, + { + path: 'rbd/copy/:pool/:name', + component: RbdFormComponent, + canActivate: [AuthGuardService] + }, { path: 'perf_counters/:type/:id', component: PerformanceCounterComponent, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form-copy-request.model.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form-copy-request.model.ts new file mode 100644 index 00000000000..9294583415b --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form-copy-request.model.ts @@ -0,0 +1,9 @@ +export class RbdFormCopyRequestModel { + dest_pool_name: string; + dest_image_name: string; + obj_size: number; + features: Array = []; + stripe_unit: number; + stripe_count: number; + data_pool: string; +} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form-mode.enum.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form-mode.enum.ts index c89005fbc19..3db18a1d688 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form-mode.enum.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form-mode.enum.ts @@ -1,4 +1,5 @@ export enum RbdFormMode { editing = 'editing', - cloning = 'cloning' + cloning = 'cloning', + copying = 'copying' } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.html index 71bcda73c69..6fc7b86615a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.html @@ -4,7 +4,7 @@ + i18n>{mode, select, editing {Edit} cloning {Clone} copying {Copy} other {Add}} @@ -17,7 +17,7 @@

- {mode, select, editing {Edit} cloning {Clone} other {Add}} RBD + {mode, select, editing {Edit} cloning {Clone} copying {Copy} other {Add}} RBD

@@ -27,7 +27,7 @@ *ngIf="rbdForm.controls.parent.value">
- {mode, select, editing {Update} cloning {Clone} other {Create}} RBD + {mode, select, editing {Update} cloning {Clone} copying {Copy} other {Create}} RBD