partial-import.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2">
  2. <h1>
  3. <span>{{:: 'partial-import' | translate}}</span>
  4. <kc-tooltip>{{:: 'partial-import.tooltip' | translate}}</kc-tooltip>
  5. </h1>
  6. <form class="form-horizontal" name="partialImportForm" novalidate>
  7. <fieldset class="border-top">
  8. <div class="form-group">
  9. <label for="name" class="col-sm-2 control-label">{{:: 'exported-json-file' | translate}}</label>
  10. <div class="col-md-6" data-ng-hide="importing">
  11. <label for="import-file" class="btn btn-default">{{:: 'select-file'| translate}} <i class="pficon pficon-import"></i></label>
  12. <input id="import-file" type="file" class="hidden" kc-on-read-file="importFile($fileContent)"/>
  13. </div>
  14. <div class="col-md-6" data-ng-show="importing">
  15. <button class="btn btn-default" data-ng-click="viewImportDetails()">{{:: 'view-details'| translate}}</button>
  16. <button class="btn btn-default" data-ng-click="reset()">{{:: 'clear-import'| translate}}</button>
  17. </div>
  18. </div>
  19. <div class="form-group" data-ng-show="importing && isMultiRealm && !hasResults()">
  20. <label for="fromRealm" class="col-md-2 control-label">{{:: 'import-from-realm' | translate}}</label>
  21. <div class="col-md-2">
  22. <div>
  23. <select id="fromRealm" ng-model="fileContent" class="form-control"
  24. ng-options="item as item.realm for item in rawContent">
  25. </select>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="form-group" data-ng-show="importing && hasArray('users') && !hasResults()">
  30. <label class="col-md-2 control-label" for="importUsers">{{:: 'import-users' | translate}} ({{itemCount('users')}})</label>
  31. <div class="col-sm-6">
  32. <input ng-model="importUsers" name="importUsers" id="importUsers" onoffswitch on-text="{{:: 'onText'| translate}}" off-text="{{:: 'offText'| translate}}"/>
  33. </div>
  34. </div>
  35. <div class="form-group" data-ng-show="importing && hasArray('groups') && !hasResults()">
  36. <label class="col-md-2 control-label" for="importGroups">{{:: 'import-groups' | translate}} ({{itemCount('groups')}})</label>
  37. <div class="col-sm-6">
  38. <input ng-model="importGroups" name="importGroups" id="importGroups" onoffswitch on-text="{{:: 'onText'| translate}}" off-text="{{:: 'offText'| translate}}"/>
  39. </div>
  40. </div>
  41. <div class="form-group" data-ng-show="importing && hasArray('clients') && !hasResults()">
  42. <label class="col-md-2 control-label" for="importClients">{{:: 'import-clients' | translate}} ({{itemCount('clients')}})</label>
  43. <div class="col-sm-6">
  44. <input ng-model="importClients" name="importClients" id="importClients" onoffswitch on-text="{{:: 'onText'| translate}}" off-text="{{:: 'offText'| translate}}"/>
  45. </div>
  46. </div>
  47. <div class="form-group" data-ng-show="importing && hasArray('identityProviders') && !hasResults()">
  48. <label class="col-md-2 control-label" for="importIdentityProviders">{{:: 'import-identity-providers' | translate}} ({{itemCount('identityProviders')}})</label>
  49. <div class="col-sm-6">
  50. <input ng-model="importIdentityProviders" name="importIdentityProviders" id="importIdentityProviders" onoffswitch on-text="{{:: 'onText'| translate}}" off-text="{{:: 'offText'| translate}}"/>
  51. </div>
  52. </div>
  53. <div class="form-group" data-ng-show="importing && hasRealmRoles() && !hasResults()">
  54. <label class="col-md-2 control-label" for="importRealmRoles">{{:: 'import-realm-roles' | translate}} ({{itemCount('roles.realm')}})</label>
  55. <div class="col-sm-6">
  56. <input ng-model="importRealmRoles" name="importRealmRoles" id="importRealmRoles" onoffswitch on-text="{{:: 'onText'| translate}}" off-text="{{:: 'offText'| translate}}"/>
  57. </div>
  58. </div>
  59. <div class="form-group" data-ng-show="importing && hasClientRoles() && !hasResults()">
  60. <label class="col-md-2 control-label" for="importClientRoles">{{:: 'import-client-roles' | translate}} ({{itemCount('roles.client')}})</label>
  61. <div class="col-sm-6">
  62. <input ng-model="importClientRoles" name="importClientRoles" id="importClientRoles" onoffswitch on-text="{{:: 'onText'| translate}}" off-text="{{:: 'offText'| translate}}"/>
  63. </div>
  64. </div>
  65. <div class="form-group" data-ng-show="importing && hasResources() && !hasResults()">
  66. <label for="ifResourceExists" class="col-md-2 control-label">{{:: 'if-resource-exists' | translate}}</label>
  67. <div class="col-md-2">
  68. <div>
  69. <select id="ifResourceExists" ng-model="ifResourceExists" class="form-control">
  70. <option value="FAIL">{{:: 'fail' | translate}}</option>
  71. <option value="SKIP">{{:: 'skip' | translate}}</option>
  72. <option value="OVERWRITE">{{:: 'overwrite' | translate}}</option>
  73. </select>
  74. </div>
  75. </div>
  76. <kc-tooltip>{{:: 'if-resource-exists.tooltip' | translate}}</kc-tooltip>
  77. </div>
  78. </fieldset>
  79. <div class="form-group" data-ng-show="importing && hasResources() && !hasResults()">
  80. <div class="col-md-10 col-md-offset-2">
  81. <button kc-save data-ng-disabled="!changed">{{:: 'import'| translate}}</button>
  82. </div>
  83. </div>
  84. <div class="form-group" data-ng-show="hasResults()">
  85. {{successMessage()}}
  86. <table class="table table-striped table-bordered">
  87. <thead>
  88. <tr>
  89. <th>{{:: 'action' | translate}}</th>
  90. <th>{{:: 'type' | translate}}</th>
  91. <th>{{:: 'name' | translate}}</th>
  92. <th>{{:: 'id' | translate}}</th>
  93. </tr>
  94. </thead>
  95. <tbody>
  96. <tr ng-repeat="result in resultsPage()" >
  97. <td ng-show="result.action == 'OVERWRITTEN'"><span class="label label-danger">{{result.action}}</span></td>
  98. <td ng-show="result.action == 'SKIPPED'"><span class="label label-warning">{{result.action}}</span></td>
  99. <td ng-show="result.action == 'ADDED'"><span class="label label-success">{{result.action}}</span></td>
  100. <td>{{result.resourceType}}</td>
  101. <td>{{result.resourceName}}</td>
  102. <td>{{result.id}}</td>
  103. </tr>
  104. </tbody>
  105. </table>
  106. <div class="table-nav">
  107. <button data-ng-click="setFirstPage()" class="first" ng-disabled="">{{:: 'first-page' | translate}}</button>
  108. <button data-ng-click="setPreviousPage()" class="prev" ng-disabled="!hasPrevious()">{{:: 'previous-page' | translate}}</button>
  109. <button data-ng-click="setNextPage()" class="next" ng-disabled="!hasNext()">{{:: 'next-page' | translate}}</button>
  110. </div>
  111. </div>
  112. </form>
  113. </div>
  114. <kc-menu></kc-menu>