1 <ng-template #matcherTpl
4 <div class=
"input-group my-2">
5 <ng-container *
ngFor=
"let config of matcherConfig">
6 <div class=
"input-group-prepend">
7 <span class=
"input-group-text"
8 [ngbTooltip]=
"config.tooltip">
9 <i [ngClass]=
"[config.icon]"></i>
13 <ng-container *
ngIf=
"config.attribute !== 'isRegex'">
15 id=
"matcher-{{config.attribute}}-{{index}}"
17 [value]=
"matcher[config.attribute]"
22 <ng-container *
ngIf=
"config.attribute === 'isRegex'">
23 <div class=
"input-group-append">
24 <div class=
"input-group-text">
25 <input type=
"checkbox"
26 id=
"matcher-{{config.attribute}}-{{index}}"
27 [checked]=
"matcher[config.attribute]"
35 <!-- Matcher actions -->
36 <span class=
"input-group-append">
39 id=
"matcher-edit-{{index}}"
42 (click)=
"showMatcherModal(index)">
43 <i [ngClass]=
"[icons.edit]"></i>
47 id=
"matcher-delete-{{index}}"
50 (click)=
"deleteMatcher(index)">
51 <i [ngClass]=
"[icons.trash]"></i>
55 <span class=
"help-block"></span>
58 <div class=
"cd-col-form">
59 <form #
formDir=
"ngForm"
65 <div class=
"card-header">
66 <span i18n
>{{ action | titlecase }} {{ resource | upperFirst }}
</span>
67 <cd-helper *
ngIf=
"edit"
68 i18n
>Editing a silence will expire the old silence and recreate it as a new silence
</cd-helper>
72 <div class=
"card-body">
73 <div class=
"form-group row">
74 <label class=
"cd-col-form-label required"
77 <div class=
"cd-col-form-input">
78 <input class=
"form-control"
79 formControlName=
"createdBy"
83 <span *
ngIf=
"form.showError('createdBy', formDir, 'required')"
84 class=
"invalid-feedback"
85 i18n
>This field is required!
</span>
90 <div class=
"form-group row">
91 <label class=
"cd-col-form-label required"
94 <div class=
"cd-col-form-input">
95 <textarea class=
"form-control"
96 formControlName=
"comment"
101 <span *
ngIf=
"form.showError('comment', formDir, 'required')"
102 class=
"invalid-feedback"
103 i18n
>This field is required!
</span>
108 <div class=
"form-group row">
109 <label class=
"cd-col-form-label"
111 <span class=
"required"
112 i18n
>Start time
</span>
113 <cd-helper i18n
>If the start time lies in the past the creation time will be used
</cd-helper>
115 <div class=
"cd-col-form-input">
116 <input class=
"form-control"
117 formControlName=
"startsAt"
118 [ngbPopover]=
"popStart"
122 (keypress)=
"ps.close()">
123 <span *
ngIf=
"form.showError('startsAt', formDir, 'required')"
124 class=
"invalid-feedback"
125 i18n
>This field is required!
</span>
130 <div class=
"form-group row">
131 <label class=
"cd-col-form-label required"
133 i18n
>Duration
</label>
134 <div class=
"cd-col-form-input">
135 <input class=
"form-control"
136 formControlName=
"duration"
140 <span *
ngIf=
"form.showError('duration', formDir, 'required')"
141 class=
"invalid-feedback"
142 i18n
>This field is required!
</span>
147 <div class=
"form-group row">
148 <label class=
"cd-col-form-label required"
150 i18n
>End time
</label>
151 <div class=
"cd-col-form-input">
152 <input class=
"form-control"
153 formControlName=
"endsAt"
154 [ngbPopover]=
"popEnd"
158 (keypress)=
"pe.close()">
159 <span *
ngIf=
"form.showError('endsAt', formDir, 'required')"
160 class=
"invalid-feedback"
161 i18n
>This field is required!
</span>
167 <legend class=
"required"
168 i18n
>Matchers
</legend>
170 <div class=
"cd-col-form-offset">
171 <h5 *
ngIf=
"matchers.length === 0"
172 [ngClass]=
"{'text-warning': !formDir.submitted, 'text-danger': formDir.submitted}">
173 <strong i18n
>A silence requires at least one matcher
</strong>
176 <span *
ngFor=
"let matcher of matchers; let i=index;">
177 <ng-container *
ngTemplateOutlet=
"matcherTpl; context:{index: i, matcher: matcher}"></ng-container>
182 <button type=
"button"
184 class=
"btn btn-light float-right my-3"
185 [ngClass]=
"{'btn-warning': formDir.submitted && matchers.length === 0 }"
186 (click)=
"showMatcherModal()">
187 <i [ngClass]=
"[icons.add]"></i>
188 <ng-container i18n
>Add matcher
</ng-container>
194 <div *
ngIf=
"matchers.length && matcherMatch"
195 class=
"cd-col-form-offset {{matcherMatch.cssClass}}"
197 <span class=
"text-muted {{matcherMatch.cssClass}}">
198 {{ matcherMatch.status }}
204 <div class=
"card-footer">
205 <div class=
"text-right">
206 <cd-form-button-panel (submitActionEvent)=
"submit()"
208 [submitText]=
"(action | titlecase) + ' ' + (resource | upperFirst)"></cd-form-button-panel>
215 <ng-template #popStart
>
216 <cd-date-time-picker [control]=
"form.get('startsAt')"
217 [hasSeconds]=
"false"></cd-date-time-picker>
221 <ng-template #popEnd
>
222 <cd-date-time-picker [control]=
"form.get('endsAt')"
223 [hasSeconds]=
"false"></cd-date-time-picker>