]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.ts
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / block / rbd-form / rbd-form.component.ts
index 28f77e0da08bf915c1dddedd7a63caa0e95f49bb..33e67b09bbf76c2a3a7390f72caeaad5f629da80 100644 (file)
@@ -1,5 +1,5 @@
 import { Component, OnInit } from '@angular/core';
-import { FormControl, ValidatorFn, Validators } from '@angular/forms';
+import { UntypedFormControl, ValidatorFn, Validators } from '@angular/forms';
 import { ActivatedRoute, Router } from '@angular/router';
 
 import _ from 'lodash';
@@ -133,13 +133,15 @@ export class RbdFormComponent extends CdForm implements OnInit {
         desc: $localize`Deep flatten`,
         requires: null,
         allowEnable: false,
-        allowDisable: true
+        allowDisable: true,
+        helperHtml: $localize`Feature can be disabled but can't be re-enabled later`
       },
       layering: {
         desc: $localize`Layering`,
         requires: null,
         allowEnable: false,
-        allowDisable: false
+        allowDisable: false,
+        helperHtml: $localize`Feature flag can't be manipulated after the image is created. Disabling this option will also disable the Protect and Clone actions on Snapshot`
       },
       'exclusive-lock': {
         desc: $localize`Exclusive lock`,
@@ -174,33 +176,33 @@ export class RbdFormComponent extends CdForm implements OnInit {
   createForm() {
     this.rbdForm = new CdFormGroup(
       {
-        parent: new FormControl(''),
-        name: new FormControl('', {
+        parent: new UntypedFormControl(''),
+        name: new UntypedFormControl('', {
           validators: [Validators.required, Validators.pattern(/^[^@/]+?$/)]
         }),
-        pool: new FormControl(null, {
+        pool: new UntypedFormControl(null, {
           validators: [Validators.required]
         }),
-        namespace: new FormControl(null),
-        useDataPool: new FormControl(false),
-        dataPool: new FormControl(null),
-        size: new FormControl(null, {
+        namespace: new UntypedFormControl(null),
+        useDataPool: new UntypedFormControl(false),
+        dataPool: new UntypedFormControl(null),
+        size: new UntypedFormControl(null, {
           updateOn: 'blur'
         }),
-        obj_size: new FormControl(this.defaultObjectSize),
+        obj_size: new UntypedFormControl(this.defaultObjectSize),
         features: new CdFormGroup(
           this.featuresList.reduce((acc: object, e) => {
-            acc[e.key] = new FormControl({ value: false, disabled: !!e.initDisabled });
+            acc[e.key] = new UntypedFormControl({ value: false, disabled: !!e.initDisabled });
             return acc;
           }, {})
         ),
-        mirroring: new FormControl(''),
-        schedule: new FormControl('', {
+        mirroring: new UntypedFormControl(''),
+        schedule: new UntypedFormControl('', {
           validators: [Validators.pattern(/^([0-9]+)d|([0-9]+)h|([0-9]+)m$/)] // check schedule interval to be in format - 1d or 1h or 1m
         }),
-        mirroringMode: new FormControl(''),
-        stripingUnit: new FormControl(this.defaultStripingUnit),
-        stripingCount: new FormControl(this.defaultStripingCount, {
+        mirroringMode: new UntypedFormControl(''),
+        stripingUnit: new UntypedFormControl(this.defaultStripingUnit),
+        stripingCount: new UntypedFormControl(this.defaultStripingCount, {
           updateOn: 'blur'
         })
       },
@@ -224,6 +226,11 @@ export class RbdFormComponent extends CdForm implements OnInit {
         this.rbdForm.get('deep-flatten').disable();
         this.rbdForm.get('layering').disable();
         this.rbdForm.get('exclusive-lock').disable();
+      } else {
+        if (!this.rbdForm.get('deep-flatten').value) {
+          this.rbdForm.get('deep-flatten').disable();
+        }
+        this.rbdForm.get('layering').disable();
       }
     });
   }