]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
ba55c9f2a4dabc74bebb00830bcfdac9ae2813f5
[ceph.git] /
1 <cds-modal size="md"
2            [open]="open"
3            (overalSelected)="closeModal()">
4
5   <cds-modal-header (closeSelect)="closeModal()">
6     <h3 cdsModalHeaderHeading
7         i18n>{{ action | titlecase }} {{ resource | upperFirst }}</h3>
8   </cds-modal-header>
9
10   <section cdsModalContent>
11     <form name="snapshotForm"
12           #formDir="ngForm"
13           [formGroup]="snapshotForm"
14           novalidate>
15       <!-- Name -->
16       <div class="form-item">
17         <cds-text-label label="Name"
18                         i18n-label
19                         for="snapshotName"
20                         i18n
21                         cdRequiredField="Name"
22                         [invalid]="snapshotForm.controls['snapshotName'].invalid && (snapshotForm.controls['snapshotName'].dirty)"
23                         [invalidText]="snapshotError">
24           <input cdsText
25                  type="text"
26                  placeholder="Snapshot name..."
27                  id="snapshotName"
28                  name="snapshotName"
29                  formControlName="snapshotName"
30                  [attr.disabled]="((mirroring === 'snapshot') ? true : null) && (snapshotForm.getValue('mirrorImageSnapshot') === true) ? true: null"
31                  [invalid]="snapshotForm.controls['snapshotName'].invalid && (snapshotForm.controls['snapshotName'].dirty)"
32                  autofocus>
33           <span *ngIf="((mirroring === 'snapshot') ? true : null) && (snapshotForm.getValue('mirrorImageSnapshot') === true) ? true: null">
34             Snapshot mode is enabled on image <b>{{ imageName }}</b>: snapshot names are auto generated</span>
35         </cds-text-label>
36         <ng-template #snapshotError>
37           <span *ngIf="snapshotForm.showError('snapshotName', formDir, 'required')"
38                 class="invalid-feedback"
39                 i18n>This field is required.</span>
40           <span *ngIf="snapshotForm.showError('snapshotName', formDir, 'pattern')"
41                 class="invalid-feedback"
42                 i18n>The snapshot name cannot start with "." and cannot contain "/" and "@".</span>
43         </ng-template>
44       </div>
45
46       <ng-container *ngIf="mirroring === 'snapshot'">
47         <div class="form-item"
48              *ngIf="peerConfigured$ | async as peerConfigured">
49           <cds-checkbox id="mirrorImageSnapshot"
50                         formControlName="mirrorImageSnapshot"
51                         name="mirrorImageSnapshot"
52                         (checkedChange)="onMirrorCheckBoxChange()"
53                         [attr.disabled]="!peerConfigured.length > 0 ? true : null"
54                         i18n>Mirror Image Snapshot
55           </cds-checkbox>
56         </div>
57       </ng-container>
58     </form>
59   </section>
60   <cd-form-button-panel (submitActionEvent)="submit()"
61                         [form]="snapshotForm"
62                         [submitText]="(action | titlecase) + ' ' + (resource | upperFirst)"
63                         [modalForm]="true"></cd-form-button-panel>
64 </cds-modal>