controls.hbs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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.canEdit}}
  19. <div class="widget-config-controls">
  20. {{#if view.config.supportsFinal}}
  21. <a href="#" data-toggle="tooltip"
  22. {{bindAttr class=":widget-action :widget-action-final view.config.isFinal:active view.showFinalConfig:show:hide" disabled="view.config.isNotEditable"}}
  23. {{action "toggleFinalFlag" view.config target="view"}}
  24. {{translateAttr data-original-title="services.service.config.final"}}>
  25. <i class="icon-lock"></i>
  26. </a>
  27. {{/if}}
  28. {{#if view.overrideAllowed}}
  29. {{#isAccessible ADMIN}}
  30. <div {{bindAttr class=":widget-action :widget-action-override view.isHover:show:hide"}}>
  31. <a class="widget-action widget-action-override" href="#" data-toggle="tooltip"
  32. {{action "createOverrideProperty" view.config target="view.parentView"}}
  33. {{translateAttr data-original-title="common.override"}}>
  34. <i class="icon-plus-sign"></i>
  35. </a>
  36. </div>
  37. {{/isAccessible}}
  38. {{/if}}
  39. {{#unless view.isOriginalSCP}}
  40. {{#isAccessible ADMIN}}
  41. <a {{bindAttr class=":widget-action :widget-action-remove view.isHover:show:hide"}} href="#" data-toggle="tooltip"
  42. {{action "removeOverride" view.config target="view.parentView"}}
  43. {{translateAttr data-original-title="common.remove"}}>
  44. <i class="icon-minus-sign"></i>
  45. </a>
  46. {{/isAccessible}}
  47. {{/unless}}
  48. {{#if view.config.isNotDefaultValue}}
  49. {{#if view.undoAllowed}}
  50. <a class="widget-action widget-action-undo" href="#" {{action "restoreValue" target="view"}}>
  51. <i class="icon-undo"></i>
  52. </a>
  53. {{/if}}
  54. {{/if}}
  55. </div>
  56. <div class="clearfix"></div>
  57. {{/if}}
  58. {{#if controller.selectedConfigGroup.isDefault}}
  59. {{#if view.configGroup}}
  60. <a href="#" data-toggle="tooltip" {{bindAttr data-original-title="view.configGroup.switchGroupTextFull" }}
  61. class="action" {{action selectConfigGroup view.configGroup target="controller"}}>
  62. {{view.configGroup.switchGroupTextShort}}
  63. </a>
  64. {{/if}}
  65. {{/if}}
  66. {{#if view.config.errorMessage}}
  67. <p class="text-error">{{view.config.errorMessage}}</p>
  68. {{else}}
  69. {{#if view.config.warnMessage}}
  70. <p class="text-warning">{{view.config.warnMessage}}</p>
  71. {{else}}
  72. <p>&nbsp;</p>
  73. {{/if}}
  74. {{/if}}
  75. {{#if view.isComparison}}
  76. <div class="widget-config-controls">
  77. {{#if controller.selectedConfigGroup.isDefault}}
  78. <span
  79. class="label label-info">{{t dashboard.configHistory.table.version.prefix}}{{controller.selectedVersion}}</span>
  80. {{#if controller.isCurrentSelected}}
  81. <span class="label label-success">{{t common.current}}</span>
  82. {{/if}}
  83. {{else}}
  84. <span class="label label-info">{{t common.default}}
  85. &nbsp;{{t services.service.config.configHistory.configGroup}}</span>
  86. {{/if}}
  87. </div>
  88. {{/if}}
  89. {{#if view.isOriginalSCP}}
  90. {{view App.ConfigWidgetOverrideView
  91. serviceConfigPropertyBinding="view.config"
  92. isDefaultGroupSelectedBinding="controller.selectedConfigGroup.isDefault"
  93. }}
  94. {{/if}}
  95. {{#if view.isComparison}}
  96. {{view App.ConfigWidgetComparisonView serviceConfigPropertyBinding="view.config"}}
  97. {{/if}}