|
6 | 6 | </navbar>
|
7 | 7 |
|
8 | 8 | <div class="page-container" >
|
9 |
| - <div class="page-header"> |
10 |
| - <h1>Alert notification</h1> |
| 9 | + <div class="page-header"> |
| 10 | + <h1>Alert notification</h1> |
11 | 11 | </div>
|
12 | 12 |
|
13 |
| - <div class="gf-form-group"> |
14 |
| - <div class="gf-form"> |
15 |
| - <span class="gf-form-label width-12">Name</span> |
16 |
| - <input type="text" class="gf-form-input max-width-15" ng-model="ctrl.model.name" required></input> |
17 |
| - </div> |
18 |
| - <div class="gf-form"> |
19 |
| - <span class="gf-form-label width-12">Type</span> |
20 |
| - <div class="gf-form-select-wrapper width-15"> |
21 |
| - <select class="gf-form-input" |
22 |
| - ng-model="ctrl.model.type" |
23 |
| - ng-options="t for t in ['webhook', 'email', 'slack']" |
24 |
| - ng-change="ctrl.typeChanged(notification, $index)"> |
25 |
| - </select> |
26 |
| - </div> |
27 |
| - </div> |
28 |
| - <div class="gf-form"> |
29 |
| - <gf-form-switch |
30 |
| - class="gf-form" |
31 |
| - label="Send on all alerts" |
32 |
| - label-class="width-12" |
33 |
| - checked="ctrl.model.isDefault" |
34 |
| - tooltip="Use this notification for all alerts"> |
35 |
| - </gf-form-switch> |
36 |
| - </div> |
37 |
| - </div> |
| 13 | + <form name="ctrl.theForm"> |
| 14 | + <div class="gf-form-group"> |
| 15 | + <div class="gf-form"> |
| 16 | + <span class="gf-form-label width-12">Name</span> |
| 17 | + <input type="text" required class="gf-form-input max-width-15" ng-model="ctrl.model.name" required></input> |
| 18 | + </div> |
| 19 | + <div class="gf-form"> |
| 20 | + <span class="gf-form-label width-12">Type</span> |
| 21 | + <div class="gf-form-select-wrapper width-15"> |
| 22 | + <select class="gf-form-input" ng-model="ctrl.model.type" ng-options="t for t in ['webhook', 'email', 'slack']" ng-change="ctrl.typeChanged(notification, $index)"> |
| 23 | + </select> |
| 24 | + </div> |
| 25 | + </div> |
| 26 | + <div class="gf-form"> |
| 27 | + <gf-form-switch class="gf-form" label="Send on all alerts" label-class="width-12" checked="ctrl.model.isDefault" tooltip="Use this notification for all alerts"> |
| 28 | + </gf-form-switch> |
| 29 | + </div> |
| 30 | + </div> |
38 | 31 |
|
39 |
| - <div class="gf-form-group" ng-show="ctrl.model.type === 'webhook'"> |
40 |
| - <h3 class="page-heading">Webhook settings</h3> |
41 |
| - <div class="gf-form"> |
42 |
| - <span class="gf-form-label width-6">Url</span> |
43 |
| - <input type="text" class="gf-form-input max-width-26" ng-model="ctrl.model.settings.url"></input> |
44 |
| - </div> |
45 |
| - <div class="gf-form-inline"> |
46 |
| - <div class="gf-form"> |
47 |
| - <span class="gf-form-label width-6">Username</span> |
48 |
| - <input type="text" class="gf-form-input max-width-10" ng-model="ctrl.model.settings.username"></input> |
49 |
| - </div> |
50 |
| - <div class="gf-form"> |
51 |
| - <span class="gf-form-label width-6">Password</span> |
52 |
| - <input type="text" class="gf-form-input max-width-10" ng-model="ctrl.model.settings.password"></input> |
53 |
| - </div> |
54 |
| - </div> |
55 |
| - </div> |
| 32 | + <div class="gf-form-group" ng-if="ctrl.model.type === 'webhook'"> |
| 33 | + <h3 class="page-heading">Webhook settings</h3> |
| 34 | + <div class="gf-form"> |
| 35 | + <span class="gf-form-label width-6">Url</span> |
| 36 | + <input type="text" required class="gf-form-input max-width-26" ng-model="ctrl.model.settings.url"></input> |
| 37 | + </div> |
| 38 | + <div class="gf-form-inline"> |
| 39 | + <div class="gf-form"> |
| 40 | + <span class="gf-form-label width-6">Username</span> |
| 41 | + <input type="text" class="gf-form-input max-width-10" ng-model="ctrl.model.settings.username"></input> |
| 42 | + </div> |
| 43 | + <div class="gf-form"> |
| 44 | + <span class="gf-form-label width-6">Password</span> |
| 45 | + <input type="text" class="gf-form-input max-width-10" ng-model="ctrl.model.settings.password"></input> |
| 46 | + </div> |
| 47 | + </div> |
| 48 | + </div> |
56 | 49 |
|
57 |
| - <div class="gf-form-group" ng-show="ctrl.model.type === 'slack'"> |
58 |
| - <h3 class="page-heading">Slack settings</h3> |
59 |
| - <div class="gf-form"> |
60 |
| - <span class="gf-form-label width-6">Url</span> |
61 |
| - <input type="text" class="gf-form-input max-width-30" ng-model="ctrl.model.settings.url" placeholder="Slack incoming webhook url"></input> |
62 |
| - </div> |
63 |
| - </div> |
| 50 | + <div class="gf-form-group" ng-if="ctrl.model.type === 'slack'"> |
| 51 | + <h3 class="page-heading">Slack settings</h3> |
| 52 | + <div class="gf-form"> |
| 53 | + <span class="gf-form-label width-6">Url</span> |
| 54 | + <input type="text" required class="gf-form-input max-width-30" ng-model="ctrl.model.settings.url" placeholder="Slack incoming webhook url"></input> |
| 55 | + </div> |
| 56 | + </div> |
64 | 57 |
|
65 |
| - <div class="gf-form-group section" ng-show="ctrl.model.type === 'email'"> |
66 |
| - <h3 class="page-heading">Email addresses</h3> |
67 |
| - <div class="gf-form"> |
68 |
| - <textarea rows="7" class="gf-form-input width-25" ng-model="ctrl.model.settings.addresses"></textarea> |
69 |
| - </div> |
70 |
| - </div> |
| 58 | + <div class="gf-form-group section" ng-if="ctrl.model.type === 'email'"> |
| 59 | + <h3 class="page-heading">Email addresses</h3> |
| 60 | + <div class="gf-form"> |
| 61 | + <textarea rows="7" class="gf-form-input width-25" required ng-model="ctrl.model.settings.addresses"></textarea> |
| 62 | + </div> |
| 63 | + </div> |
71 | 64 |
|
72 |
| - <div class="gf-form-group"> |
73 |
| - <div class="gf-form-inline"> |
74 |
| - <div class="gf-form width-6"> |
75 |
| - <button ng-click="ctrl.save()" class="btn btn-success">Save</button> |
76 |
| - </div> |
77 |
| - <div class="gf-form width-20"> |
78 |
| - <div class="gf-form" ng-show="ctrl.showTest"> |
79 |
| - <button ng-click="ctrl.testNotification()" class="btn btn-secondary">Send</button> |
80 |
| - </div> |
81 |
| - </div> |
82 |
| - </div> |
| 65 | + <div class="gf-form-group"> |
| 66 | + <div class="gf-form-inline"> |
| 67 | + <div class="gf-form width-6"> |
| 68 | + <button type="submit" ng-click="ctrl.save()" class="btn btn-success">Save</button> |
| 69 | + </div> |
| 70 | + <div class="gf-form width-20"> |
| 71 | + <div class="gf-form"> |
| 72 | + <button type="submit" ng-click="ctrl.testNotification()" class="btn btn-secondary">Send Test</button> |
| 73 | + </div> |
| 74 | + </div> |
| 75 | + </div> |
| 76 | + </div> |
| 77 | + </form> |
83 | 78 | </div>
|
0 commit comments