summary.hbs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. {{#if view.service.isRestartRequired}}
  19. {{#isAccessible ADMIN}}
  20. <div id="summary-restart-bar">
  21. <div class="alert alert-warning clearfix">
  22. <i class="icon-refresh"></i> {{{view.needToRestartMessage}}} {{t services.service.config.restartService.needToRestart}}
  23. <a href="#" {{action showComponentsShouldBeRestarted controller.content target="App.router.mainServiceInfoConfigsController"}}>{{view.componentsCount}} {{pluralize view.componentsCount singular="t:common.component" plural="t:common.components"}}</a> {{t on}}
  24. <a href="#" {{action showHostsShouldBeRestarted controller.content target="App.router.mainServiceInfoConfigsController"}}>{{view.hostsCount}} {{pluralize view.hostsCount singular="t:common.host" plural="t:common.hosts"}}</a>
  25. <span class="restart-components pull-right">&nbsp</span>
  26. <div class="btn-group pull-right">
  27. <button type="button" class="btn btn-default dropdown-toggle btn-warning" data-toggle="dropdown">
  28. {{t hosts.host.details.needToRestart.button}}
  29. <span class="caret"></span>
  30. </button>
  31. <ul class="dropdown-menu">
  32. <li>
  33. <a href="#" {{action restartAllStaleConfigComponents target="view"}}>{{t restart.service.all.affected}}</a>
  34. </li>
  35. {{#if view.rollingRestartSlaveComponentName}}
  36. <li>
  37. <a href="#" {{action rollingRestartStaleConfigSlaveComponents view.rollingRestartSlaveComponentName target="view"}}>{{view.rollingRestartActionName}}</a>
  38. </li>
  39. {{/if}}
  40. </ul>
  41. </div>
  42. </div>
  43. </div>
  44. {{/isAccessible}}
  45. {{/if}}
  46. <div class="service-block">
  47. <div class="box">
  48. <div class="box-header summary-box-header">
  49. <h4>{{controller.content.label}} {{t services.service.info.menu.summary}}</h4>
  50. {{#if view.hasAlertDefinitions}}
  51. {{#if view.alertsCount}}
  52. <span {{action "showServiceAlertsPopup" controller.content target="controller"}}
  53. {{bindAttr class=":label :pull-right view.hasCriticalAlerts:alerts-crit-count:alerts-warn-count"}}>
  54. {{view.alertsCount}} {{pluralize view.alertsCount singular="alert" plural="alerts"}}</span>
  55. {{else}}
  56. <span {{action "showServiceAlertsPopup" controller.content target="controller"}}
  57. class="label pull-right no-alerts-label">{{t services.service.summary.alerts.noAlerts}}</span>
  58. {{/if}}
  59. {{/if}}
  60. </div>
  61. {{#if view.serviceSummaryView}}
  62. {{view view.serviceSummaryView}}
  63. {{else}}
  64. <div class="spinner"></div>
  65. {{/if}}
  66. </div>
  67. {{! widgets in the metrics panel are loaded seperately from summary page text information
  68. and does not get block due to any global API poller information }}
  69. {{#if view.isServiceMetricLoaded}}
  70. <div class="service-metrics-block">
  71. <div class="box">
  72. <div class="box-header">
  73. <h4>{{t services.service.metrics}}</h4>
  74. {{#if showTimeRangeControl}}
  75. {{view view.timeRangeListView}}
  76. {{/if}}
  77. {{#if isServiceWithEnhancedWidgets}}
  78. {{#if isAmbariMetricsInstalled}}
  79. <div class="btn-group pull-right actions">
  80. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
  81. {{t common.actions}} &nbsp;<span class="caret"></span>
  82. </button>
  83. <ul class="dropdown-menu">
  84. {{#each option in view.widgetActions}}
  85. <li {{bindAttr class="option.layouts:dropdown-submenu"}}>
  86. {{#if option.isAction}}
  87. <a href="#" {{action doWidgetAction option.action target="view"}}>
  88. <i {{bindAttr class="option.class"}}></i>
  89. {{option.label}}
  90. </a>
  91. {{#if option.layouts}}
  92. <ul class="dropdown-menu">
  93. {{#each layout in option.layouts}}
  94. <li>
  95. <a href="javascript:void(0);">
  96. {{layout.layoutName}}
  97. </a>
  98. </li>
  99. {{/each}}
  100. </ul>
  101. {{/if}}
  102. {{/if}}
  103. </li>
  104. {{/each}}
  105. </ul>
  106. </div>
  107. {{/if}}
  108. {{/if}}
  109. </div>
  110. <div>
  111. {{#if isServiceWithEnhancedWidgets}}
  112. <div id="widget_layout" class="row-fluid">
  113. {{#each widget in controller.widgets}}
  114. <div class="widget span2p4" {{bindAttr id="widget.id"}}>
  115. {{view widget.viewClass contentBinding="widget" idBinding="widget.id"}}
  116. </div>
  117. {{/each}}
  118. {{#if isAmbariMetricsInstalled}}
  119. <div class="span2p4">
  120. <button id="add-widget-action-box"
  121. class="btn btn-default" {{action "goToWidgetsBrowser" controller.content target="controller"}}
  122. rel="add-widget-tooltip" {{translateAttr data-original-title="dashboard.widgets.addButton.tooltip"}}>
  123. <i class="icon-plus"></i></button>
  124. </div>
  125. {{/if}}
  126. </div>
  127. {{/if}}
  128. <table class="graphs">
  129. {{#each graphs in view.serviceMetricGraphs}}
  130. <tr>
  131. {{#each graph in graphs}}
  132. <td>
  133. <div class="">
  134. {{view graph}}
  135. </div>
  136. </td>
  137. {{/each}}
  138. </tr>
  139. {{/each}}
  140. </table>
  141. </div>
  142. </div>
  143. </div>
  144. {{/if}}
  145. </div>
  146. {{#if view.collapsedSections}}
  147. <div class="row-fluid">
  148. <div class="span12 metrics-collapsed-graphs">
  149. {{#each collapsedSection in view.collapsedSections}}
  150. {{view collapsedSection}}
  151. {{/each}}
  152. </div>
  153. </div>
  154. {{/if}}