]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
fb0d3650d0d0a49e4949aedd8ff38e6750a0c1a6
[ceph.git] /
1 <cd-modal [modalRef]="modalRef">
2   <ng-container class="modal-title"
3                 i18n>Create Namespace</ng-container>
4
5   <ng-container class="modal-content">
6     <form name="namespaceForm"
7           #formDir="ngForm"
8           [formGroup]="namespaceForm"
9           novalidate>
10       <div class="modal-body">
11
12         <!-- Pool -->
13         <div class="form-group row">
14           <label class="cd-col-form-label required"
15                  for="pool"
16                  i18n>Pool</label>
17           <div class="cd-col-form-input">
18             <input class="form-control"
19                    type="text"
20                    placeholder="Pool name..."
21                    id="pool"
22                    name="pool"
23                    formControlName="pool"
24                    *ngIf="!poolPermission.read">
25             <select id="pool"
26                     name="pool"
27                     class="form-control custom-select"
28                     formControlName="pool"
29                     *ngIf="poolPermission.read">
30               <option *ngIf="pools === null"
31                       [ngValue]="null"
32                       i18n>Loading...</option>
33               <option *ngIf="pools !== null && pools.length === 0"
34                       [ngValue]="null"
35                       i18n>-- No rbd pools available --</option>
36               <option *ngIf="pools !== null && pools.length > 0"
37                       [ngValue]="null"
38                       i18n>-- Select a pool --</option>
39               <option *ngFor="let pool of pools"
40                       [value]="pool.pool_name">{{ pool.pool_name }}</option>
41             </select>
42             <span *ngIf="namespaceForm.showError('pool', formDir, 'required')"
43                   class="invalid-feedback"
44                   i18n>This field is required.</span>
45           </div>
46         </div>
47
48         <!-- Name -->
49         <div class="form-group row">
50           <label class="cd-col-form-label required"
51                  for="namespace"
52                  i18n>Name</label>
53           <div class="cd-col-form-input">
54             <input class="form-control"
55                    type="text"
56                    placeholder="Namespace name..."
57                    id="namespace"
58                    name="namespace"
59                    formControlName="namespace"
60                    autofocus>
61             <span class="invalid-feedback"
62                   *ngIf="namespaceForm.showError('namespace', formDir, 'required')"
63                   i18n>This field is required.</span>
64             <span class="invalid-feedback"
65                   *ngIf="namespaceForm.showError('namespace', formDir, 'namespaceExists')"
66                   i18n>Namespace already exists.</span>
67           </div>
68         </div>
69
70       </div>
71
72       <div class="modal-footer">
73         <div class="button-group text-right">
74           <cd-submit-button [form]="namespaceForm"
75                             (submitAction)="submit()"
76                             i18n>Create Namespace</cd-submit-button>
77           <cd-back-button [back]="modalRef.hide"
78                           name="Close"
79                           i18n-name>
80           </cd-back-button>
81         </div>
82       </div>
83     </form>
84   </ng-container>
85 </cd-modal>