summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-form/rbd-namespace-form-modal.component.html
blob: 9d76cba095fe1ab068fdee146b44693053649443 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<cd-modal [modalRef]="activeModal">
  <ng-container class="modal-title"
                i18n>Create Namespace</ng-container>

  <ng-container class="modal-content">
    <form name="namespaceForm"
          #formDir="ngForm"
          [formGroup]="namespaceForm"
          novalidate>
      <div class="modal-body">

        <!-- Pool -->
        <div class="form-group row">
          <label class="cd-col-form-label required"
                 for="pool"
                 i18n>Pool</label>
          <div class="cd-col-form-input">
            <input class="form-control"
                   type="text"
                   placeholder="Pool name..."
                   id="pool"
                   name="pool"
                   formControlName="pool"
                   *ngIf="!poolPermission.read">
            <select id="pool"
                    name="pool"
                    class="form-control"
                    formControlName="pool"
                    *ngIf="poolPermission.read">
              <option *ngIf="pools === null"
                      [ngValue]="null"
                      i18n>Loading...</option>
              <option *ngIf="pools !== null && pools.length === 0"
                      [ngValue]="null"
                      i18n>-- No rbd pools available --</option>
              <option *ngIf="pools !== null && 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 *ngIf="namespaceForm.showError('pool', formDir, 'required')"
                  class="invalid-feedback"
                  i18n>This field is required.</span>
          </div>
        </div>

        <!-- Name -->
        <div class="form-group row">
          <label class="cd-col-form-label required"
                 for="namespace"
                 i18n>Name</label>
          <div class="cd-col-form-input">
            <input class="form-control"
                   type="text"
                   placeholder="Namespace name..."
                   id="namespace"
                   name="namespace"
                   formControlName="namespace"
                   autofocus>
            <span class="invalid-feedback"
                  *ngIf="namespaceForm.showError('namespace', formDir, 'required')"
                  i18n>This field is required.</span>
            <span class="invalid-feedback"
                  *ngIf="namespaceForm.showError('namespace', formDir, 'namespaceExists')"
                  i18n>Namespace already exists.</span>
          </div>
        </div>

      </div>

      <div class="modal-footer">
        <cd-form-button-panel (submitActionEvent)="submit()"
                              [form]="namespaceForm"
                              [submitText]="actionLabels.CREATE"></cd-form-button-panel>
      </div>
    </form>
  </ng-container>
</cd-modal>