kc-component-config.html 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <div>
  2. <div data-ng-repeat="option in properties" class="form-group" data-ng-controller="ProviderConfigCtrl">
  3. <label class="col-md-2 control-label">{{:: option.label | translate}}</label>
  4. <div class="col-md-6" data-ng-if="option.type == 'String'">
  5. <input class="form-control" type="text" data-ng-model="config[ option.name ][0]" >
  6. </div>
  7. <div class="col-md-6" data-ng-if="option.type == 'Password'">
  8. <input class="form-control" type="password" data-ng-model="config[ option.name ][0]" >
  9. </div>
  10. <div class="col-md-6" data-ng-if="option.type == 'boolean'">
  11. <input ng-model="config[ option.name ][0]" value="'true'" id="option.name" name="option.name" onoffswitchstring on-text="{{:: 'onText' | translate}}" off-text="{{:: 'offText' | translate}}"/>
  12. </div>
  13. <div class="col-md-6" data-ng-if="option.type == 'List'">
  14. <select ng-model="config[ option.name ][0]" ng-options="data for data in option.options">
  15. <option value="" selected> {{:: 'selectOne' | translate}} </option>
  16. </select>
  17. </div>
  18. <div class="col-md-6" data-ng-if="option.type == 'MultivaluedList'">
  19. <input ui-select2="option.mvOptions" ng-model="config[ option.name ]" data-placeholder="{{:: 'selectMultiple' | translate}}..."/>
  20. </div>
  21. <div class="col-md-6" data-ng-if="option.type == 'Role'">
  22. <div class="row">
  23. <div class="col-md-8">
  24. <input class="form-control" type="text" data-ng-model="config[ option.name ]" >
  25. </div>
  26. <div class="col-md-2">
  27. <button type="button" data-ng-click="openRoleSelector(option.name, config)" class="btn btn-default" tooltip-placement="top" tooltip-trigger="mouseover mouseout" tooltip="{{:: 'selectRole.tooltip' | translate}}">{{:: 'selectRole.label' | translate}}</button>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="col-md-4" data-ng-if="option.type == 'ClientList'">
  32. <input type="hidden" ui-select2="clientsUiSelect" id="clients" data-ng-init="initSelectedClient(option.name, config)" data-ng-model="selectedClient" data-ng-change="changeClient(option.name, config, selectedClient, true);" data-placeholder="{{:: 'selectOne' | translate}}...">
  33. </input>
  34. </div>
  35. <div class="col-md-6" data-ng-if="option.type == 'File'">
  36. <div class="controls kc-button-input-file">
  37. <input class="form-control" type="text" data-ng-model="config[option.name][0]" >
  38. <label for="{{option.name}}" class="btn btn-default">{{:: 'select-file' | translate}} <i class="pficon pficon-import"></i></label>
  39. <input id="{{option.name}}" type="file" class="hidden" ng-file-select="uploadFile($files, option.name, config)">
  40. </div>
  41. </div>
  42. <div class="col-md-6" data-ng-if="option.type == 'Script'">
  43. <div ng-model="config[option.name]" placeholder="Enter your script..." ui-ace="{ onLoad : initEditor, useWrapMode: true, showGutter: true, theme:'github', mode: 'javascript'}">
  44. {{config[option.name]}}
  45. </div>
  46. </div>
  47. <div class="col-sm-6" data-ng-if="option.type == 'MultivaluedString'">
  48. <div class="input-group" ng-repeat="(i, currentOption) in config[option.name] track by $index">
  49. <input class="form-control" ng-model="config[option.name][i]">
  50. <div class="input-group-btn" data-ng-if="$index < config[option.name].length - 1">
  51. <button class="btn btn-default" type="button" data-ng-click="deleteValueFromMultivalued(option.name, $index)"><span class="fa fa-minus"></span></button>
  52. </div>
  53. <div class="input-group-btn" data-ng-if="$index === config[option.name].length - 1">
  54. <button class="btn btn-default" type="button" data-ng-click="addValueToMultivalued(option.name)"><span class="fa fa-plus"></span></button>
  55. </div>
  56. </div>
  57. </div>
  58. <kc-tooltip>{{:: option.helpText | translate}}</kc-tooltip>
  59. </div>
  60. </div>