host.hbs 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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. {{#isAccessible ADMIN}}
  22. {{view App.HostTableMenuView}}
  23. {{/isAccessible}}
  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="table advanced-header-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 {{bindAttr class="App.supports.stackUpgrade::hidden :sort-view-11"}}>
  69. {{t hosts.host.menu.stackVersions}}
  70. </th>
  71. <th class="sort-view-6">{{t common.components}}</th>
  72. {{/view}}
  73. <tr class="filter-row">
  74. <th class="first"><div class="ember-view view-wrapper">{{view Ember.Checkbox checkedBinding="view.selectAllHosts"}}</div></th>
  75. <th> </th>
  76. <th>{{view view.nameFilterView}}</th>
  77. <th> </th>
  78. <th> </th>
  79. <th>{{view view.ipFilterView}}</th>
  80. <th>{{view view.cpuFilterView}}</th>
  81. <th>{{view view.ramFilterView}}</th>
  82. <th> </th>
  83. <th>{{view view.loadAvgFilterView}}</th>
  84. <th {{bindAttr class="App.supports.stackUpgrade::hidden"}}>
  85. {{view view.versionsFilterView}}
  86. </th>
  87. <th>{{view view.componentsFilterView}}</th>
  88. </tr>
  89. </thead>
  90. <tbody>
  91. {{#if view.pageContent}}
  92. {{#each host in view.pageContent}}
  93. {{#view view.HostView contentBinding="host"}}
  94. <td class="first">{{view Ember.Checkbox checkedBinding="host.selected"}}</td>
  95. <td class="health">
  96. <span rel="HealthTooltip" {{bindAttr class="host.healthClass host.healthIconClass"}} {{bindAttr data-original-title="host.healthToolTip" }}></span>
  97. </td>
  98. <td class="name">
  99. <span class="trim_hostname">
  100. <a title="{{unbound host.hostName}}" href="#" {{action "showDetails" host}}>{{unbound host.hostName}}</a>
  101. </span>
  102. {{#if host.criticalWarningAlertsCount}}
  103. {{#if host.alertsSummary.CRITICAL}}
  104. <span class="label alerts-crit-count" {{action "goToHostAlerts" host target="controller"}}>{{host.criticalWarningAlertsCount}}</span>
  105. {{else}}
  106. <span class="label alerts-warn-count" {{action "goToHostAlerts" host target="controller"}}>{{host.criticalWarningAlertsCount}}</span>
  107. {{/if}}
  108. {{/if}}
  109. </td>
  110. <td class="restart">
  111. {{#if host.componentsWithStaleConfigsCount}}
  112. <span class="muted icon-refresh" rel="ComponentsTooltip" {{bindAttr title="view.restartRequiredComponentsMessage"}}></span>
  113. {{/if}}
  114. </td>
  115. <td class="passive-state">
  116. <span rel="ComponentsTooltip" {{bindAttr data-original-title="view.componentsInPassiveStateMessage" class="host.componentsInPassiveStateCount:icon-medkit"}}></span>
  117. </td>
  118. <td class="host-ip">{{host.ip}}</td>
  119. <td class="cores-formatted">{{host.coresFormatted}}</td>
  120. <td class="memory-formatted">{{host.memoryFormatted}}</td>
  121. <td class="disk-info">
  122. <div class="progress progress-info" {{bindAttr title="host.diskInfoBar"}} rel="UsageTooltip">
  123. <div class="bar" {{bindAttr style="view.usageStyle"}}></div>
  124. </div>
  125. </td>
  126. <td class="load-avg">{{host.loadAvg}}</td>
  127. <td {{bindAttr class="App.supports.stackUpgrade::hidden view.hasSingleVersion:not-active-link :host-table-versions"}}>
  128. <a href="#" class="expander black" {{action toggleVersions target="view"}}>
  129. {{#unless view.hasSingleVersion}}
  130. <span {{bindAttr class="view.isVersionsCollapsed:icon-caret-right:icon-caret-down"}}></span>
  131. {{/unless}}
  132. {{view.currentVersion}}
  133. </a>
  134. <div class="stack-versions collapsed-list">
  135. {{{view.versionlabels}}}
  136. </div>
  137. </td>
  138. <td class="host-table-components">
  139. <a href="#" class="expander" {{action toggleComponents target="view"}}> <span {{bindAttr class="view.isComponentsCollapsed:icon-caret-right:icon-caret-down"}}></span>
  140. {{view.content.hostComponents.length}} {{pluralize view.content.hostComponents.length singular="t:common.component" plural="t:common.components"}}</a>
  141. <div class="host-components collapsed-list">
  142. {{{view.labels}}}
  143. </div>
  144. </td>
  145. {{/view}}
  146. {{/each}}
  147. {{else}}
  148. <tr>
  149. <td class="first"> </td>
  150. <td {{bindAttr colspan="view.colspan"}}>
  151. {{t hosts.table.noHosts}}
  152. </td>
  153. </tr>
  154. {{/if}}
  155. </tbody>
  156. </table>
  157. <div {{bindAttr class="view.filteringComplete:hidden :hosts-overlay"}}>
  158. <div class="spinner"></div>
  159. </div>
  160. <div class="page-bar">
  161. <div class="filtered-info span4">
  162. <label>{{view.filteredContentInfo}} - <a {{action clearFilters target="view"}} id="hosts-page-clear-filters" href="#">{{t tableView.filters.clearAllFilters}}</a></label>
  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>