summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-create-modal/bootstrap-create-modal.component.html
blob: a31ab933c7525d7be708ffec87ab65617616f991 (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
80
81
82
83
84
85
86
87
<cd-modal [modalRef]="activeModal">
  <ng-container i18n
                class="modal-title">Create Bootstrap Token</ng-container>

  <ng-container class="modal-content">
    <form name="createBootstrapForm"
          class="form"
          #formDir="ngForm"
          [formGroup]="createBootstrapForm"
          novalidate>
      <div class="modal-body">
        <p>
          <ng-container i18n>To create a bootstrap token which can be imported
          by a peer site cluster, provide the local site's name, select
          which pools will have mirroring enabled, and click&nbsp;
          <kbd>Generate</kbd>.</ng-container>
        </p>

        <div class="form-group">
          <label class="col-form-label required"
                 for="siteName"
                 i18n>Site Name</label>
          <input class="form-control"
                 type="text"
                 placeholder="Name..."
                 i18n-placeholder
                 id="siteName"
                 name="siteName"
                 formControlName="siteName"
                 autofocus>
          <span *ngIf="createBootstrapForm.showError('siteName', formDir, 'required')"
                class="invalid-feedback"
                i18n>This field is required.</span>
        </div>

        <div class="form-group"
             formGroupName="pools">
          <label class="col-form-label required"
                 for="pools"
                 i18n>Pools</label>
          <div class="custom-control custom-checkbox"
               *ngFor="let pool of pools">
            <input type="checkbox"
                   class="custom-control-input"
                   id="{{ pool.name }}"
                   name="{{ pool.name }}"
                   formControlName="{{ pool.name }}">
            <label class="custom-control-label"
                   for="{{ pool.name }}">{{ pool.name }}</label>
          </div>
          <span *ngIf="createBootstrapForm.showError('pools', formDir, 'requirePool')"
                class="invalid-feedback"
                i18n>At least one pool is required.</span>
        </div>

        <cd-submit-button class="mb-4 float-right"
                          i18n
                          [form]="createBootstrapForm"
                          (submitAction)="generate()">Generate</cd-submit-button>

        <div class="form-group">
          <label class="col-form-label"
                 for="token">
            <span i18n>Token</span>
          </label>
          <textarea class="form-control resize-vertical"
                    placeholder="Generated token..."
                    i18n-placeholder
                    id="token"
                    formControlName="token"
                    readonly>
          </textarea>
        </div>
        <cd-copy-2-clipboard-button class="float-right"
                                    source="token">
        </cd-copy-2-clipboard-button>
      </div>

      <div class="modal-footer">
        <cd-back-button (backAction)="activeModal.close()"
                        name="Close"
                        i18n-name>
        </cd-back-button>
      </div>
    </form>
  </ng-container>
</cd-modal>