alerts.hbs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. {{view view.alertGroupFilterView}}
  25. </div>
  26. <div id="alerts">
  27. <div class="box-header row">
  28. </div>
  29. <table class="table advanced-header-table table-bordered table-striped alerts-table" id="alert-definitions-table">
  30. <thead>
  31. {{#view view.sortView classNames="label-row" contentBinding="view.filteredContent"}}
  32. {{view view.parentView.nameSort class="first name-sorting"}}
  33. {{view view.parentView.statusSort class="status-sorting"}}
  34. {{view view.parentView.serviceSort class="service-sorting"}}
  35. {{view view.parentView.lastTriggeredSort class="last-triggred-sorting"}}
  36. {{view view.parentView.enabledSort class="enabled-sorting"}}
  37. {{/view}}
  38. <tr class="filter-row">
  39. <th class="first">{{view view.nameFilterView class="name-filter"}}</th>
  40. <th>{{view view.stateFilterView class="status-filter"}}</th>
  41. <th>{{view view.serviceFilterView class="service-filter"}}</th>
  42. <th>{{view view.triggeredFilterView class="last-triggered-filter"}}</th>
  43. <th>{{view view.enabledFilterView class="enabled-filter"}}</th>
  44. </tr>
  45. </thead>
  46. <tbody>
  47. {{#if view.pageContent}}
  48. {{#each alertDefinition in view.pageContent}}
  49. <tr>
  50. <td class="first">
  51. <span {{bindAttr title="alertDefinition.type"}} {{bindAttr class=":type-icon alertDefinition.typeIconClass"}}></span>
  52. <a href="#" {{action "gotoAlertDetails" alertDefinition}}>{{alertDefinition.label}}</a>
  53. </td>
  54. <td>{{{alertDefinition.status}}}</td>
  55. <td>{{alertDefinition.serviceDisplayName}}</td>
  56. <td><time class="timeago" {{bindAttr data-original-title="alertDefinition.lastTriggeredFormatted"}}>{{alertDefinition.lastTriggeredAgoFormatted}}</time></td>
  57. <td class="last toggle-state-button">
  58. {{#if alertDefinition.enabled}}
  59. {{#isAccessible ADMIN}}
  60. <a href="#" {{action "toggleState" alertDefinition target="controller"}} {{bindAttr class="alertDefinition.enabled:alert-definition-enable:alert-definition-disable"}}>
  61. <span class="enable-disable-button" {{bindAttr data-original-title="view.enabledTooltip"}}>
  62. {{view.enabledDisplay}}
  63. </span>
  64. </a>
  65. {{/isAccessible}}
  66. {{#isAccessible NON_ADMIN}}
  67. <span {{bindAttr class="alertDefinition.enabled:alert-definition-enable:alert-definition-disable"}}>
  68. {{t alerts.table.state.enabled}}
  69. </span>
  70. {{/isAccessible}}
  71. {{else}}
  72. {{#isAccessible ADMIN}}
  73. <a href="#" {{action "toggleState" alertDefinition target="controller"}} {{bindAttr class="alertDefinition.enabled:alert-definition-enable:alert-definition-disable"}}>
  74. <span class="enable-disable-button" {{bindAttr data-original-title="view.disabledTooltip"}}>
  75. {{view.disabledDisplay}}
  76. </span>
  77. </a>
  78. {{/isAccessible}}
  79. {{#isAccessible NON_ADMIN}}
  80. <span {{bindAttr class="alertDefinition.enabled:alert-definition-enable:alert-definition-disable"}}>
  81. {{t alerts.table.state.disabled}}
  82. </span>
  83. {{/isAccessible}}
  84. {{/if}}
  85. </td>
  86. </tr>
  87. {{/each}}
  88. {{else}}
  89. <tr>
  90. <td class="first"></td>
  91. <td colspan="4">
  92. {{t alerts.table.noAlerts}}
  93. </td>
  94. </tr>
  95. {{/if}}
  96. </tbody>
  97. </table>
  98. <div class="page-bar">
  99. <div class="filtered-info span4">
  100. <label>{{view.filteredContentInfo}} - <a {{action clearFilters target="view"}}
  101. href="#">{{t tableView.filters.clearAllFilters}}</a></label>
  102. </div>
  103. <div class="selected-hosts-info span4">
  104. </div>
  105. <div class="items-on-page">
  106. <label>{{t common.show}}: {{view view.rowsPerPageSelectView selectionBinding="view.displayLength"}}</label>
  107. </div>
  108. <div class="info">{{view.paginationInfo}}</div>
  109. <div class="paging_two_button">
  110. <a {{bindAttr class="view.paginationLeftClass"}}{{action previousPage target="view"}}><i class="icon-arrow-left"></i></a>
  111. <a {{bindAttr class="view.paginationRightClass"}}{{action nextPage target="view"}}><i class="icon-arrow-right"></i></a>
  112. </div>
  113. </div>
  114. </div>