You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ldap-security.component.html 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <!--
  2. ~ Licensed to the Apache Software Foundation (ASF) under one
  3. ~ or more contributor license agreements. See the NOTICE file
  4. ~ distributed with this work for additional information
  5. ~ regarding copyright ownership. The ASF licenses this file
  6. ~ to you under the Apache License, Version 2.0 (the
  7. ~ "License"); you may not use this file except in compliance
  8. ~ with the License. You may obtain a copy of the License at
  9. ~
  10. ~ http://www.apache.org/licenses/LICENSE-2.0
  11. ~ Unless required by applicable law or agreed to in writing,
  12. ~ software distributed under the License is distributed on an
  13. ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. ~ KIND, either express or implied. See the License for the
  15. ~ specific language governing permissions and limitations
  16. ~ under the License.
  17. -->
  18. <form class="mt-3 mb-3" [formGroup]="userForm" (ngSubmit)="onSubmit()" autocomplete="new-password">
  19. <p class="row col-md-10">{{'security.config.ldap.explain'|translate}}</p>
  20. <div class="form-group row col-md-10"
  21. *ngFor="let attName of ['host_name','port','base_dn','groups_base_dn','bind_dn','bind_password']">
  22. <label class="col-md-3 col-form-label"
  23. for="{{attName}}"
  24. [openDelay]="500"
  25. [ngbTooltip]="'security.config.ldap.attdesc.'+attName|translate" placement="top"
  26. >{{'security.config.ldap.attributes.' + attName |translate}}</label>
  27. <div [attr.class]="attName=='port'?'col-md-2':'col-md-7'">
  28. <input [attr.type]="attName=='bind_password'?'password':'text'" formControlName="{{attName}}"
  29. id="{{attName}}"
  30. [ngClass]="getInputClasses(attName)"
  31. autocomplete="new-password"
  32. >
  33. </div>
  34. </div>
  35. <div class="form-group row col-md-10">
  36. <label class="col-md-3 col-form-label"
  37. for="context_factory"
  38. [openDelay]="500" [ngbTooltip]="'security.config.ldap.attdesc.context_factory'|translate" placement="top"
  39. >{{'security.config.ldap.attributes.context_factory' |translate}}</label>
  40. <div class="col-md-7">
  41. <input type="text" formControlName="context_factory" id="context_factory"
  42. [ngClass]="getInputClasses('context_factory')" [ngbTypeahead]="searchContextFactory"
  43. [placement]="'top'"
  44. >
  45. </div>
  46. </div>
  47. <div class="form-group row col-md-10">
  48. <label class="col-md-3 col-form-label"
  49. for="authentication_method"
  50. [openDelay]="500" [ngbTooltip]="'security.config.ldap.attdesc.authentication_method'|translate" placement="top"
  51. >{{'security.config.ldap.attributes.authentication_method' |translate}}</label>
  52. <div class="col-md-2">
  53. <select formControlName="authentication_method" id="authentication_method" class="form-control">
  54. <option *ngFor="let method of authenticationMethods">{{method}}</option>
  55. </select>
  56. </div>
  57. </div>
  58. <div class="form-group row col-md-10">
  59. <div class="col-md-3">{{'security.config.ldap.flags'|translate}}</div>
  60. <div class="col-md-7">
  61. <div class="form-check pt-1 pb-1"
  62. *ngFor="let flagName of ['writable','ssl_enabled','bind_authenticator_enabled','use_role_name_as_group']">
  63. <input class="form-check-input" type="checkbox" formControlName="{{flagName}}"
  64. id="{{flagName}}">
  65. <label class="form-check-label " for="{{flagName}}"
  66. [openDelay]="500" [ngbTooltip]="'security.config.ldap.attdesc.'+flagName|translate" placement="top"
  67. >
  68. {{'security.config.ldap.attributes.' + flagName|translate}}
  69. </label>
  70. </div>
  71. </div>
  72. </div>
  73. <div class="form-group row col-md-10" >
  74. <div class="col-md-3"
  75. [openDelay]="500" [ngbTooltip]="'security.config.ldap.attdesc.properties'|translate" placement="top"
  76. >{{'security.config.ldap.attributes.properties'|translate}}</div>
  77. <div class="col-md-7 form-row">
  78. <input type="text" id="prop_key" formControlName="prop_key" class="form-control col" placeholder="{{'form.button.key'|translate}}"
  79. >
  80. <input type="prop_value" id="prop_value" formControlName="prop_value"
  81. class="form-control col" placeholder="{{'form.button.value'|translate}}">
  82. <button type="button" class="ml-2 btn btn-primary col" (click)="addProperty()">{{'form.button.add'|translate}}</button>
  83. </div>
  84. </div>
  85. <div class="form-group row col-md-10" *ngIf="ldapProperties && ldapProperties.size>0">
  86. <div class="col-md-3"></div>
  87. <div class="col-md-7 pl-2 list-group">
  88. <div class="list-group-item" *ngFor="let propEntry of ldapProperties |keyvalue">
  89. <span class="float-left">{{propEntry.key}}={{propEntry.value}}</span>
  90. <a class="float-right" [routerLink]="" (click)="removeProperty(propEntry.key)" ><i class="fas fa-trash-alt"></i></a>
  91. </div>
  92. </div>
  93. </div>
  94. <div class="row col-md-10 mt-5">
  95. <button class="btn btn-primary col-md-3" type="submit"
  96. [disabled]="checkProgress|| userForm.invalid || !userForm.dirty">{{'form.button.save'|translate}}</button>
  97. <button class="btn btn-primary col-md-3 offset-1" type="button" (click)="checkLdapConnection()"
  98. [disabled]="checkProgress||userForm.invalid">
  99. <span *ngIf="checkProgress" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
  100. <span *ngIf="checkProgress">&nbsp;{{'form.button.checking'|translate}}</span>
  101. <span *ngIf="!checkProgress">{{'form.button.check'|translate}}</span></button>
  102. </div>
  103. <div class="row col-md-10 mt-2">
  104. <div class="alert col-md-6 ml-1 alert-success" role="alert"
  105. *ngIf="submitError">{{'security.config.ldap.submit_error'|translate:{error:submitError.toString()} }}</div>
  106. <div class="alert col-md-6 ml-1 alert-success" role="alert"
  107. *ngIf="checkResult=='success'">{{'security.config.ldap.check_success'|translate}}</div>
  108. <div class="alert col-md-6 ml-1 alert-warning" role="alert"
  109. *ngIf="checkResult=='error'">{{'security.config.ldap.check_failed'|translate}}</div>
  110. </div>
  111. </form>