kc-provider-config.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 ]" >
  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 ]" >
  9. </div>
  10. <div class="col-md-6" data-ng-if="option.type == 'boolean'">
  11. <input ng-model="config[ option.name ]" value="'true'" name="option.name" id="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 ]" 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-6" data-ng-if="option.type == 'Group'">
  32. <div class="row">
  33. <div class="col-md-8">
  34. <input class="form-control" type="text" data-ng-model="config[ option.name ]" >
  35. </div>
  36. <div class="col-md-2">
  37. <button type="button" data-ng-click="openGroupSelector(option.name, config)" class="btn btn-default" tooltip-placement="top" tooltip-trigger="mouseover mouseout" tooltip="{{:: 'selectGroup.tooltip' | translate}}">{{:: 'selectGroup.label' | translate}}</button>
  38. </div>
  39. </div>
  40. </div>
  41. <div class="col-md-4" data-ng-if="option.type == 'ClientList'">
  42. <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, false);" data-placeholder="{{:: 'selectOne' | translate}}...">
  43. </input>
  44. </div>
  45. <div class="col-md-6" data-ng-if="option.type == 'Script'">
  46. <div ng-model="config[option.name]" placeholder="Enter your script..." ui-ace="{ onLoad : initEditor, useWrapMode: true, showGutter: true, theme:'github', mode: 'javascript'}">
  47. {{config[option.name]}}
  48. </div>
  49. </div>
  50. <div class="col-sm-6" data-ng-if="option.type == 'MultivaluedString'">
  51. <div class="input-group" ng-repeat="(i, currentOption) in config[option.name] track by $index">
  52. <input class="form-control" ng-model="config[option.name][i]">
  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="deleteValueFromMultivalued(option.name, $index)"><span class="fa fa-minus"></span></button>
  55. </div>
  56. <div class="input-group-btn" data-ng-if="$index === config[option.name].length - 1">
  57. <button class="btn btn-default" type="button" data-ng-click="addValueToMultivalued(option.name)"><span class="fa fa-plus"></span></button>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="col-md-6" data-ng-if="option.type == 'Text'">
  62. <textarea class="form-control" data-ng-model="config[ option.name ]"></textarea>
  63. </div>
  64. <div class="col-md-6" data-ng-if="option.type == 'Map'">
  65. <table class="table table-striped table-bordered">
  66. <thead>
  67. <tr>
  68. <th>{{:: 'key' | translate}}</th>
  69. <th>{{:: 'value' | translate}}</th>
  70. <th>{{:: 'actions' | translate}}</th>
  71. </tr>
  72. </thead>
  73. <tbody>
  74. <tr ng-repeat="mapEntry in jsonParseMap(option.name)">
  75. <td>{{mapEntry['key']}}</td>
  76. <td><input ng-model="mapEntry['value']"
  77. ng-change="updateMapEntry(option.name, mapEntry['key'], mapEntry['value'])"
  78. class="form-control" type="text" name="{{mapEntry['key']}}" id="mapValue-{{option.name}}-{{mapEntry['key']}}"/></td>
  79. <td class="kc-action-cell" id="removeMapEntry-{{option.name}}" data-ng-click="removeMapEntry(option.name, mapEntry['key'])">{{:: 'delete' | translate}}
  80. </td>
  81. </tr>
  82. <tr>
  83. <td><input ng-model="newMapEntries[option.name].key" class="form-control" type="text" id="newMapEntryKey-{{option.name}}"/></td>
  84. <td><input ng-model="newMapEntries[option.name].value" class="form-control" type="text" id="newMapEntryValue-{{option.name}}"/></td>
  85. <td class="kc-action-cell" id="addMapEntry-{{option.name}}" data-ng-click="addMapEntry(option.name)"
  86. data-ng-disabled="!newMapEntry.key.length || !newMapEntry.value.length">{{:: 'add' | translate}}
  87. </td>
  88. </tr>
  89. </tbody>
  90. </table>
  91. </div>
  92. <kc-tooltip>{{:: option.helpText | translate}}</kc-tooltip>
  93. </div>
  94. </div>