notification_edit.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <navbar icon="icon-gf icon-gf-alert" title="Alerting" title-url="alerting">
  2. <a href="alerting/notifications" class="navbar-page-btn">
  3. <i class="fa fa-fw fa-envelope-o"></i>
  4. Notifications
  5. </a>
  6. </navbar>
  7. <div class="page-container" >
  8. <div class="page-header">
  9. <h1>Alert notification</h1>
  10. </div>
  11. <form name="ctrl.theForm">
  12. <div class="gf-form-group">
  13. <div class="gf-form">
  14. <span class="gf-form-label width-12">Name</span>
  15. <input type="text" required class="gf-form-input max-width-15" ng-model="ctrl.model.name" required></input>
  16. </div>
  17. <div class="gf-form">
  18. <span class="gf-form-label width-12">Type</span>
  19. <div class="gf-form-select-wrapper width-15">
  20. <select class="gf-form-input" ng-model="ctrl.model.type" ng-options="t for t in ['webhook', 'email', 'slack', 'pagerduty', 'victorops', 'opsgenie', 'telegram']" ng-change="ctrl.typeChanged(notification, $index)">
  21. </select>
  22. </div>
  23. </div>
  24. <div class="gf-form">
  25. <gf-form-switch
  26. class="gf-form"
  27. label="Send on all alerts"
  28. label-class="width-12"
  29. checked="ctrl.model.isDefault"
  30. tooltip="Use this notification for all alerts">
  31. </gf-form-switch>
  32. </div>
  33. </div>
  34. <div class="gf-form-group" ng-if="ctrl.model.type === 'webhook'">
  35. <h3 class="page-heading">Webhook settings</h3>
  36. <div class="gf-form">
  37. <span class="gf-form-label width-10">Url</span>
  38. <input type="text" required class="gf-form-input max-width-26" ng-model="ctrl.model.settings.url"></input>
  39. </div>
  40. <div class="gf-form">
  41. <span class="gf-form-label width-10">Http Method</span>
  42. <div class="gf-form-select-wrapper width-14">
  43. <select class="gf-form-input" ng-model="ctrl.model.settings.httpMethod" ng-options="t for t in ['POST', 'PUT']">
  44. </select>
  45. </div>
  46. </div>
  47. <div class="gf-form">
  48. <span class="gf-form-label width-10">Username</span>
  49. <input type="text" class="gf-form-input max-width-14" ng-model="ctrl.model.settings.username"></input>
  50. </div>
  51. <div class="gf-form">
  52. <span class="gf-form-label width-10">Password</span>
  53. <input type="text" class="gf-form-input max-width-14" ng-model="ctrl.model.settings.password"></input>
  54. </div>
  55. </div>
  56. <div class="gf-form-group" ng-if="ctrl.model.type === 'slack'">
  57. <h3 class="page-heading">Slack settings</h3>
  58. <div class="gf-form max-width-30">
  59. <span class="gf-form-label width-6">Url</span>
  60. <input type="text" required class="gf-form-input max-width-30" ng-model="ctrl.model.settings.url" placeholder="Slack incoming webhook url"></input>
  61. </div>
  62. <div class="gf-form max-width-30">
  63. <span class="gf-form-label width-6">Recipient</span>
  64. <input type="text"
  65. class="gf-form-input max-width-30"
  66. ng-model="ctrl.model.settings.recipient"
  67. data-placement="right">
  68. </input>
  69. <info-popover mode="right-absolute">
  70. Override default channel or user, use #channel-name or @username
  71. </info-popover>
  72. </div>
  73. <div class="gf-form max-width-30">
  74. <span class="gf-form-label width-6">Mention</span>
  75. <input type="text"
  76. class="gf-form-input max-width-30"
  77. ng-model="ctrl.model.settings.mention"
  78. data-placement="right">
  79. </input>
  80. <info-popover mode="right-absolute">
  81. Mention a user or a group using @ when notifying in a channel
  82. </info-popover>
  83. </div>
  84. </div>
  85. <div class="gf-form-group" ng-if="ctrl.model.type === 'victorops'">
  86. <h3 class="page-heading">VictorOps settings</h3>
  87. <div class="gf-form">
  88. <span class="gf-form-label width-6">Url</span>
  89. <input type="text" required class="gf-form-input max-width-30" ng-model="ctrl.model.settings.url" placeholder="Victorops url"></input>
  90. </div>
  91. </div>
  92. <div class="gf-form-group section" ng-if="ctrl.model.type === 'email'">
  93. <h3 class="page-heading">Email addresses</h3>
  94. <div class="gf-form">
  95. <textarea rows="7" class="gf-form-input width-25" required ng-model="ctrl.model.settings.addresses"></textarea>
  96. </div>
  97. <div class="gf-form">
  98. <span>You can enter multiple email addresses using a ";" separator</span>
  99. </div>
  100. </div>
  101. <div class="gf-form-group" ng-if="ctrl.model.type === 'pagerduty'">
  102. <h3 class="page-heading">Pagerduty settings</h3>
  103. <div class="gf-form">
  104. <span class="gf-form-label width-14">Integration Key</span>
  105. <input type="text" required class="gf-form-input max-width-22" ng-model="ctrl.model.settings.integrationKey" placeholder="Pagerduty integeration Key"></input>
  106. </div>
  107. <div class="gf-form">
  108. <gf-form-switch
  109. class="gf-form"
  110. label="Auto resolve incidents"
  111. label-class="width-14"
  112. checked="ctrl.model.settings.autoResolve"
  113. tooltip="Resolve incidents in pagerduty once the alert goes back to ok.">
  114. </gf-form-switch>
  115. </div>
  116. </div>
  117. <div class="gf-form-group" ng-if="ctrl.model.type === 'opsgenie'">
  118. <h3 class="page-heading">OpsGenie settings</h3>
  119. <div class="gf-form">
  120. <span class="gf-form-label width-14">API Key</span>
  121. <input type="text" required class="gf-form-input max-width-22" ng-model="ctrl.model.settings.apiKey" placeholder="OpsGenie API Key"></input>
  122. </div>
  123. <div class="gf-form">
  124. <gf-form-switch
  125. class="gf-form"
  126. label="Auto close incidents"
  127. label-class="width-14"
  128. checked="ctrl.model.settings.autoClose"
  129. tooltip="Automatically close alerts in OpseGenie once the alert goes back to ok.">
  130. </gf-form-switch>
  131. </div>
  132. </div>
  133. <div class="gf-form-group" ng-if="ctrl.model.type === 'telegram'">
  134. <h3 class="page-heading">Telegram API settings</h3>
  135. <div class="gf-form">
  136. <span class="gf-form-label width-14">BOT API Token</span>
  137. <input type="text" required
  138. class="gf-form-input"
  139. ng-model="ctrl.model.settings.bottoken"
  140. placeholder="Telegram BOT API Token"></input>
  141. </div>
  142. <div class="gf-form">
  143. <span class="gf-form-label width-6">Chat ID</span>
  144. <input type="text" required
  145. class="gf-form-input"
  146. ng-model="ctrl.model.settings.chatid"
  147. data-placement="right">
  148. </input>
  149. <info-popover mode="right-absolute">
  150. Integer Telegram Chat Identifier
  151. </info-popover>
  152. </div>
  153. </div>
  154. <div class="gf-form-group">
  155. <div class="gf-form-inline">
  156. <div class="gf-form width-6">
  157. <button type="submit" ng-click="ctrl.save()" class="btn btn-success">Save</button>
  158. </div>
  159. <div class="gf-form width-20">
  160. <div class="gf-form">
  161. <button type="submit" ng-click="ctrl.testNotification()" class="btn btn-secondary">Send Test</button>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. </form>
  167. </div>