summary.hbs 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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.restartRequiredHostsAndComponents 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.restartRequiredHostsAndComponents 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. <div class="service-content row-fluid">
  62. <div class="span6">
  63. <table class="summary-info table no-borders table-condensed">
  64. <tbody>
  65. {{#if view.serviceSummaryView}}
  66. {{view view.serviceSummaryView}}
  67. {{/if}}
  68. </tbody>
  69. </table>
  70. </div>
  71. </div>
  72. </div>
  73. {{#if view.isServiceMetricLoaded}}
  74. <div class="service-metrics-block">
  75. <div class="box">
  76. <div class="box-header">
  77. <h4>{{t services.service.metrics}}</h4>
  78. <div class="btn-group pull-right">
  79. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
  80. {{view.currentTimeRange.name}} &nbsp;<span class="caret"></span>
  81. </button>
  82. <ul class="dropdown-menu">
  83. {{#each option in view.timeRangeOptions}}
  84. <li><a href="#" {{action setTimeRange option target="view"}}>{{option.name}}</a></li>
  85. {{/each}}
  86. </ul>
  87. </div>
  88. {{#if isServiceWithEnhancedWidgets}}
  89. <div class="btn-group pull-right actions">
  90. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
  91. {{t common.actions}} &nbsp;<span class="caret"></span>
  92. </button>
  93. <ul class="dropdown-menu">
  94. {{#each option in view.widgetActions}}
  95. <li {{bindAttr class="option.layouts:dropdown-submenu"}}>
  96. {{#if option.isAction}}
  97. <a href="#" {{action doWidgetAction option.action target="view"}}>
  98. <i {{bindAttr class="option.class"}}></i>
  99. {{option.label}}
  100. </a>
  101. {{#if option.layouts}}
  102. <ul class="dropdown-menu">
  103. {{#each layout in option.layouts}}
  104. <li>
  105. <a href="javascript:void(0);">
  106. {{layout.layoutName}}
  107. </a>
  108. </li>
  109. {{/each}}
  110. </ul>
  111. {{/if}}
  112. {{/if}}
  113. </li>
  114. {{/each}}
  115. </ul>
  116. </div>
  117. {{/if}}
  118. </div>
  119. <div>
  120. {{#if isServiceWithEnhancedWidgets}}
  121. <div id="widget_layout" class="row-fluid">
  122. {{#each widget in controller.widgets}}
  123. <div class="widget span2p4" {{bindAttr id="widget.id"}}>
  124. {{view widget.viewClass contentBinding="widget" idBinding="widget.id"}}
  125. </div>
  126. {{/each}}
  127. <div class="span2p4">
  128. <button id="add-widget-action-box"
  129. class="btn btn-default" {{action "goToWidgetsBrowser" controller.content target="controller"}}><i
  130. class="icon-plus"></i></button>
  131. </div>
  132. </div>
  133. {{/if}}
  134. <table class="graphs">
  135. {{#each graphs in view.serviceMetricGraphs}}
  136. <tr>
  137. {{#each graph in graphs}}
  138. <td>
  139. <div class="">
  140. {{view graph}}
  141. </div>
  142. </td>
  143. {{/each}}
  144. </tr>
  145. {{/each}}
  146. </table>
  147. </div>
  148. </div>
  149. </div>
  150. {{/if}}
  151. </div>
  152. {{#if view.collapsedSections}}
  153. <div class="row-fluid">
  154. <div class="span12 metrics-collapsed-graphs">
  155. {{#each collapsedSection in view.collapsedSections}}
  156. <div {{bindAttr class=":accordion collapsedSection.toggleIndex"}}>
  157. <div class="accordion-group box">
  158. <div class="accordion-heading box-header">
  159. <span class="pull-left accordion-toggle"
  160. data-toggle="collapse" {{bindAttr dataParent="collapsedSection.toggleIndex" href="collapsedSection.toggleIndex"}}>
  161. <i class="pull-left icon-caret-toggle"></i>
  162. <span>{{collapsedSection.header}}</span>
  163. </span>
  164. <a class="btn pull-right" {{bindAttr href="collapsedSection.url"}} target="_blank">
  165. <i class="icon-link"></i>
  166. </a>
  167. <div class="clearfix"></div>
  168. </div>
  169. <div class="accordion-body collapse in" {{bindAttr id="collapsedSection.id"}}>
  170. <div class="accordion-inner">
  171. {{#if collapsedSection.metricView}}
  172. {{view collapsedSection.metricView viewDataBinding="collapsedSection.metricViewData"}}
  173. {{/if}}
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. {{/each}}
  179. </div>
  180. </div>
  181. {{/if}}