notification_edit.html 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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-10">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">
  36. <span class="gf-form-label width-10">Http Method</span>
  37. <div class="gf-form-select-wrapper width-14">
  38. <select class="gf-form-input" ng-model="ctrl.model.settings.httpMethod" ng-options="t for t in ['POST', 'PUT']">
  39. </select>
  40. </div>
  41. </div>
  42. <div class="gf-form">
  43. <span class="gf-form-label width-10">Username</span>
  44. <input type="text" class="gf-form-input max-width-14" ng-model="ctrl.model.settings.username"></input>
  45. </div>
  46. <div class="gf-form">
  47. <span class="gf-form-label width-10">Password</span>
  48. <input type="text" class="gf-form-input max-width-14" ng-model="ctrl.model.settings.password"></input>
  49. </div>
  50. </div>
  51. <div class="gf-form-group" ng-if="ctrl.model.type === 'slack'">
  52. <h3 class="page-heading">Slack settings</h3>
  53. <div class="gf-form">
  54. <span class="gf-form-label width-6">Url</span>
  55. <input type="text" required class="gf-form-input max-width-30" ng-model="ctrl.model.settings.url" placeholder="Slack incoming webhook url"></input>
  56. </div>
  57. </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>
  64. <div class="gf-form-group">
  65. <div class="gf-form-inline">
  66. <div class="gf-form width-6">
  67. <button type="submit" ng-click="ctrl.save()" class="btn btn-success">Save</button>
  68. </div>
  69. <div class="gf-form width-20">
  70. <div class="gf-form">
  71. <button type="submit" ng-click="ctrl.testNotification()" class="btn btn-secondary">Send Test</button>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </form>
  77. </div>