forked from apache/ambari
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_alert_notification.hbs
362 lines (298 loc) · 15.9 KB
/
create_alert_notification.hbs
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}
<div id="create-edit-alert-notification row">
<form autocomplete="off" class="form-horizontal">
{{! alert-notification name }}
<div {{bindAttr class=":form-group controller.inputFields.name.errorMsg:has-error"}}>
<label class="control-label col-md-2" for="inputName">{{controller.inputFields.name.label}}</label>
<div class="col-md-10">
{{view Em.TextField valueBinding="controller.inputFields.name.value" id="inputName" classNames="form-control"}}
</div>
{{#if controller.inputFields.name.errorMsg}}
<div class="col-md-10 col-md-offset-2 help-block validation-block error-msg">
{{controller.inputFields.name.errorMsg}}
</div>
{{/if}}
</div>
{{! alert-notification name end }}
{{! alert-notification groups }}
<div class="form-group">
<label class="control-label col-md-2" for="inputGroups">{{controller.inputFields.groups.label}}</label>
<div class="col-md-10">
{{view App.RadioButtonView name="allGroups" selectionBinding="controller.inputFields.allGroups.value"
classNames="radio" labelTranslate="common.all" value="all"}}
{{view App.RadioButtonView name="allGroups" selectionBinding="controller.inputFields.allGroups.value"
classNames="radio" labelTranslate="common.custom" value="custom"}}
<div>
{{view view.groupsSelectView multiple="true" id="inputGroups" class="form-control"
disabledBinding="controller.inputFields.allGroups.isAll"
selectionBinding="controller.inputFields.groups.value"
contentBinding="controller.allAlertGroups"
optionLabelPath="content.displayName"
}}
</div>
<div>
<a href="#" {{action selectAllGroups target="view"}} {{bindAttr class="controller.inputFields.allGroups.isAll:disabled view.allGroupsSelected:disabled"}}>{{t alerts.actions.manage_alert_notifications_popup.selectAll}}</a> |
<a href="#" {{action clearAllGroups target="view"}} {{bindAttr class="controller.inputFields.allGroups.isAll:disabled view.noneGroupsSelected:disabled"}}>{{t alerts.actions.manage_alert_notifications_popup.clearAll}}</a>
</div>
</div>
</div>
{{! alert-notification groups end }}
{{! alert-notification severity }}
<div class="form-group">
<label class="control-label col-md-2">{{controller.inputFields.severityFilter.label}}</label>
<div class="col-md-10">
<div>
{{view view.severitySelectView multiple="true" id="inputSeverity" class="form-control"
selectionBinding="controller.inputFields.severityFilter.value"
contentBinding="controller.severities"
}}
</div>
<div>
<a href="#" {{action selectAllSeverity target="view"}} {{bindAttr class="view.allSeveritySelected:disabled"}}>{{t alerts.actions.manage_alert_notifications_popup.selectAll}}</a> |
<a href="#" {{action clearAllSeverity target="view"}} {{bindAttr class="view.noneSeveritySelected:disabled"}}>{{t alerts.actions.manage_alert_notifications_popup.clearAll}}</a>
</div>
</div>
</div>
{{! alert-notification severity end }}
{{! alert-notification description }}
<div class="form-group">
<label class="control-label col-md-2" for="inputDescription">{{controller.inputFields.description.label}}</label>
<div class="col-md-10">
{{view Em.TextArea valueBinding="controller.inputFields.description.value" id="inputDescription" rows="4" class="form-control"}}
</div>
</div>
{{! alert-notification description end }}
{{! alert-notification method }}
<div class="form-group">
<label class="control-label col-md-2" for="inputMethod">{{controller.inputFields.method.label}}</label>
<div class="col-md-10">
{{view Em.Select contentBinding="controller.methods" selectionBinding="controller.inputFields.method.value" id="inputMethod" classNames="form-control"}}
</div>
</div>
{{! alert-notification method end }}
{{! alert-notification email }}
{{#if view.isEmailMethodSelected}}
<div {{bindAttr class=":form-group controller.inputFields.email.errorMsg:has-error"}}>
<label class="control-label col-md-2" for="inputEmail">{{controller.inputFields.email.label}}</label>
<div class="col-md-10">
{{view Em.TextField valueBinding="controller.inputFields.email.value" id="inputEmail" classNames="form-control"}}
</div>
{{#if controller.inputFields.email.errorMsg}}
<div class="col-md-10 col-md-offset-2 help-block validation-block error-msg">
{{controller.inputFields.email.errorMsg}}
</div>
{{/if}}
</div>
<div class="form-group">
<label class="control-label col-md-2">{{controller.inputFields.SMTPServer.label}}</label>
<div class="col-md-10">
{{view Em.TextField valueBinding="controller.inputFields.SMTPServer.value" classNames="form-control"}}
</div>
</div>
<div {{bindAttr class=":form-group controller.inputFields.SMTPPort.errorMsg:has-error"}}>
<label class="control-label col-md-2">{{controller.inputFields.SMTPPort.label}}</label>
<div class="col-md-10">
{{view Em.TextField valueBinding="controller.inputFields.SMTPPort.value" classNames="form-control"}}
</div>
{{#if controller.inputFields.SMTPPort.errorMsg}}
<div class="col-md-10 col-md-offset-2 help-block validation-block error-msg">
{{controller.inputFields.SMTPPort.errorMsg}}
</div>
{{/if}}
</div>
<div {{bindAttr class=":form-group controller.inputFields.emailFrom.errorMsg:has-error"}}>
<label class="control-label col-md-2">{{controller.inputFields.emailFrom.label}}</label>
<div class="col-md-10">
{{view Em.TextField valueBinding="controller.inputFields.emailFrom.value" classNames="form-control"}}
</div>
{{#if controller.inputFields.emailFrom.errorMsg}}
<div class="col-md-10 col-md-offset-2 help-block validation-block error-msg">
{{controller.inputFields.emailFrom.errorMsg}}
</div>
{{/if}}
</div>
{{#view App.CheckboxView classNames="form-group"
isCustomTemplate="true"
checkedBinding="controller.inputFields.SMTPUseAuthentication.value"}}
<label class="control-label col-md-2 inputUseAuthentication" {{bindAttr for="view.checkboxId"}}>{{controller.inputFields.SMTPUseAuthentication.label}}</label>
<div class="col-md-10">
{{view view.checkboxView customCheckboxId="inputUseAuthentication" labelAlign="left"}}
{{view view.labelView}}
</div>
{{/view}}
<div {{bindAttr class=":form-group controller.inputFields.SMTPUsername.errorMsg:has-error"}}>
<label class="control-label col-md-2">{{controller.inputFields.SMTPUsername.label}}</label>
<div class="col-md-10">
{{view Em.TextField disabledBinding="controller.inputFields.SMTPUseAuthentication.invertedValue" valueBinding="controller.inputFields.SMTPUsername.value" classNames="form-control"}}
</div>
{{#if controller.inputFields.SMTPUsername.errorMsg}}
<div class="col-md-10 col-md-offset-2 help-block validation-block error-msg">
{{controller.inputFields.SMTPUsername.errorMsg}}
</div>
{{/if}}
</div>
<div {{bindAttr class=":form-group controller.inputFields.SMTPPassword.errorMsg:has-error"}}>
<label class="control-label col-md-2">{{controller.inputFields.SMTPPassword.label}}</label>
<div class="col-md-10">
{{view Em.TextField type="password" disabledBinding="controller.inputFields.SMTPUseAuthentication.invertedValue" valueBinding="controller.inputFields.SMTPPassword.value" classNames="form-control"}}
</div>
{{#if controller.inputFields.SMTPPassword.errorMsg}}
<div class="col-md-10 col-md-offset-2 help-block validation-block error-msg">
{{controller.inputFields.SMTPPassword.errorMsg}}
</div>
{{/if}}
</div>
<div {{bindAttr class=":form-group controller.inputFields.retypeSMTPPassword.errorMsg:has-error"}}>
<label class="control-label col-md-2">{{controller.inputFields.retypeSMTPPassword.label}}</label>
<div class="col-md-10">
{{view Em.TextField type="password" disabledBinding="controller.inputFields.SMTPUseAuthentication.invertedValue" valueBinding="controller.inputFields.retypeSMTPPassword.value" classNames="form-control"}}
</div>
{{#if controller.inputFields.retypeSMTPPassword.errorMsg}}
<div class="col-md-10 col-md-offset-2 help-block validation-block error-msg">
{{controller.inputFields.retypeSMTPPassword.errorMsg}}
</div>
{{/if}}
</div>
<div class="form-group">
<label class="control-label col-md-2" for="inputSMTPSTARTTLS">{{controller.inputFields.SMTPSTARTTLS.label}}</label>
<div class="col-md-10">
{{view App.CheckboxView disabledBinding="controller.inputFields.SMTPUseAuthentication.invertedValue" checkedBinding="controller.inputFields.SMTPSTARTTLS.value" id="inputSMTPSTARTTLS"}}
</div>
</div>
{{/if}}
{{! alert-notification email end }}
{{! alert-notification SNMP }}
{{#if view.isSNMPMethodSelected}}
<div class="form-group">
<label class="control-label col-md-2">{{controller.inputFields.version.label}}</label>
<div class="col-md-10">
{{view Em.Select selectionBinding="controller.inputFields.version.value" contentBinding="controller.SNMPVersions" classNames="form-control"}}
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2">{{controller.inputFields.community.label}}</label>
<div class="col-md-10">
{{view Em.TextField valueBinding="controller.inputFields.community.value" classNames="form-control"}}
</div>
</div>
<div {{bindAttr class=":form-group controller.inputFields.host.errorMsg:has-error"}}>
<label class="control-label col-md-2">{{controller.inputFields.host.label}}</label>
<div class="col-md-10">
{{view Em.TextField valueBinding="controller.inputFields.host.value" classNames="form-control"}}
</div>
{{#if controller.inputFields.host.errorMsg}}
<div class="col-md-10 col-md-offset-2 help-block validation-block error-msg">
{{controller.inputFields.host.errorMsg}}
</div>
{{/if}}
</div>
<div {{bindAttr class=":form-group controller.inputFields.port.errorMsg:has-error"}}>
<label class="control-label col-md-2">{{controller.inputFields.port.label}}</label>
<div class="col-md-10">
{{view Em.TextField valueBinding="controller.inputFields.port.value" classNames="form-control"}}
</div>
{{#if controller.inputFields.port.errorMsg}}
<div class="col-md-10 col-md-offset-2 help-block validation-block error-msg">
{{controller.inputFields.port.errorMsg}}
</div>
{{/if}}
</div>
{{/if}}
{{! alert-notification SNMP end }}
{{! alert-notification Custom SNMP }}
{{#if view.isCustomSNMPMethodSelected}}
<div class="form-group">
<label class="control-label col-md-2">{{controller.inputFields.version.label}}</label>
<div class="col-md-10">
{{view Em.Select selectionBinding="controller.inputFields.version.value" contentBinding="controller.SNMPVersions" classNames="form-control"}}
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2">{{controller.inputFields.OIDs.label}}</label>
<div class="col-md-10">
{{view Em.TextField valueBinding="controller.inputFields.OIDs.value" classNames="form-control"}}
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2">{{controller.inputFields.community.label}}</label>
<div class="col-md-10">
{{view Em.TextField valueBinding="controller.inputFields.community.value" classNames="form-control"}}
</div>
</div>
<div {{bindAttr class=":form-group controller.inputFields.host.errorMsg:has-error"}}>
<label class="control-label col-md-2">{{controller.inputFields.host.label}}</label>
<div class="col-md-10">
{{view Em.TextField valueBinding="controller.inputFields.host.value" classNames="form-control"}}
</div>
{{#if controller.inputFields.host.errorMsg}}
<div class="col-md-10 col-md-offset-2 help-block validation-block error-msg">
{{controller.inputFields.host.errorMsg}}
</div>
{{/if}}
</div>
<div {{bindAttr class=":form-group controller.inputFields.port.errorMsg:has-error"}}>
<label class="control-label col-md-2">{{controller.inputFields.port.label}}</label>
<div class="col-md-10">
{{view Em.TextField valueBinding="controller.inputFields.port.value" classNames="form-control"}}
</div>
{{#if controller.inputFields.port.errorMsg}}
<div class="col-md-10 col-md-offset-2 help-block validation-block error-msg">
{{controller.inputFields.port.errorMsg}}
</div>
{{/if}}
</div>
{{/if}}
{{! alert-notification Custom SNMP end }}
{{! alert-notification Alert Script }}
{{#if view.isAlertScriptMethodSelected}}
<div {{bindAttr class=":form-group controller.inputFields.scriptFileName.errorMsg:has-error"}}>
<label class="control-label col-md-2">{{controller.inputFields.scriptFileName.label}}</label>
<div class="col-md-10">
{{view Em.TextField valueBinding="controller.inputFields.scriptFileName.value" class="form-control"}}
</div>
{{#if controller.inputFields.scriptFileName.errorMsg}}
<div class="col-md-10 col-md-offset-2 help-block validation-block error-msg">
{{controller.inputFields.scriptFileName.errorMsg}}
</div>
{{/if}}
</div>
<div class="form-group">
<label class="control-label col-md-2">{{controller.inputFields.scriptDispatchProperty.label}}</label>
<div class="col-md-10">
{{view Em.TextField valueBinding="controller.inputFields.scriptDispatchProperty.value" class="form-control"}}
</div>
</div>
{{/if}}
{{! alert-notification Alert Script end}}
{{! alert-notification custom properties }}
{{#each customProperty in controller.inputFields.customProperties}}
<div class="form-group">
<label class="control-label col-md-2" for="inputGroups">{{customProperty.name}}</label>
<div class="col-md-9">
{{view Em.TextField valueBinding="customProperty.value" classNames="form-control"}}
</div>
<div class="col-md-1">
<a href="#" {{action "removeCustomPropertyHandler" customProperty target="controller"}} class="btn-sm"><span class="icon-minus-sign"></span></a>
</div>
</div>
{{/each}}
{{! alert-notification custom properties end }}
<a href="#" class="add-custom-property" {{action addCustomPropertyHandler target="controller"}}>{{t installer.step7.config.addProperty}} ...</a>
</form>
</div>