notification_edit.html 2.9 KB

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