client-policies-policy-edit.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <!--
  2. ~ Copyright 2021 Red Hat, Inc. and/or its affiliates
  3. ~ and other contributors as indicated by the @author tags.
  4. ~
  5. ~ Licensed under the Apache License, Version 2.0 (the "License");
  6. ~ you may not use this file except in compliance with the License.
  7. ~ You may obtain a copy of the License at
  8. ~
  9. ~ http://www.apache.org/licenses/LICENSE-2.0
  10. ~
  11. ~ Unless required by applicable law or agreed to in writing, software
  12. ~ distributed under the License is distributed on an "AS IS" BASIS,
  13. ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. ~ See the License for the specific language governing permissions and
  15. ~ limitations under the License.
  16. ~
  17. -->
  18. <div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2">
  19. <ol class="breadcrumb">
  20. <li><a href="#/realms/{{realm.realm}}/client-policies/policies">{{:: 'client-policies' | translate}}</a></li>
  21. <li data-ng-show="createNew">{{:: 'create-client-policy' | translate}}</li>
  22. <li data-ng-hide="createNew">{{editedPolicy.name}}</li>
  23. </ol>
  24. <h1 data-ng-show="createNew">{{:: 'create-client-policy' | translate}}</h1>
  25. <h1 data-ng-hide="createNew">{{editedPolicy.name|capitalize}}</h1>
  26. <form class="form-horizontal" name="realmForm" novalidate>
  27. <fieldset class="border-top" kc-read-only="isReadOnly()">
  28. <div class="form-group">
  29. <label class="col-md-2 control-label" for="clientPolicyName">{{:: 'name' | translate}} <span class="required">*</span></label>
  30. <div class="col-sm-6">
  31. <input class="form-control" type="text" id="clientPolicyName" name="clientPolicyName" data-ng-model="editedPolicy.name" autofocus required>
  32. </div>
  33. <kc-tooltip>{{:: 'client-policy-name.tooltip' | translate}}</kc-tooltip>
  34. </div>
  35. <div class="form-group">
  36. <label class="col-md-2 control-label" for="description">{{:: 'description' | translate}} </label>
  37. <div class="col-md-6">
  38. <textarea class="form-control" rows="5" cols="50" id="description" name="description" data-ng-model="editedPolicy.description"></textarea>
  39. </div>
  40. </div>
  41. <div class="form-group clearfix block">
  42. <label class="col-md-2 control-label" for="enabled">{{:: 'enabled' | translate}}</label>
  43. <div class="col-sm-6">
  44. <input ng-model="editedPolicy.enabled" name="enabled" id="enabled" onoffswitch on-text="{{:: 'onText' | translate}}" off-text="{{:: 'offText' | translate}}"/>
  45. </div>
  46. <kc-tooltip>{{:: 'client-policy-enabled.tooltip' | translate}}</kc-tooltip>
  47. </div>
  48. </fieldset>
  49. <fieldset data-ng-hide="isReadOnly()">
  50. <div class="form-group">
  51. <div class="col-md-10 col-md-offset-2">
  52. <button kc-save>{{:: 'save' | translate}}</button>
  53. <button kc-cancel data-ng-click="back()">{{:: 'back' | translate}}</button>
  54. </div>
  55. </div>
  56. </fieldset>
  57. <fieldset data-ng-hide="createNew">
  58. <legend><span class="text">{{:: 'conditions' | translate}}</span> <kc-tooltip>{{:: 'client-policy-conditions.tooltip' | translate}}</kc-tooltip></legend>
  59. <table class="table table-striped table-bordered">
  60. <thead>
  61. <tr data-ng-hide="isReadOnly()">
  62. <th class="kc-table-actions" colspan="3">
  63. <div class="form-inline">
  64. <div class="pull-right">
  65. <a href="#/realms/{{realm.realm}}/client-policies/policies-update/{{editedPolicy.name}}/create-condition" class="btn btn-default">{{:: 'create' | translate}}</a>
  66. </div>
  67. </div>
  68. </th>
  69. </tr>
  70. <tr data-ng-show="editedPolicy.conditions && editedPolicy.conditions.length > 0">
  71. <th>{{:: 'type' | translate}}</th>
  72. <th colspan="2">{{:: 'actions' | translate}}</th>
  73. </tr>
  74. </thead>
  75. <tbody>
  76. <tr ng-repeat="condition in editedPolicy.conditions">
  77. <td><a href="#/realms/{{realm.realm}}/client-policies/policies-update/{{editedPolicy.name}}/update-condition/{{$index}}">{{condition.condition}}</a></td>
  78. <td class="kc-action-cell" kc-open="/realms/{{realm.realm}}/client-policies/policies-update/{{editedPolicy.name}}/update-condition/{{$index}}">{{:: 'edit' | translate}}</td>
  79. <td class="kc-action-cell" data-ng-hide="isReadOnly()" data-ng-click="removeCondition($index)">{{:: 'delete' | translate}}</td>
  80. </tr>
  81. <tr data-ng-show="!editedPolicy.conditions || editedPolicy.conditions.length == 0">
  82. <td>{{:: 'no-conditions-available' | translate}}</td>
  83. </tr>
  84. </tbody>
  85. </table>
  86. </fieldset>
  87. <fieldset data-ng-hide="createNew">
  88. <legend><span class="text">{{:: 'client-profiles' | translate}}</span></legend><kc-tooltip>{{:: 'client-profiles.tooltip' | translate}}</kc-tooltip>
  89. <table class="table table-striped table-bordered">
  90. <thead>
  91. <tr data-ng-hide="isReadOnly() || availableProfiles.length == 0">
  92. <th colspan="5" class="kc-table-actions">
  93. <div class="pull-right">
  94. <div>
  95. <select class="form-control" ng-model="selectedProfile"
  96. ng-options="p for p in availableProfiles"
  97. data-ng-change="addProfile(selectedProfile); selectedProfile = null">
  98. <option value="" disabled selected>{{:: 'add-profile.placeholder' | translate}}</option>
  99. </select>
  100. </div>
  101. </div>
  102. </th>
  103. </tr>
  104. <tr data-ng-show="editedPolicy.profiles && editedPolicy.profiles.length > 0">
  105. <th>{{:: 'name' | translate}}</th>
  106. <th data-ng-hide="isReadOnly()">{{:: 'actions' | translate}}</th>
  107. </tr>
  108. </thead>
  109. <tbody>
  110. <tr ng-repeat="profileName in editedPolicy.profiles">
  111. <td><a href="#/realms/{{realm.realm}}/client-policies/profiles-update/{{profileName}}">{{profileName}}</a></td>
  112. <td class="kc-action-cell" data-ng-hide="isReadOnly()" data-ng-click="removeProfile(profileName)">{{:: 'delete' | translate}}</td>
  113. </tr>
  114. <tr data-ng-show="!editedPolicy.profiles || editedPolicy.profiles.length == 0">
  115. <td class="text-muted">{{:: 'no-client-profiles-configured' | translate}}</td>
  116. </tr>
  117. </tbody>
  118. </table>
  119. </fieldset>
  120. </form>
  121. </div>
  122. <kc-menu></kc-menu>