alerts.hbs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. {{!
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. }}
  18. {{#isAccessible ADMIN}}
  19. <div id="alert-actions-button" class="pull-left">
  20. {{view App.MainAlertDefinitionActionsView controllerBinding="App.router.mainAlertDefinitionActionsController"}}
  21. </div>
  22. {{/isAccessible}}
  23. <div id="alert-groups-filter" class="pull-left advanced-header-table groups-filter">
  24. {{#if App.router.clusterController.isAlertsLoaded}}
  25. {{view view.alertGroupFilterView}}
  26. {{/if}}
  27. </div>
  28. <div id="alerts">
  29. <div class="box-header row">
  30. </div>
  31. <table class="table advanced-header-table table-bordered table-striped alerts-table" id="alert-definitions-table">
  32. <thead>
  33. {{#view view.sortView classNames="label-row" contentBinding="view.filteredContent"}}
  34. {{view view.parentView.nameSort class="first name-sorting"}}
  35. {{view view.parentView.statusSort class="status-sorting"}}
  36. {{view view.parentView.serviceSort class="service-sorting"}}
  37. {{view view.parentView.lastTriggeredSort class="last-triggred-sorting"}}
  38. {{view view.parentView.enabledSort class="enabled-sorting"}}
  39. {{/view}}
  40. <tr class="filter-row">
  41. <th class="first">{{view view.nameFilterView class="name-filter"}}</th>
  42. <th>{{view view.stateFilterView class="status-filter"}}</th>
  43. <th>{{view view.serviceFilterView class="service-filter"}}</th>
  44. <th>{{view view.triggeredFilterView class="last-triggered-filter"}}</th>
  45. <th>{{view view.enabledFilterView class="enabled-filter"}}</th>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. {{#if App.router.clusterController.isAlertsLoaded}}
  50. {{#if view.pageContent}}
  51. {{#each alertDefinition in view.pageContent}}
  52. <tr>
  53. <td class="first alert-name">
  54. <span {{bindAttr title="alertDefinition.type"}} {{bindAttr class=":type-icon alertDefinition.typeIconClass"}}></span>
  55. <a href="#" {{action "gotoAlertDetails" alertDefinition}}>{{alertDefinition.label}}</a>
  56. </td>
  57. <td class="alert-status">{{{alertDefinition.status}}}</td>
  58. <td class="alert-service">{{alertDefinition.serviceDisplayName}}</td>
  59. <td class="alert-time">
  60. <time class="timeago" {{bindAttr data-original-title="alertDefinition.lastTriggeredFormatted"}}>{{alertDefinition.lastTriggeredAgoFormatted}}</time>
  61. </td>
  62. <td class="last toggle-state-button alert-state">
  63. {{#if alertDefinition.enabled}}
  64. {{#isAccessible ADMIN}}
  65. <a href="#" {{action "toggleState" alertDefinition target="controller"}} {{bindAttr class="alertDefinition.enabled:alert-definition-enable:alert-definition-disable"}}>
  66. <span class="enable-disable-button" {{bindAttr data-original-title="view.enabledTooltip"}}>
  67. {{view.enabledDisplay}}
  68. </span>
  69. </a>
  70. {{/isAccessible}}
  71. {{#isAccessible NON_ADMIN}}
  72. <span {{bindAttr class="alertDefinition.enabled:alert-definition-enable:alert-definition-disable"}}>
  73. {{t alerts.table.state.enabled}}
  74. </span>
  75. {{/isAccessible}}
  76. {{else}}
  77. {{#isAccessible ADMIN}}
  78. <a href="#" {{action "toggleState" alertDefinition target="controller"}} {{bindAttr class="alertDefinition.enabled:alert-definition-enable:alert-definition-disable"}}>
  79. <span class="enable-disable-button" {{bindAttr data-original-title="view.disabledTooltip"}}>
  80. {{view.disabledDisplay}}
  81. </span>
  82. </a>
  83. {{/isAccessible}}
  84. {{#isAccessible NON_ADMIN}}
  85. <span {{bindAttr class="alertDefinition.enabled:alert-definition-enable:alert-definition-disable"}}>
  86. {{t alerts.table.state.disabled}}
  87. </span>
  88. {{/isAccessible}}
  89. {{/if}}
  90. </td>
  91. </tr>
  92. {{/each}}
  93. {{else}}
  94. <tr>
  95. <td class="first"></td>
  96. <td colspan="4">
  97. {{t alerts.table.noAlerts}}
  98. </td>
  99. </tr>
  100. {{/if}}
  101. {{else}}
  102. <tr>
  103. <td class="first"></td>
  104. <td colspan="2">
  105. <div class="spinner"></div>
  106. </td>
  107. <td colspan="2"></td>
  108. </tr>
  109. {{/if}}
  110. </tbody>
  111. </table>
  112. <div class="page-bar">
  113. <div class="filtered-info span4">
  114. <label>{{view.filteredContentInfo}} - <a {{action clearFilters target="view"}}
  115. href="#">{{t tableView.filters.clearAllFilters}}</a></label>
  116. </div>
  117. <div class="selected-hosts-info span4">
  118. </div>
  119. <div class="items-on-page">
  120. <label>{{t common.show}}: {{view view.rowsPerPageSelectView selectionBinding="view.displayLength"}}</label>
  121. </div>
  122. <div class="info">{{view.paginationInfo}}</div>
  123. <div class="paging_two_button">
  124. <a {{bindAttr class="view.paginationLeftClass"}}{{action previousPage target="view"}}><i
  125. class="icon-arrow-left"></i></a>
  126. <a {{bindAttr class="view.paginationRightClass"}}{{action nextPage target="view"}}><i
  127. class="icon-arrow-right"></i></a>
  128. </div>
  129. </div>
  130. </div>