host.hbs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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"><span {{bindAttr class="view.filtersUsed::active"}}><a {{action clearFilters target="view"}} href="#">{{t common.all}} ({{content.length}})</a></span>&nbsp;</div>
  22. {{view view.alertFilter}}
  23. {{#view view.statusFilter categoriesBinding="view.categories"}}
  24. {{#each category in view.categories}}
  25. {{#if category.isVisible}}
  26. |
  27. <span {{bindAttr class="category.itemClass"}}>
  28. {{#if category.alerts}}
  29. <span class="label label-important">{{t hosts.host.alerts.st}}</span>
  30. {{else}}
  31. <span {{bindAttr class="category.healthStatusValue"}}> &nbsp;&nbsp;&nbsp; </span>
  32. {{/if}}
  33. <a {{action selectCategory category target="view"}} href="#">
  34. {{category.label}}
  35. </a>
  36. </span>
  37. {{/if}}
  38. {{/each}}
  39. {{/view}}
  40. </div>
  41. {{#if App.isAdmin}}
  42. <div class="pull-right">
  43. <button class="btn btn-inverse add-host-button" {{action addHost}}>
  44. <i class="icon-plus icon-white"></i>
  45. {{t hosts.host.add}}
  46. </button>
  47. </div>
  48. {{/if}}
  49. </div>
  50. <table class="datatable table table-bordered table-striped" id="hosts-table">
  51. <thead>
  52. <tr>
  53. {{#view view.sortView contentBinding="view.filteredContent"}}
  54. <th class="first"> </th>
  55. {{view view.parentView.nameSort}}
  56. {{view view.parentView.ipSort}}
  57. {{view view.parentView.cpuSort}}
  58. {{view view.parentView.memorySort}}
  59. {{view view.parentView.diskUsageSort}}
  60. {{view view.parentView.loadAvgSort}}
  61. <th>{{t common.components}}</th>
  62. {{/view}}
  63. </tr>
  64. <tr>
  65. <th class="first"> </th>
  66. <th>{{view view.nameFilterView}}</th>
  67. <th>{{view view.ipFilterView}}</th>
  68. <th>{{view view.cpuFilterView}}</th>
  69. <th>{{view view.ramFilterView}}</th>
  70. <th></th>
  71. <th>{{view view.loadAvgFilterView}}</th>
  72. <th>{{view view.componentsFilterView}}</th>
  73. </tr>
  74. </thead>
  75. <tbody>
  76. {{#if view.pageContent}}
  77. {{#each host in view.pageContent}}
  78. {{#view view.HostView contentBinding="host"}}
  79. <td class="first">
  80. <span rel="HealthTooltip" {{bindAttr class="host.healthClass"}} {{bindAttr data-original-title="host.healthToolTip" }}></span>
  81. </td>
  82. <td class="name">
  83. <a title="{{unbound host.publicHostName}}" href="#" {{action "showDetails" host}}>{{unbound host.publicHostNameFormatted}}</a>
  84. {{#if host.criticalAlertsCount}}
  85. <span class="label label-important alerts-count" {{action "showAlertsPopup" host target="controller"}}>{{host.criticalAlertsCount}}</span>
  86. {{/if}}
  87. </td>
  88. <td>{{host.ip}}</td>
  89. <td>{{host.cpu}}</td>
  90. <td>{{host.memoryFormatted}}</td>
  91. <td>
  92. <div class="progress progress-info" title="{{unbound host.diskInfoBar}}" rel="UsageTooltip">
  93. <div class="bar" {{bindAttr style="view.usageStyle"}}></div>
  94. </div>
  95. </td>
  96. <td>{{host.loadAvg}}</td>
  97. <td>
  98. <a href="#" class="host-components-expander" {{action toggleComponents target="view"}}> <span class="caret right"></span>{{view.componentsMessage}}</a>
  99. <div id="host-{{unbound host.hostName}}" class="host-components">
  100. {{{view.labels}}}
  101. </div>
  102. </td>
  103. {{/view}}
  104. {{/each}}
  105. {{else}}
  106. <tr>
  107. <td class="first"></td>
  108. <td colspan="7">
  109. {{t hosts.table.noHosts}}
  110. </td>
  111. </tr>
  112. {{/if}}
  113. </tbody>
  114. </table>
  115. <div class="page-bar">
  116. <div class="items-on-page">
  117. <label>{{t common.show}}: {{view view.rowsPerPageSelectView selectionBinding="view.displayLength"}}</label>
  118. </div>
  119. <div class="info">{{view.paginationInfo}}</div>
  120. <div class="paging_two_button">
  121. {{view view.paginationLeft}}
  122. {{view view.paginationRight}}
  123. </div>
  124. </div>
  125. </div>