]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/blob
e6e4764b73ff8f1ed86263ccd6787e84b7666d0b
[ceph.git] /
1 <cd-modal [modalRef]="bsModalRef">
2   <ng-container class="modal-title"
3                 i18n>Matcher</ng-container>
4
5   <ng-container class="modal-content">
6     <form class="form"
7           #formDir="ngForm"
8           [formGroup]="form"
9           novalidate>
10       <div class="modal-body">
11         <!-- Name -->
12         <div class="form-group row">
13           <label class="cd-col-form-label required"
14                  for="name"
15                  i18n>Name</label>
16           <div class="cd-col-form-input">
17             <select class="form-control"
18                     id="name"
19                     formControlName="name"
20                     name="name">
21               <option [ngValue]="null"
22                       i18n>-- Select an attribute to match against --</option>
23               <option *ngFor="let attribute of nameAttributes"
24                       [value]="attribute">
25                 {{ attribute }}
26               </option>
27             </select>
28             <span class="help-block"
29                   *ngIf="form.showError('name', formDir, 'required')"
30                   i18n>This field is required!</span>
31           </div>
32         </div>
33
34         <!-- Value -->
35         <div class="form-group row">
36           <label class="cd-col-form-label required"
37                  for="value"
38                  i18n>Value</label>
39           <div class="cd-col-form-input">
40             <input id="value"
41                    class="form-control"
42                    type="text"
43                    [typeahead]="possibleValues"
44                    [typeaheadMinLength]="0"
45                    formControlName="value">
46             <span *ngIf="form.showError('value', formDir, 'required')"
47                   class="help-block"
48                   i18n>This field is required!</span>
49           </div>
50           <div *ngIf="form.getValue('value') && !form.getValue('isRegex') && matcherMatch"
51                class="cd-col-form-offset {{matcherMatch.cssClass}}"
52                id="match-state">
53             <span class="text-muted {{matcherMatch.cssClass}}">
54               {{matcherMatch.status}}
55             </span>
56           </div>
57         </div>
58
59         <!-- isRegex -->
60         <div class="form-group row">
61           <div class="cd-col-form-offset">
62             <div class="custom-control custom-checkbox">
63               <input type="checkbox"
64                      class="custom-control-input"
65                      formControlName="isRegex"
66                      name="is-regex"
67                      id="is-regex">
68               <label for="is-regex"
69                      class="custom-control-label"
70                      i18n>Use regular expression</label>
71             </div>
72           </div>
73         </div>
74       </div>
75
76       <div class="modal-footer">
77         <cd-submit-button (submitAction)="onSubmit()"
78                           [form]="form">
79           <ng-container i18n>{editMode, select, 1 {Update} other {Add}}</ng-container>
80         </cd-submit-button>
81         <cd-back-button [back]="bsModalRef.hide"
82                         name="Close"
83                         i18n-name>
84         </cd-back-button>
85       </div>
86     </form>
87   </ng-container>
88 </cd-modal>