resource-server-resource-detail.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2">
  2. <ol class="breadcrumb">
  3. <li><a href="#/realms/{{realm.realm}}/clients">{{:: 'clients' | translate}}</a></li>
  4. <li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}">{{client.clientId}}</a></li>
  5. <li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server">{{:: 'authz-authorization' | translate}}</a></li>
  6. <li><a href="#/realms/{{realm.realm}}/clients/{{client.id}}/authz/resource-server/resource">{{:: 'authz-resources' | translate}}</a></li>
  7. <li data-ng-show="create">{{:: 'authz-add-resource' | translate}}</li>
  8. <li data-ng-hide="create">{{originalResource.name}}</li>
  9. </ol>
  10. <h1 data-ng-show="create">{{:: 'authz-add-resource' | translate}}</h1>
  11. <h1 data-ng-hide="create">{{originalResource.name|capitalize}}<i class="pficon pficon-delete clickable" data-ng-show="!create"
  12. data-ng-click="remove()"></i></h1>
  13. <form class="form-horizontal" name="clientForm" novalidate>
  14. <fieldset class="border-top">
  15. <div class="form-group">
  16. <label class="col-md-2 control-label" for="name">{{:: 'name' | translate}} <span class="required" data-ng-show="create">*</span></label>
  17. <div class="col-sm-6">
  18. <input class="form-control" type="text" id="name" name="name" data-ng-model="resource.name" autofocus required data-ng-blur="checkNewNameAvailability()">
  19. </div>
  20. <kc-tooltip>{{:: 'authz-resource-name.tooltip' | translate}}</kc-tooltip>
  21. </div>
  22. <div class="form-group">
  23. <label class="col-md-2 control-label" for="name">{{:: 'displayName' | translate}} <span class="required" data-ng-show="create">*</span></label>
  24. <div class="col-sm-6">
  25. <input class="form-control" type="text" id="displayName" name="displayName" data-ng-model="resource.displayName">
  26. </div>
  27. <kc-tooltip>{{:: 'authz-resource-name.tooltip' | translate}}</kc-tooltip>
  28. </div>
  29. <div class="form-group" data-ng-hide="create">
  30. <label class="col-md-2 control-label" for="resource.owner.name">{{:: 'authz-owner' | translate}} </label>
  31. <div class="col-sm-6">
  32. <input class="form-control" type="text" id="resource.owner.name" name="name" data-ng-model="resource.owner.name" autofocus disabled>
  33. </div>
  34. <kc-tooltip>{{:: 'authz-resource-owner.tooltip' | translate}}</kc-tooltip>
  35. </div>
  36. <div class="form-group">
  37. <label class="col-md-2 control-label" for="type">{{:: 'type' | translate}} </label>
  38. <div class="col-sm-6">
  39. <input class="form-control" type="text" id="type" name="name" data-ng-model="resource.type" autofocus>
  40. </div>
  41. <kc-tooltip>{{:: 'authz-resource-type.tooltip' | translate}}</kc-tooltip>
  42. </div>
  43. <div class="form-group">
  44. <label class="col-md-2 control-label" for="newUri">{{:: 'authz-uri' | translate}} </label>
  45. <div class="col-sm-6">
  46. <div class="input-group" ng-repeat="(i, uri) in resource.uris track by $index">
  47. <input class="form-control" ng-model="resource.uris[i]">
  48. <div class="input-group-btn">
  49. <button class="btn btn-default" type="button" data-ng-click="deleteUri($index)"><span class="fa fa-minus"></span></button>
  50. </div>
  51. </div>
  52. <div class="input-group">
  53. <input class="form-control" ng-model="newUri" id="newUri">
  54. <div class="input-group-btn">
  55. <button class="btn btn-default" type="button" data-ng-click="newUri.length > 0 && addUri()"><span class="fa fa-plus"></span></button>
  56. </div>
  57. </div>
  58. </div>
  59. <kc-tooltip>{{:: 'authz-resource-uri.tooltip' | translate}}</kc-tooltip>
  60. </div>
  61. <div class="form-group clearfix">
  62. <label class="col-md-2 control-label" for="scopes">{{:: 'authz-scopes' | translate}}</label>
  63. <div class="col-md-6">
  64. <input type="hidden" ui-select2="scopesUiSelect" id="scopes" data-ng-model="resource.scopes" data-placeholder="{{:: 'authz-select-scope' | translate}}..." multiple/>
  65. </div>
  66. <kc-tooltip>{{:: 'authz-resource-scopes.tooltip' | translate}}</kc-tooltip>
  67. </div>
  68. <div class="form-group">
  69. <label class="col-md-2 control-label" for="iconUri">{{:: 'authz-icon-uri' | translate}} </label>
  70. <div class="col-sm-6">
  71. <input class="form-control" type="text" id="iconUri" name="name" data-ng-model="resource.icon_uri" autofocus>
  72. </div>
  73. <kc-tooltip>{{:: 'authz-icon-uri.tooltip' | translate}}</kc-tooltip>
  74. </div>
  75. <div class="form-group">
  76. <label class="col-md-2 control-label" for="resource.ownerManagedAccess">{{:: 'authz-resource-user-managed-access-enabled' | translate}}</label>
  77. <div class="col-md-6">
  78. <input ng-model="resource.ownerManagedAccess" id="resource.ownerManagedAccess" onoffswitch />
  79. </div>
  80. <kc-tooltip>{{:: 'authz-resource-user-managed-access-enabled.tooltip' | translate}}</kc-tooltip>
  81. </div>
  82. <div class="form-group">
  83. <label class="col-md-2 control-label">{{:: 'authz-resource-attributes' | translate}}</label>
  84. <div class="col-md-6">
  85. <table class="table table-striped table-bordered">
  86. <thead>
  87. <tr>
  88. <th>{{:: 'key' | translate}}</th>
  89. <th>{{:: 'value' | translate}}</th>
  90. <th>{{:: 'actions' | translate}}</th>
  91. </tr>
  92. </thead>
  93. <tbody>
  94. <tr ng-repeat="(key, value) in resource.attributes | toOrderedMapSortedByKey">
  95. <td>{{key}}</td>
  96. <td><input ng-model="resource.attributes[key]" class="form-control" type="text" name="{{key}}" id="attribute-{{key}}" /></td>
  97. <td class="kc-action-cell" id="removeAttribute" data-ng-click="removeAttribute(key)">{{:: 'delete' | translate}}</td>
  98. </tr>
  99. <tr>
  100. <td><input ng-model="newAttribute.key" class="form-control" type="text" id="newAttributeKey" /></td>
  101. <td><input ng-model="newAttribute.value" class="form-control" type="text" id="newAttributeValue" /></td>
  102. <td class="kc-action-cell" id="addAttribute" data-ng-click="addAttribute()" data-ng-disabled="!newAttribute.key.length || !newAttribute.value.length">{{:: 'add' | translate}}</td>
  103. </tr>
  104. </tbody>
  105. </table>
  106. </div>
  107. <kc-tooltip>{{:: 'authz-resource-attributes.tooltip' | translate}}</kc-tooltip>
  108. </div>
  109. </fieldset>
  110. <div class="form-group" data-ng-show="access.manageAuthorization">
  111. <div class="col-md-10 col-md-offset-2">
  112. <button kc-save data-ng-disabled="!changed">{{:: 'save' | translate}}</button>
  113. <button kc-reset data-ng-disabled="!changed">{{:: 'cancel' | translate}}</button>
  114. </div>
  115. </div>
  116. </form>
  117. </div>
  118. <kc-menu></kc-menu>