hdfs_links.hbs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 class="links">
  19. <ul>
  20. <li class="thumbnail row">
  21. <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#" {{action deleteWidget target="view"}}>
  22. <i class="icon-remove-sign icon-large"></i>
  23. </a>
  24. <div class="caption span10"> {{view.title}}</div>
  25. <div class="widget-content" >
  26. {{#if view.isHAEnabled }}
  27. <table>
  28. <!--Active NameNode-->
  29. <tr class="active-namenode-link">
  30. {{#if view.isActiveNNValid}}
  31. <td><a href="#" {{action showDetails view.model.activeNameNode.host}}>{{t dashboard.widgets.HDFSLinks.activeNameNode}}</a></td>
  32. {{else}}
  33. <td><a class="disabled-hdfs-link">{{t dashboard.widgets.HDFSLinks.activeNameNode}}</a></td>
  34. {{/if}}
  35. </tr>
  36. <!--Standby NameNodes-->
  37. <tr class="standby-namenode-link">
  38. {{#if view.isStandbyNNValid}}
  39. {{#if view.isTwoStandbyNN}}
  40. <!--Two Standby NameNodes-->
  41. <td><a href="#" {{action filterHosts view.twoStandbyComponent}}>{{t dashboard.widgets.HDFSLinks.standbyNameNodes}}</a></td>
  42. {{else}}
  43. <!--One Standby NameNode-->
  44. <td><a href="#" {{action showDetails view.model.standbyNameNode.host}}>{{t dashboard.widgets.HDFSLinks.standbyNameNode}}</a></td>
  45. {{/if}}
  46. {{else}}
  47. <td><a class="disabled-hdfs-link">{{t dashboard.widgets.HDFSLinks.standbyNameNode}}</a></td>
  48. {{/if}}
  49. </tr>
  50. <!--Data Nodes-->
  51. <tr class="datanode-link">
  52. <td>
  53. <a href="#" {{action filterHosts view.component}}>{{view.model.dataNodesTotal}} {{t dashboard.services.hdfs.datanodes}}</a>
  54. </td>
  55. </tr>
  56. </table>
  57. {{else}}
  58. <table>
  59. <!--NameNode-->
  60. <tr class="namenode-link">
  61. <td><a href="#" {{action showDetails view.model.nameNode.host}}>{{t dashboard.services.hdfs.nanmenode}}</a></td>
  62. </tr>
  63. <!--SecondaryNameNode-->
  64. <tr class="secondary-namenode-link">
  65. <td><a href="#" {{action showDetails view.model.snameNode.host}}>{{t dashboard.services.hdfs.snanmenode}}</a></td>
  66. </tr>
  67. <!--Data Nodes-->
  68. <tr class="datanode-link">
  69. <td>
  70. <a href="#" {{action filterHosts view.component}}>{{view.model.dataNodesTotal}} {{t dashboard.services.hdfs.datanodes}}</a>
  71. </td>
  72. </tr>
  73. </table>
  74. {{/if}}
  75. </div>
  76. <div class="link-button">
  77. {{#if view.model.quickLinks.length}}
  78. {{#view App.QuickLinksView contentBinding="view.model"}}
  79. <div class="btn-group">
  80. <a class="btn btn-mini dropdown-toggle" data-toggle="dropdown" href="#">
  81. {{t common.more}}
  82. <span class="caret"></span>
  83. </a>
  84. <ul class="dropdown-menu">
  85. {{#if view.isLoaded}}
  86. {{#if view.quickLinksArray}}
  87. <!--there are multiple masters eg, HBase multiple masters or HDFS HA enabled-->
  88. {{#each quickLinks in view.quickLinksArray}}
  89. <li class="dropdown-submenu">
  90. <a href="javascript:void(null)">{{quickLinks.publicHostNameLabel}} &nbsp;</a>
  91. <ul class="dropdown-menu">
  92. {{#each quickLinks}}
  93. <li><a {{bindAttr href="url"}} target="_blank">{{label}}</a></li>
  94. {{/each}}
  95. </ul>
  96. </li>
  97. {{/each}}
  98. {{else}}
  99. {{#each view.quickLinks}}
  100. <li><a {{bindAttr href="url"}} target="_blank">{{label}}</a></li>
  101. {{/each}}
  102. {{/if}}
  103. {{else}}
  104. {{view App.SpinnerView}}
  105. {{/if}}
  106. </ul>
  107. </div>
  108. {{/view}}
  109. {{/if}}
  110. </div>
  111. </li>
  112. </ul>
  113. </div>