host.hbs 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. <div id="hosts">
  19. <div class="box-header row">
  20. <div class="hosts-actions pull-left">
  21. {{#if App.isAdmin}}
  22. {{view App.HostTableMenuView}}
  23. {{/if}}
  24. </div>
  25. <div class="health-status-bar pull-left">
  26. {{#view view.statusFilter categoriesBinding="view.categories"}}
  27. <div class="btn-group display-inline-block">
  28. <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
  29. <span class="filters-label">{{t common.filter}}: </span>
  30. <span>
  31. <span {{bindAttr class="view.class"}}></span>
  32. {{view.comboBoxLabel}}
  33. <span class="caret"></span>
  34. </span>
  35. </a>
  36. <ul class="dropdown-menu">
  37. <li {{bindAttr class=":category-item view.filtersUsed::active"}}>
  38. <a {{action clearFilter target="view"}} href="#">{{t common.all}} ({{view.parentView.totalCount}})</a>
  39. </li>
  40. {{#each category in view.categories}}
  41. {{#if category.isVisible}}
  42. <li {{bindAttr class=":category-item category.itemClass"}}>
  43. <a {{action selectCategory category target="view"}} href="#">
  44. <span {{bindAttr class="category.isHealthStatus:health-status category.healthClass category.class"}}></span>
  45. {{category.label}}
  46. </a>
  47. </li>
  48. {{/if}}
  49. {{/each}}
  50. </ul>
  51. </div>
  52. {{/view}}
  53. </div>
  54. </div>
  55. <table class="datatable table table-bordered table-striped" id="hosts-table">
  56. <thead>
  57. {{#view view.sortView classNames="label-row" contentBinding="view.filteredContent"}}
  58. <th class="first"> </th>
  59. <th> </th>
  60. {{view view.parentView.nameSort}}
  61. <th> </th>
  62. <th> </th>
  63. {{view view.parentView.ipSort}}
  64. {{view view.parentView.cpuSort}}
  65. {{view view.parentView.memorySort}}
  66. {{view view.parentView.diskUsageSort}}
  67. {{view view.parentView.loadAvgSort}}
  68. <th class="sort-view-6">{{t common.components}}</th>
  69. {{/view}}
  70. <tr id="filter-row">
  71. <th class="first"><div class="ember-view view-wrapper">{{view Ember.Checkbox checkedBinding="view.selectAllHosts"}}</div></th>
  72. <th> </th>
  73. <th>{{view view.nameFilterView}}</th>
  74. <th> </th>
  75. <th> </th>
  76. <th>{{view view.ipFilterView}}</th>
  77. <th>{{view view.cpuFilterView}}</th>
  78. <th>{{view view.ramFilterView}}</th>
  79. <th> </th>
  80. <th>{{view view.loadAvgFilterView}}</th>
  81. <th>{{view view.componentsFilterView}}</th>
  82. </tr>
  83. </thead>
  84. <tbody>
  85. {{#if view.pageContent}}
  86. {{#each host in view.pageContent}}
  87. {{#view view.HostView contentBinding="host"}}
  88. <td class="first">{{view Ember.Checkbox checkedBinding="host.selected"}}</td>
  89. <td class="health">
  90. <span rel="HealthTooltip" {{bindAttr class="host.healthClass host.healthIconClass"}} {{bindAttr data-original-title="host.healthToolTip" }}></span>
  91. </td>
  92. <td class="name">
  93. <span class="trim_hostname">
  94. <a title="{{unbound host.publicHostName}}" href="#" {{action "showDetails" host}}>{{unbound host.publicHostName}}</a>
  95. </span>
  96. {{#if host.criticalAlertsCount}}
  97. <span class="label label-important alerts-count" {{action "showAlertsPopup" host target="controller"}}>{{host.criticalAlertsCount}}</span>
  98. {{/if}}
  99. </td>
  100. <td class="restart">
  101. {{#if host.componentsWithStaleConfigsCount}}
  102. <span class="muted icon-refresh" rel="ComponentsTooltip" {{bindAttr title="view.restartRequiredComponentsMessage"}}></span>
  103. {{/if}}
  104. </td>
  105. <td class="passive-state">
  106. <span rel="ComponentsTooltip" {{bindAttr data-original-title="view.componentsInPassiveStateMessage" class="host.componentsInPassiveStateCount:icon-medkit"}}></span>
  107. </td>
  108. <td>{{host.ip}}</td>
  109. <td>{{host.coresFormatted}}</td>
  110. <td>{{host.memoryFormatted}}</td>
  111. <td>
  112. <div class="progress progress-info" {{bindAttr title="host.diskInfoBar"}} rel="UsageTooltip">
  113. <div class="bar" {{bindAttr style="view.usageStyle"}}></div>
  114. </div>
  115. </td>
  116. <td>{{host.loadAvg}}</td>
  117. <td>
  118. <a href="#" class="host-components-expander" {{action toggleComponents target="view"}}> <span {{bindAttr class="view.isComponentsCollapsed:icon-caret-right:icon-caret-down"}}></span>
  119. {{view.content.hostComponents.length}} {{pluralize view.content.hostComponents.length singular="t:common.component" plural="t:common.components"}}</a>
  120. <div id="host-{{unbound host.hostName}}" class="host-components">
  121. {{{view.labels}}}
  122. </div>
  123. </td>
  124. {{/view}}
  125. {{/each}}
  126. {{else}}
  127. <tr>
  128. <td class="first"> </td>
  129. <td colspan="11">
  130. {{t hosts.table.noHosts}}
  131. </td>
  132. </tr>
  133. {{/if}}
  134. </tbody>
  135. </table>
  136. <div {{bindAttr class="view.filteringComplete:hidden :hosts-overlay"}}>
  137. <div class="spinner"></div>
  138. </div>
  139. <div class="page-bar">
  140. <div class="filtered-hosts-info span4">
  141. <label>{{view.filteredContentInfo}} - <a {{action clearFilters target="view"}} href="#">{{t tableView.filters.clearAllFilters}}</a></label>
  142. </div>
  143. <div class="selected-hosts-info span4">
  144. {{#if view.showSelectedFilter}}
  145. <div>
  146. <a {{action filterSelected target="view"}} href="#">
  147. {{view.selectedHosts.length}}
  148. {{pluralize view.selectedHostsCount singular="t:hosts.filters.selectedHostInfo" plural="t:hosts.filters.selectedHostsInfo"}}
  149. </a>
  150. </div> - <a {{action clearSelection target="view"}} href="#">{{t hosts.filters.clearSelection}}</a>
  151. {{/if}}
  152. </div>
  153. <div class="items-on-page">
  154. <label>{{t common.show}}: {{view view.rowsPerPageSelectView selectionBinding="view.displayLength"}}</label>
  155. </div>
  156. <div class="info">{{view.paginationInfo}}</div>
  157. <div class="paging_two_button">
  158. <a {{bindAttr class="view.paginationLeftClass"}}{{action previousPage target="view"}}><i class="icon-arrow-left"></i></a>
  159. <a {{bindAttr class="view.paginationRightClass"}}{{action nextPage target="view"}}><i class="icon-arrow-right"></i></a>
  160. </div>
  161. </div>
  162. </div>