service_config.hbs 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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.supportsHostOverrides}}
  19. {{#if selectedService.restartRequired}}
  20. <div class="alert">
  21. <div class="clearfix like_pointer collapsable" {{action toggleRestartMessageView target="view"}}>
  22. {{#if view.isRestartMessageCollapsed}}
  23. <i class="icon-caret-down pull-left"></i>
  24. {{else}}
  25. <i class="icon-caret-right pull-left"></i>
  26. {{/if}}
  27. <i class="icon-refresh"></i>
  28. <strong>{{t dashboard.services.configs.popup.restartService.header}}</strong> {{selectedService.restartRequiredMessage}}
  29. </div>
  30. <div class="service-body">
  31. <ul>
  32. {{#each host in selectedService.restartRequiredHostsAndComponents}}
  33. <li>
  34. <a href="#" {{action showDetails host.hostData}}>{{host.hostData.publicHostName}}</a>
  35. <ul>
  36. {{#each component in host.components}}
  37. <li>{{component.name}}</li>
  38. {{/each}}
  39. </ul>
  40. </li>
  41. {{/each}}
  42. </ul>
  43. </div>
  44. </div>
  45. {{/if}}
  46. {{/if}}
  47. {{#if view.supportsHostOverrides}}
  48. <div class="alert alert-info">
  49. {{t common.group}}&nbsp;
  50. <span class="btn-group">
  51. <button {{bindAttr disabled="controller.isHostsConfigsPage"}} class="btn">{{selectedConfigGroup.displayNameHosts}}</button>
  52. <button {{bindAttr disabled="controller.isHostsConfigsPage"}} class="btn dropdown-toggle" data-toggle="dropdown">
  53. <span class="caret"></span>
  54. </button>
  55. <ul class="dropdown-menu">
  56. <!-- available config group menu links -->
  57. {{#each configGroup in configGroups}}
  58. <li>
  59. <a href="#" {{action "selectConfigGroup" configGroup target="controller"}}>
  60. {{configGroup.displayNameHosts}}
  61. </a>
  62. </li>
  63. {{/each}}
  64. </ul>
  65. </span>
  66. {{#if App.isAdmin}}
  67. {{#if controller.isHostsConfigsPage}}
  68. &nbsp;<a href="#" {{action "switchHostGroup" target="controller"}}>{{t common.change}}</a>
  69. {{else}}
  70. <a href="#" class="link-left-pad" {{action "manageConfigurationGroup" target="controller"}}>{{t services.service.actions.manage_configuration_groups.short}}</a>
  71. {{/if}}
  72. {{/if}}
  73. <div class="pull-right">
  74. {{view App.FilterComboCleanableView filterBinding="view.filter" columnsBinding="view.columns" popoverDescriptionBinding="view.propertyFilterPopover"}}
  75. </div>
  76. </div>
  77. {{/if}}
  78. <div class="accordion">
  79. {{#each category in selectedService.configCategories}}
  80. {{#if category.isCustomView}}
  81. {{#if App.supports.capacitySchedulerUi}}
  82. {{view category.customView categoryBinding="category" serviceBinding="selectedService" canEditBinding="view.canEdit" serviceConfigsBinding="selectedService.configs"}}
  83. {{/if}}
  84. {{else}}
  85. {{#view App.ServiceConfigsByCategoryView categoryBinding="category" canEditBinding="view.canEdit" serviceBinding="selectedService" serviceConfigsBinding="selectedService.configs" supportsHostOverridesBinding="view.supportsHostOverrides"}}
  86. <div class="accordion-heading" {{action "onToggleBlock" category target="view"}}>
  87. <i {{bindAttr class=":pull-left :accordion-toggle category.isCollapsed:icon-caret-right:icon-caret-down"}}></i>
  88. <a class="accordion-toggle">{{category.displayName}}</a>
  89. </div>
  90. <div class="accordion-body collapse in" {{bindAttr style="view.isCategoryBodyVisible"}}>
  91. <div class="accordion-inner service-config-section">
  92. <form class="form-horizontal" autocomplete="off">
  93. {{#each view.filteredCategoryConfigs}}
  94. <div {{bindAttr class=":entry-row isOverridden:overridden-property"}}>
  95. {{#if showLabel}}
  96. <span {{bindAttr class="errorMessage:error: :control-group :control-label-span"}}>
  97. <label class="control-label">
  98. {{formatWordBreak displayName}}
  99. {{#if App.supports.secureCluster}}
  100. {{#if isSecureConfig}}
  101. <a href="javascript:void(null);"><i class="icon-lock" rel="tooltip" data-toggle="tooltip" title="security knob"></i></a>
  102. {{/if}}
  103. {{/if}}
  104. {{#if view.supportsHostOverrides}}
  105. {{#if isRestartRequired}}
  106. <i class="icon-refresh restart-required-property" rel="tooltip" {{bindAttr title="restartRequiredMessage"}}></i>
  107. {{/if}}
  108. {{/if}}
  109. </label>
  110. </span>
  111. {{/if}}
  112. <div {{bindAttr class="showLabel:controls"}}>
  113. {{! Here serviceConfigBinding should ideally be serviceConfigPropertyBinding }}
  114. <div {{bindAttr class="errorMessage:error: warnMessage:warning: :control-group"}}>
  115. {{view viewClass serviceConfigBinding="this" categoryConfigsAllBinding="view.categoryConfigsAll" }}
  116. {{#if view.canEdit}}
  117. {{#if isPropertyOverridable}}
  118. {{#if view.supportsHostOverrides}}
  119. {{#if App.isAdmin}}
  120. <a class="action" {{action "createOverrideProperty" this target="view" }} ><i class="icon-plus-sign"></i>{{t common.override}}</a>
  121. {{/if}}
  122. {{/if}}
  123. {{/if}}
  124. {{#unless cantBeUndone}}
  125. {{#if isNotDefaultValue}}
  126. <a class="action" {{action "doRestoreDefaultValue" this target="view" }} ><i class="icon-undo"></i>{{t common.undo}}</a>
  127. {{/if}}
  128. {{/unless}}
  129. {{#if isRemovable}}
  130. {{#if App.isAdmin}}
  131. <a class="action" {{action "removeProperty" this target="view" }} ><i class="icon-minus-sign"></i>{{t common.remove}}</a>
  132. {{/if}}
  133. {{/if}}
  134. {{/if}}
  135. <span class="help-inline">{{errorMessage}}</span>
  136. <span class="help-inline">{{warnMessage}}</span>
  137. </div>
  138. {{#if this.isOverridden}}
  139. {{view App.ServiceConfigView.SCPOverriddenRowsView serviceConfigPropertyBinding="this" isDefaultGroupSelectedBinding="controller.selectedConfigGroup.isDefault"}}
  140. {{/if}}
  141. </div>
  142. </div>
  143. {{#if this.additionalView}}
  144. {{view additionalView}}
  145. {{/if}}
  146. {{/each}}
  147. {{! For Advanced, Advanced Core Site, Advanced HDFS Site sections, show the 'Add Property' link.}}
  148. {{#if App.isAdmin}}
  149. {{#if view.canEdit}}
  150. {{#if category.customCanAddProperty }}
  151. <div>
  152. <a href="#" {{action "showAddPropertyWindow" this target="view" }} >{{t installer.step7.config.addProperty}}...</a>
  153. </div>
  154. {{/if}}
  155. {{/if}}
  156. {{/if}}
  157. </form>
  158. </div>
  159. </div>
  160. {{/view}}
  161. {{/if}}
  162. {{/each}}
  163. </div>