host.hbs 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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. {{#isAuthorized "HOST.ADD_DELETE_COMPONENTS, HOST.TOGGLE_MAINTENANCE, HOST.ADD_DELETE_HOSTS"}}
  22. {{view App.HostTableMenuView}}
  23. {{/isAuthorized}}
  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. {{view App.MainHostComboSearchBoxView}}
  56. <table class="table advanced-header-table table-bordered table-striped" id="hosts-table">
  57. <thead>
  58. {{#view view.sortView classNames="label-row" contentBinding="view.filteredContent"}}
  59. <th class="first"> </th>
  60. <th> </th>
  61. {{view view.parentView.nameSort}}
  62. <th> </th>
  63. <th> </th>
  64. {{view view.parentView.ipSort}}
  65. {{view view.parentView.rackSort}}
  66. {{view view.parentView.cpuSort}}
  67. {{view view.parentView.memorySort}}
  68. {{view view.parentView.diskUsageSort}}
  69. {{view view.parentView.loadAvgSort}}
  70. <th {{bindAttr class="App.supports.stackUpgrade::hidden App.stackVersionsAvailable::hidden :sort-view-11"}}>
  71. {{t hosts.host.menu.stackVersions}}
  72. </th>
  73. <th class="sort-view-6">{{t common.components}}</th>
  74. {{/view}}
  75. <tr class="filter-row">
  76. <th class="first"><div class="ember-view view-wrapper">{{view Ember.Checkbox checkedBinding="view.selectAllHosts"}}</div></th>
  77. <th> </th>
  78. <th>{{view view.nameFilterView}}</th>
  79. <th> </th>
  80. <th> </th>
  81. <th>{{view view.ipFilterView}}</th>
  82. <th>{{view view.rackFilterView}}</th>
  83. <th>{{view view.cpuFilterView}}</th>
  84. <th>{{view view.ramFilterView}}</th>
  85. <th> </th>
  86. <th>{{view view.loadAvgFilterView}}</th>
  87. <th {{bindAttr class="App.supports.stackUpgrade::hidden App.stackVersionsAvailable::hidden"}}>
  88. {{view view.versionsFilterView}}
  89. </th>
  90. <th>{{view view.componentsFilterView}}</th>
  91. </tr>
  92. </thead>
  93. <tbody>
  94. {{#if view.pageContent}}
  95. {{#each host in view.pageContent}}
  96. {{#view view.HostView contentBinding="host"}}
  97. <td class="first">{{view Ember.Checkbox checkedBinding="host.selected"}}</td>
  98. <td class="health">
  99. <span rel="HealthTooltip" {{bindAttr class="host.healthClass host.healthIconClass"}} {{bindAttr data-original-title="host.healthToolTip" }}></span>
  100. </td>
  101. <td class="name">
  102. <span class="trim_hostname">
  103. <a rel="UsageTooltip" data-original-title="{{unbound host.hostName}}" href="#" {{action "showDetails" host}}>{{unbound host.hostName}}</a>
  104. </span>
  105. {{#if host.criticalWarningAlertsCount}}
  106. {{#if host.alertsSummary.CRITICAL}}
  107. <span class="label alerts-crit-count" {{action "goToHostAlerts" host target="controller"}}>{{host.criticalWarningAlertsCount}}</span>
  108. {{else}}
  109. <span class="label alerts-warn-count" {{action "goToHostAlerts" host target="controller"}}>{{host.criticalWarningAlertsCount}}</span>
  110. {{/if}}
  111. {{/if}}
  112. </td>
  113. <td class="restart">
  114. {{#if host.componentsWithStaleConfigsCount}}
  115. <span class="muted icon-refresh" rel="ComponentsTooltip" {{bindAttr title="view.restartRequiredComponentsMessage"}}></span>
  116. {{/if}}
  117. </td>
  118. <td class="passive-state">
  119. <span rel="ComponentsTooltip" {{bindAttr data-original-title="view.componentsInPassiveStateMessage" class="host.componentsInPassiveStateCount:icon-medkit"}}></span>
  120. </td>
  121. <td class="host-ip">{{host.ip}}</td>
  122. <td rel="UsageTooltip" {{bindAttr data-original-title="host.rack"}} class="rack-id">
  123. {{host.rack}}
  124. </td>
  125. <td class="cores-formatted">{{host.coresFormatted}}</td>
  126. <td class="memory-formatted">{{host.memoryFormatted}}</td>
  127. <td class="disk-info">
  128. <div class="progress progress-info" {{bindAttr data-original-title="host.diskInfoBar"}} rel="UsageTooltip">
  129. <div class="bar" {{bindAttr style="view.usageStyle"}}></div>
  130. </div>
  131. </td>
  132. <td class="load-avg">{{host.loadAvg}}</td>
  133. <td {{bindAttr class="App.supports.stackUpgrade::hidden App.stackVersionsAvailable::hidden view.hasSingleVersion:not-active-link :host-table-versions"}}>
  134. <a href="#" class="black" {{action displayVersions target="view"}}>
  135. {{view.currentVersion}}
  136. </a>
  137. </td>
  138. <td {{bindAttr class="view.hasNoComponents:not-active-link :host-table-components"}}>
  139. <a href="#" class="black" {{action displayComponents target="view"}}>
  140. {{view.content.hostComponents.length}} {{pluralize view.content.hostComponents.length singular="t:common.component" plural="t:common.components"}}
  141. </a>
  142. </td>
  143. {{/view}}
  144. {{/each}}
  145. {{else}}
  146. <tr>
  147. <td class="first"></td>
  148. <td {{bindAttr colspan="view.colspan"}}>
  149. {{t hosts.table.noHosts}}
  150. </td>
  151. </tr>
  152. {{/if}}
  153. </tbody>
  154. </table>
  155. <div {{bindAttr class="view.filteringComplete:hidden :table-overlay"}}>
  156. {{view App.SpinnerView}}
  157. </div>
  158. <div class="page-bar">
  159. <div class="filtered-info span4">
  160. {{#if view.showFilteredContent}}
  161. <label>{{view.filteredContentInfo}} - <a {{action clearFilters target="view"}} id="hosts-page-clear-filters" href="#">{{t tableView.filters.clearAllFilters}}</a></label>
  162. {{/if}}
  163. </div>
  164. <div class="selected-hosts-info span4">
  165. {{#if view.showSelectedFilter}}
  166. <div>
  167. <a {{action filterSelected target="view"}} href="#">
  168. {{view.selectedHosts.length}}
  169. {{pluralize view.selectedHostsCount singular="t:hosts.filters.selectedHostInfo" plural="t:hosts.filters.selectedHostsInfo"}}
  170. </a>
  171. </div> - <a {{action clearSelection target="view"}} href="#">{{t hosts.filters.clearSelection}}</a>
  172. {{/if}}
  173. </div>
  174. <div class="items-on-page">
  175. <label>{{t common.show}}: {{view view.rowsPerPageSelectView selectionBinding="view.displayLength"}}</label>
  176. </div>
  177. <div class="info">{{view.paginationInfo}}</div>
  178. <div class="paging_two_button">
  179. <a {{bindAttr class="view.paginationLeftClass"}}{{action previousPage target="view"}}><i class="icon-arrow-left"></i></a>
  180. <a {{bindAttr class="view.paginationRightClass"}}{{action nextPage target="view"}}><i class="icon-arrow-right"></i></a>
  181. </div>
  182. </div>
  183. </div>