]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/blob
b0c1798b99311d7cf68a5393d85deb687ab992b5
[ceph.git] /
1 <cd-modal [modalRef]="activeModal">
2   <span class="modal-title"
3         i18n>{editMode, select, true {Edit} other {Add}} Matcher</span>
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                    (focus)="valueFocus.next($any($event).target.value)"
42                    (click)="valueClick.next($any($event).target.value)"
43                    container="body"
44                    class="form-control"
45                    type="text"
46                    [ngbTypeahead]="search"
47                    formControlName="value">
48             <span *ngIf="form.showError('value', formDir, 'required')"
49                   class="help-block"
50                   i18n>This field is required!</span>
51           </div>
52           <div *ngIf="form.getValue('value') && !form.getValue('isRegex') && matcherMatch"
53                class="cd-col-form-offset {{matcherMatch.cssClass}}"
54                id="match-state">
55             <span class="text-muted {{matcherMatch.cssClass}}">
56               {{matcherMatch.status}}
57             </span>
58           </div>
59         </div>
60
61         <!-- isRegex -->
62         <div class="form-group row">
63           <div class="cd-col-form-offset">
64             <div class="custom-control custom-checkbox">
65               <input type="checkbox"
66                      class="custom-control-input"
67                      formControlName="isRegex"
68                      name="is-regex"
69                      id="is-regex">
70               <label for="is-regex"
71                      class="custom-control-label"
72                      i18n>Use regular expression</label>
73             </div>
74           </div>
75         </div>
76       </div>
77
78       <div class="modal-footer">
79         <cd-submit-button (submitAction)="onSubmit()"
80                           [form]="form">
81           <span i18n>{editMode, select, true {Edit} other {Add}}</span>
82         </cd-submit-button>
83         <cd-back-button (backAction)="activeModal.close()"
84                         name="Close"
85                         i18n-name>
86         </cd-back-button>
87       </div>
88     </form>
89   </ng-container>
90 </cd-modal>