host.hbs 7.2 KB

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