notification_edit.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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']" 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 section" ng-if="ctrl.model.type === 'email'">
  86. <h3 class="page-heading">Email addresses</h3>
  87. <div class="gf-form">
  88. <textarea rows="7" class="gf-form-input width-25" required ng-model="ctrl.model.settings.addresses"></textarea>
  89. </div>
  90. <div class="gf-form">
  91. <span>You can enter multiple email addresses using a ";" separator</span>
  92. </div>
  93. </div>
  94. <div class="gf-form-group" ng-if="ctrl.model.type === 'pagerduty'">
  95. <h3 class="page-heading">Pagerduty settings</h3>
  96. <div class="gf-form">
  97. <span class="gf-form-label width-12">Integration Key</span>
  98. <input type="text" required class="gf-form-input max-width-30" ng-model="ctrl.model.settings.integrationKey" placeholder="Pagerduty integeration Key"></input>
  99. </div>
  100. <div class="gf-form">
  101. <gf-form-switch
  102. class="gf-form"
  103. label="Alert on No Data"
  104. label-class="width-12"
  105. checked="ctrl.model.settings.alertOnNoData"
  106. tooltip="Trigger incident on No Data">
  107. </gf-form-switch>
  108. </div>
  109. <div class="gf-form">
  110. <gf-form-switch
  111. class="gf-form"
  112. label="Alert on Exec Error"
  113. label-class="width-12"
  114. checked="ctrl.model.settings.alertOnExecError"
  115. tooltip="Trigger incident on Execution Error">
  116. </gf-form-switch>
  117. </div>
  118. <div class="gf-form">
  119. <gf-form-switch
  120. class="gf-form"
  121. label="Auto resolve on OK"
  122. label-class="width-12"
  123. checked="ctrl.model.settings.resolveOnOK"
  124. tooltip="Resolve incident on OK">
  125. </gf-form-switch>
  126. </div>
  127. </div>
  128. <div class="gf-form-group">
  129. <div class="gf-form-inline">
  130. <div class="gf-form width-6">
  131. <button type="submit" ng-click="ctrl.save()" class="btn btn-success">Save</button>
  132. </div>
  133. <div class="gf-form width-20">
  134. <div class="gf-form">
  135. <button type="submit" ng-click="ctrl.testNotification()" class="btn btn-secondary">Send Test</button>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. </form>
  141. </div>