]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html
import ceph quincy 17.2.4
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / cluster / services / service-form / service-form.component.html
index a3e19ee3112c3d28a3ec630ada446adca026d0a7..dcd898d8853789ef61a342becaae2e8496839d7c 100644 (file)
@@ -17,7 +17,8 @@
             <select id="service_type"
                     name="service_type"
                     class="form-control"
-                    formControlName="service_type">
+                    formControlName="service_type"
+                    (change)="getServiceIds($event.target.value)">
               <option i18n
                       [ngValue]="null">-- Select a service type --</option>
               <option *ngFor="let serviceType of serviceTypes"
@@ -52,7 +53,7 @@
                         i18n>-- No service available --</option>
                 <option *ngIf="services !== null && services.length > 0"
                         [ngValue]="null"
-                        i18n>-- Select an existing RGW service --</option>
+                        i18n>-- Select an existing service --</option>
                 <option *ngFor="let service of services"
                         [value]="service.service_name">{{ service.service_name }}</option>
               </select>
@@ -77,6 +78,9 @@
             <span class="invalid-feedback"
                   *ngIf="serviceForm.showError('service_id', frm, 'required')"
                   i18n>This field is required.</span>
+            <span class="invalid-feedback"
+                  *ngIf="serviceForm.showError('service_id', frm, 'uniqueName')"
+                  i18n>This service id is already in use.</span>
             <span class="invalid-feedback"
                   *ngIf="serviceForm.showError('service_id', frm, 'rgwPattern')"
                   i18n>The value does not match the pattern <strong>&lt;service_id&gt;[.&lt;realm_name&gt;.&lt;zone_name&gt;]</strong>.</span>
@@ -84,8 +88,7 @@
         </div>
 
         <!-- unmanaged -->
-        <div class="form-group row"
-             *ngIf="serviceForm.controls.service_type.value !== 'snmp-gateway'">
+        <div class="form-group row">
           <div class="cd-col-form-offset">
             <div class="custom-control custom-checkbox">
               <input class="custom-control-input"
         </ng-container>
 
         <!-- iSCSI -->
-        <ng-container *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'iscsi'">
-          <!-- pool -->
-          <div class="form-group row">
-            <label i18n
-                   class="cd-col-form-label required"
-                   for="pool">Pool</label>
-            <div class="cd-col-form-input">
-              <select id="pool"
-                      name="pool"
-                      class="form-control"
-                      formControlName="pool">
-                <option *ngIf="pools === null"
-                        [ngValue]="null"
-                        i18n>Loading...</option>
-                <option *ngIf="pools && pools.length === 0"
-                        [ngValue]="null"
-                        i18n>-- No pools available --</option>
-                <option *ngIf="pools && pools.length > 0"
-                        [ngValue]="null"
-                        i18n>-- Select a pool --</option>
-                <option *ngFor="let pool of pools"
-                        [value]="pool.pool_name">{{ pool.pool_name }}</option>
-              </select>
-              <span class="invalid-feedback"
-                    *ngIf="serviceForm.showError('pool', frm, 'required')"
-                    i18n>This field is required.</span>
-            </div>
+        <!-- pool -->
+        <div class="form-group row"
+             *ngIf="serviceForm.controls.service_type.value === 'iscsi'">
+          <label i18n
+                 class="cd-col-form-label required"
+                 for="pool">Pool</label>
+          <div class="cd-col-form-input">
+            <select id="pool"
+                    name="pool"
+                    class="form-control"
+                    formControlName="pool">
+              <option *ngIf="pools === null"
+                      [ngValue]="null"
+                      i18n>Loading...</option>
+              <option *ngIf="pools && pools.length === 0"
+                      [ngValue]="null"
+                      i18n>-- No pools available --</option>
+              <option *ngIf="pools && pools.length > 0"
+                      [ngValue]="null"
+                      i18n>-- Select a pool --</option>
+              <option *ngFor="let pool of pools"
+                      [value]="pool.pool_name">{{ pool.pool_name }}</option>
+            </select>
+            <span class="invalid-feedback"
+                  *ngIf="serviceForm.showError('pool', frm, 'required')"
+                  i18n>This field is required.</span>
           </div>
+        </div>
 
+        <!-- fields in iSCSI which are hidden when unmanaged is true -->
+        <ng-container *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'iscsi'">
           <!-- trusted_ip_list -->
           <div class="form-group row">
             <label class="cd-col-form-label"
         </ng-container>
 
         <!-- Ingress -->
-        <ng-container *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'ingress'">
+        <ng-container *ngIf="serviceForm.controls.service_type.value === 'ingress'">
           <!-- virtual_ip -->
           <div class="form-group row">
             <label class="cd-col-form-label"
             </div>
           </div>
           <!-- virtual_interface_networks -->
-          <div class="form-group row">
+          <div class="form-group row"
+               *ngIf="!serviceForm.controls.unmanaged.value">
             <label class="cd-col-form-label"
                    for="virtual_interface_networks">
               <span i18n>CIDR Networks</span>
         </ng-container>
 
         <!-- SNMP-Gateway -->
-        <ng-container *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'snmp-gateway'">
+        <ng-container *ngIf="serviceForm.controls.service_type.value === 'snmp-gateway'">
           <!-- snmp-version -->
           <div class="form-group row">
             <label class="cd-col-form-label required"