notification_edit.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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']" ng-change="ctrl.typeChanged(notification, $index)">
  21. </select>
  22. </div>
  23. </div>
  24. <div class="gf-form">
  25. <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">
  26. </gf-form-switch>
  27. </div>
  28. </div>
  29. <div class="gf-form-group" ng-if="ctrl.model.type === 'webhook'">
  30. <h3 class="page-heading">Webhook settings</h3>
  31. <div class="gf-form">
  32. <span class="gf-form-label width-6">Url</span>
  33. <input type="text" required class="gf-form-input max-width-26" ng-model="ctrl.model.settings.url"></input>
  34. </div>
  35. <div class="gf-form-inline">
  36. <div class="gf-form">
  37. <span class="gf-form-label width-6">Username</span>
  38. <input type="text" class="gf-form-input max-width-10" ng-model="ctrl.model.settings.username"></input>
  39. </div>
  40. <div class="gf-form">
  41. <span class="gf-form-label width-6">Password</span>
  42. <input type="text" class="gf-form-input max-width-10" ng-model="ctrl.model.settings.password"></input>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="gf-form-group" ng-if="ctrl.model.type === 'slack'">
  47. <h3 class="page-heading">Slack settings</h3>
  48. <div class="gf-form">
  49. <span class="gf-form-label width-6">Url</span>
  50. <input type="text" required class="gf-form-input max-width-30" ng-model="ctrl.model.settings.url" placeholder="Slack incoming webhook url"></input>
  51. </div>
  52. </div>
  53. <div class="gf-form-group section" ng-if="ctrl.model.type === 'email'">
  54. <h3 class="page-heading">Email addresses</h3>
  55. <div class="gf-form">
  56. <textarea rows="7" class="gf-form-input width-25" required ng-model="ctrl.model.settings.addresses"></textarea>
  57. </div>
  58. </div>
  59. <div class="gf-form-group">
  60. <div class="gf-form-inline">
  61. <div class="gf-form width-6">
  62. <button type="submit" ng-click="ctrl.save()" class="btn btn-success">Save</button>
  63. </div>
  64. <div class="gf-form width-20">
  65. <div class="gf-form">
  66. <button type="submit" ng-click="ctrl.testNotification()" class="btn btn-secondary">Send Test</button>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </form>
  72. </div>