host.hbs 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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="pull-left">
  21. <span>{{t common.search}}&nbsp;</span>{{view Ember.TextField valueBinding="view.globalSearchValue"}}
  22. </div>
  23. {{#if App.isAdmin}}
  24. <div class="button-section pull-right">
  25. <button class="btn btn-inverse add-host-button" {{action addHost}}>
  26. <i class="icon-plus icon-white"></i>
  27. {{t hosts.host.add}}
  28. </button>
  29. </div>
  30. {{/if}}
  31. </div>
  32. <table class="datatable table table-bordered table-striped" id="hosts-table">
  33. <thead>
  34. <tr>
  35. {{#view view.sortView contentBinding="view.filteredContent"}}
  36. <th class="first"></th>
  37. {{view view.parentView.nameSort}}
  38. {{view view.parentView.ipSort}}
  39. {{view view.parentView.cpuSort}}
  40. {{view view.parentView.memorySort}}
  41. {{view view.parentView.diskUsageSort}}
  42. {{view view.parentView.loadAvgSort}}
  43. <th>{{t common.components}}</th>
  44. {{/view}}
  45. </tr>
  46. <tr>
  47. <th class="first">&nbsp;</th>
  48. <th>{{view view.nameFilterView}}</th>
  49. <th>{{view view.ipFilterView}}</th>
  50. <th>{{view view.cpuFilterView}}</th>
  51. <th>{{view view.ramFilterView}}</th>
  52. <th></th>
  53. <th>{{view view.loadAvgFilterView}}</th>
  54. <th>{{view view.componentsFilterView}}</th>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. {{#if view.filteredContent.length}}
  59. {{#each host in view.filteredContent}}
  60. {{#view view.HostView contentBinding="host"}}
  61. <td class="first">
  62. <span {{bindAttr class="host.healthClass"}} {{bindAttr title="host.healthToolTip" }}></span>
  63. </td>
  64. <td class="name">
  65. <a title="{{unbound host.publicHostName}}" href="#" {{action "showDetails" host}}>{{unbound host.publicHostNameFormatted}}</a>
  66. {{#if host.criticalAlertsCount}}
  67. <span class="label label-important alerts-count" {{action "showAlertsPopup" host target="controller"}}>{{host.criticalAlertsCount}}</span>
  68. {{/if}}
  69. </td>
  70. <td>{{host.ip}}</td>
  71. <td>{{host.cpu}}</td>
  72. <td>{{host.memoryFormatted}}</td>
  73. <td>
  74. <div class="progress progress-info" title="{{unbound host.diskInfoBar}}">
  75. <div class="bar" {{bindAttr style="view.usageStyle"}}></div>
  76. </div>
  77. </td>
  78. <td>{{host.loadAvg}}</td>
  79. <td>
  80. <span title="{{unbound view.labels}}">{{view.shortLabels}}</span>
  81. </td>
  82. {{/view}}
  83. {{/each}}
  84. {{else}}
  85. <tr>
  86. <td class="first"></td>
  87. <td colspan="7">
  88. {{t hosts.table.noHosts}}
  89. </td>
  90. </tr>
  91. {{/if}}
  92. </tbody>
  93. </table>
  94. </div>