mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-05 23:53:21 +00:00
save on destroy
This commit is contained in:
@@ -1,210 +1,204 @@
|
||||
<form (ngSubmit)="submit()">
|
||||
<div class="row">
|
||||
<div class="col-sm">
|
||||
<div class="card">
|
||||
<h5 class="card-header">{{'directory' | i18n}}</h5>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm">
|
||||
<div class="card">
|
||||
<h5 class="card-header">{{'directory' | i18n}}</h5>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="directory">{{'type' | i18n}}</label>
|
||||
<select class="form-control" id="directory" name="Directory" [(ngModel)]="directory">
|
||||
<option *ngFor="let o of directoryOptions" [ngValue]="o.value">{{o.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div [hidden]="directory != directoryType.Ldap">
|
||||
<div class="form-group">
|
||||
<label for="directory">{{'type' | i18n}}</label>
|
||||
<select class="form-control" id="directory" name="Directory" [(ngModel)]="directory">
|
||||
<option *ngFor="let o of directoryOptions" [ngValue]="o.value">{{o.name}}</option>
|
||||
</select>
|
||||
<label for="hostname">{{'serverHostname' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="hostname" name="Hostname" placeholder="{{'ex' | i18n}} ad.company.com" [(ngModel)]="ldap.hostname">
|
||||
</div>
|
||||
<div [hidden]="directory != directoryType.Ldap">
|
||||
<div class="form-group">
|
||||
<label for="hostname">{{'serverHostname' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="hostname" name="Hostname" placeholder="{{'ex' | i18n}} ad.company.com" [(ngModel)]="ldap.hostname">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="port">{{'port' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="port" name="Port" placeholder="{{'ex' | i18n}} 389" [(ngModel)]="ldap.port">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="rootPath">{{'rootPath' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="rootPath" name="RootPath" [(ngModel)]="ldap.rootPath" placeholder="{{'ex' | i18n}} DC=ad,DC=company,DC=com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="ssl" [(ngModel)]="ldap.ssl" name="SSL">
|
||||
<label class="form-check-label" for="ssl">{{'ldapSsl' | i18n}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="ad" [(ngModel)]="ldap.ad" name="AD">
|
||||
<label class="form-check-label" for="ad">{{'ldapAd' | i18n}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="currentUser" [(ngModel)]="ldap.currentUser" name="CurrentUser">
|
||||
<label class="form-check-label" for="currentUser">{{'currentUser' | i18n}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div [hidden]="ldap.currentUser">
|
||||
<div class="form-group">
|
||||
<label for="username">{{'username' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="username" name="Username" [(ngModel)]="ldap.username" placeholder="{{'ex' | i18n}} admin@company.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password">{{'password' | i18n}}</label>
|
||||
<input type="password" class="form-control" id="password" name="Password" [(ngModel)]="ldap.password">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="port">{{'port' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="port" name="Port" placeholder="{{'ex' | i18n}} 389" [(ngModel)]="ldap.port">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="rootPath">{{'rootPath' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="rootPath" name="RootPath" [(ngModel)]="ldap.rootPath" placeholder="{{'ex' | i18n}} DC=ad,DC=company,DC=com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="ssl" [(ngModel)]="ldap.ssl" name="SSL">
|
||||
<label class="form-check-label" for="ssl">{{'ldapSsl' | i18n}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div [hidden]="directory != directoryType.AzureActiveDirectory">
|
||||
<div class="form-group">
|
||||
<label for="tenant">{{'tenant' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="tenant" name="Tenant" [(ngModel)]="azure.tenant" placeholder="{{'ex' | i18n}} companyad.onmicrosoft.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="applicationId">{{'applicationId' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="applicationId" name="ApplicationId" [(ngModel)]="azure.applicationId">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="secretKey">{{'secretKey' | i18n}}</label>
|
||||
<input type="password" class="form-control" id="secretKey" name="SecretKey" [(ngModel)]="azure.key">
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="ad" [(ngModel)]="ldap.ad" name="AD">
|
||||
<label class="form-check-label" for="ad">{{'ldapAd' | i18n}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div [hidden]="directory != directoryType.GSuite">
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="currentUser" [(ngModel)]="ldap.currentUser" name="CurrentUser">
|
||||
<label class="form-check-label" for="currentUser">{{'currentUser' | i18n}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div [hidden]="ldap.currentUser">
|
||||
<div class="form-group">
|
||||
<label for="domain">{{'domain' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="domain" name="Domain" [(ngModel)]="gsuite.domain" placeholder="{{'ex' | i18n}} company.com">
|
||||
<label for="username">{{'username' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="username" name="Username" [(ngModel)]="ldap.username" placeholder="{{'ex' | i18n}} admin@company.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="adminUser">{{'adminUser' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="adminUser" name="AdminUser" [(ngModel)]="gsuite.adminUser" placeholder="{{'ex' | i18n}} admin@company.com">
|
||||
<label for="password">{{'password' | i18n}}</label>
|
||||
<input type="password" class="form-control" id="password" name="Password" [(ngModel)]="ldap.password">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="customerId">{{'customerId' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="customerId" name="CustomerId" [(ngModel)]="gsuite.customer" placeholder="{{'ex' | i18n}} 39204722352">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="clientEmail">{{'clientEmail' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="clientEmail" name="ClientEmail" [(ngModel)]="gsuite.clientEmail">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="privateKey">{{'privateKey' | i18n}}</label>
|
||||
<textarea class="form-control text-monospace" id="privateKey" name="PrivateKey" [(ngModel)]="gsuite.privateKey">
|
||||
</div>
|
||||
</div>
|
||||
<div [hidden]="directory != directoryType.AzureActiveDirectory">
|
||||
<div class="form-group">
|
||||
<label for="tenant">{{'tenant' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="tenant" name="Tenant" [(ngModel)]="azure.tenant" placeholder="{{'ex' | i18n}} companyad.onmicrosoft.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="applicationId">{{'applicationId' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="applicationId" name="ApplicationId" [(ngModel)]="azure.applicationId">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="secretKey">{{'secretKey' | i18n}}</label>
|
||||
<input type="password" class="form-control" id="secretKey" name="SecretKey" [(ngModel)]="azure.key">
|
||||
</div>
|
||||
</div>
|
||||
<div [hidden]="directory != directoryType.GSuite">
|
||||
<div class="form-group">
|
||||
<label for="domain">{{'domain' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="domain" name="Domain" [(ngModel)]="gsuite.domain" placeholder="{{'ex' | i18n}} company.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="adminUser">{{'adminUser' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="adminUser" name="AdminUser" [(ngModel)]="gsuite.adminUser" placeholder="{{'ex' | i18n}} admin@company.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="customerId">{{'customerId' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="customerId" name="CustomerId" [(ngModel)]="gsuite.customer" placeholder="{{'ex' | i18n}} 39204722352">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="clientEmail">{{'clientEmail' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="clientEmail" name="ClientEmail" [(ngModel)]="gsuite.clientEmail">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="privateKey">{{'privateKey' | i18n}}</label>
|
||||
<textarea class="form-control text-monospace" id="privateKey" name="PrivateKey" [(ngModel)]="gsuite.privateKey">
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="card">
|
||||
<h5 class="card-header">{{'sync' | i18n}}</h5>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="interval">{{'interval' | i18n}}</label>
|
||||
<input type="number" min="5" class="form-control" id="interval" name="Interval" [(ngModel)]="sync.interval" placeholder="{{'ex' | i18n}} 5">
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="card">
|
||||
<h5 class="card-header">{{'sync' | i18n}}</h5>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="interval">{{'interval' | i18n}}</label>
|
||||
<input type="number" min="5" class="form-control" id="interval" name="Interval" [(ngModel)]="sync.interval" placeholder="{{'ex' | i18n}} 5">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="removeDisabled" [(ngModel)]="sync.removeDisabled" name="RemoveDisabled">
|
||||
<label class="form-check-label" for="removeDisabled">{{'removeDisabled' | i18n}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div [hidden]="directory != directoryType.Ldap">
|
||||
<div class="form-group">
|
||||
<label for="memberAttribute">{{'memberAttribute' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="memberAttribute" name="MemberAttribute" [(ngModel)]="sync.memberAttribute" placeholder="{{'ex' | i18n}} member">
|
||||
</div>
|
||||
<div [hidden]="ldap.ad">
|
||||
<div class="form-group">
|
||||
<label for="creationDateAttribute">{{'creationDateAttribute' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="creationDateAttribute" name="CreationDateAttribute" [(ngModel)]="sync.creationDateAttribute"
|
||||
placeholder="{{'ex' | i18n}} whenCreated">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="revisionDateAttribute">{{'revisionDateAttribute' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="revisionDateAttribute" name="RevisionDateAttribute" [(ngModel)]="sync.revisionDateAttribute"
|
||||
placeholder="{{'ex' | i18n}} whenChanged">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="removeDisabled" [(ngModel)]="sync.removeDisabled" name="RemoveDisabled">
|
||||
<label class="form-check-label" for="removeDisabled">{{'removeDisabled' | i18n}}</label>
|
||||
<input class="form-check-input" type="checkbox" id="useEmailPrefixSuffix" [(ngModel)]="sync.useEmailPrefixSuffix" name="UseEmailPrefixSuffix">
|
||||
<label class="form-check-label" for="useEmailPrefixSuffix">{{'useEmailPrefixSuffix' | i18n}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div [hidden]="!sync.useEmailPrefixSuffix">
|
||||
<div class="form-group" [hidden]="ldap.ad">
|
||||
<label for="emailPrefixAttribute">{{'emailPrefixAttribute' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="emailPrefixAttribute" name="EmailPrefixAttribute" [(ngModel)]="sync.emailPrefixAttribute"
|
||||
placeholder="{{'ex' | i18n}} sAMAccountName">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="emailSuffix">{{'emailSuffix' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="emailSuffix" name="EmailSuffix" [(ngModel)]="sync.emailSuffix" placeholder="{{'ex' | i18n}} @company.com">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="syncUsers" [(ngModel)]="sync.users" name="SyncUsers">
|
||||
<label class="form-check-label" for="syncUsers">{{'syncUsers' | i18n}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div [hidden]="!sync.users">
|
||||
<div class="form-group">
|
||||
<label for="userFilter">{{'userFilter' | i18n}}</label>
|
||||
<textarea class="form-control" id="userFilter" name="UserFilter" [(ngModel)]="sync.userFilter" placeholder="{{'ex' | i18n}} (&(objectClass=user))"></textarea>
|
||||
</div>
|
||||
<div [hidden]="directory != directoryType.Ldap">
|
||||
<div class="form-group">
|
||||
<label for="memberAttribute">{{'memberAttribute' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="memberAttribute" name="MemberAttribute" [(ngModel)]="sync.memberAttribute" placeholder="{{'ex' | i18n}} member">
|
||||
<label for="userObjectClass">{{'userObjectClass' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="userObjectClass" name="UserObjectClass" [(ngModel)]="sync.userObjectClass" placeholder="{{'ex' | i18n}} user">
|
||||
</div>
|
||||
<div [hidden]="ldap.ad">
|
||||
<div class="form-group">
|
||||
<label for="creationDateAttribute">{{'creationDateAttribute' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="creationDateAttribute" name="CreationDateAttribute" [(ngModel)]="sync.creationDateAttribute"
|
||||
placeholder="{{'ex' | i18n}} whenCreated">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="revisionDateAttribute">{{'revisionDateAttribute' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="revisionDateAttribute" name="RevisionDateAttribute" [(ngModel)]="sync.revisionDateAttribute"
|
||||
placeholder="{{'ex' | i18n}} whenChanged">
|
||||
</div>
|
||||
<div class="form-group" [hidden]="ldap.ad">
|
||||
<label for="userPath">{{'userPath' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="userPath" name="UserPath" [(ngModel)]="sync.userPath" placeholder="{{'ex' | i18n}} CN=Users">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="useEmailPrefixSuffix" [(ngModel)]="sync.useEmailPrefixSuffix" name="UseEmailPrefixSuffix">
|
||||
<label class="form-check-label" for="useEmailPrefixSuffix">{{'useEmailPrefixSuffix' | i18n}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div [hidden]="!sync.useEmailPrefixSuffix">
|
||||
<div class="form-group" [hidden]="ldap.ad">
|
||||
<label for="emailPrefixAttribute">{{'emailPrefixAttribute' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="emailPrefixAttribute" name="EmailPrefixAttribute" [(ngModel)]="sync.emailPrefixAttribute"
|
||||
placeholder="{{'ex' | i18n}} sAMAccountName">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="emailSuffix">{{'emailSuffix' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="emailSuffix" name="EmailSuffix" [(ngModel)]="sync.emailSuffix" placeholder="{{'ex' | i18n}} @company.com">
|
||||
</div>
|
||||
<label for="userEmailAttribute">{{'userEmailAttribute' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="userEmailAttribute" name="UserEmailAttribute" [(ngModel)]="sync.userEmailAttribute"
|
||||
placeholder="{{'ex' | i18n}} mail">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="syncGroups" [(ngModel)]="sync.groups" name="SyncGroups">
|
||||
<label class="form-check-label" for="syncGroups">{{'syncGroups' | i18n}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div [hidden]="!sync.groups">
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="syncUsers" [(ngModel)]="sync.users" name="SyncUsers">
|
||||
<label class="form-check-label" for="syncUsers">{{'syncUsers' | i18n}}</label>
|
||||
</div>
|
||||
<label for="groupFilter">{{'groupFilter' | i18n}}</label>
|
||||
<textarea class="form-control" id="groupFilter" name="GroupFilter" [(ngModel)]="sync.groupFilter" placeholder="{{'ex' | i18n}} (&(objectClass=group))"></textarea>
|
||||
</div>
|
||||
<div [hidden]="!sync.users">
|
||||
<div [hidden]="directory != directoryType.Ldap">
|
||||
<div class="form-group">
|
||||
<label for="userFilter">{{'userFilter' | i18n}}</label>
|
||||
<textarea class="form-control" id="userFilter" name="UserFilter" [(ngModel)]="sync.userFilter" placeholder="{{'ex' | i18n}} (&(objectClass=user))"></textarea>
|
||||
<label for="groupObjectClass">{{'groupObjectClass' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="groupObjectClass" name="GroupObjectClass" [(ngModel)]="sync.groupObjectClass"
|
||||
placeholder="{{'ex' | i18n}} group">
|
||||
</div>
|
||||
<div [hidden]="directory != directoryType.Ldap">
|
||||
<div class="form-group">
|
||||
<label for="userObjectClass">{{'userObjectClass' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="userObjectClass" name="UserObjectClass" [(ngModel)]="sync.userObjectClass" placeholder="{{'ex' | i18n}} user">
|
||||
</div>
|
||||
<div class="form-group" [hidden]="ldap.ad">
|
||||
<label for="userPath">{{'userPath' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="userPath" name="UserPath" [(ngModel)]="sync.userPath" placeholder="{{'ex' | i18n}} CN=Users">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="userEmailAttribute">{{'userEmailAttribute' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="userEmailAttribute" name="UserEmailAttribute" [(ngModel)]="sync.userEmailAttribute"
|
||||
placeholder="{{'ex' | i18n}} mail">
|
||||
</div>
|
||||
<div class="form-group" [hidden]="ldap.ad">
|
||||
<label for="groupPath">{{'groupPath' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="groupPath" name="GroupPath" [(ngModel)]="sync.groupPath" placeholder="{{'ex' | i18n}} CN=Groups">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="syncGroups" [(ngModel)]="sync.groups" name="SyncGroups">
|
||||
<label class="form-check-label" for="syncGroups">{{'syncGroups' | i18n}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div [hidden]="!sync.groups">
|
||||
<div class="form-group">
|
||||
<label for="groupFilter">{{'groupFilter' | i18n}}</label>
|
||||
<textarea class="form-control" id="groupFilter" name="GroupFilter" [(ngModel)]="sync.groupFilter" placeholder="{{'ex' | i18n}} (&(objectClass=group))"></textarea>
|
||||
</div>
|
||||
<div [hidden]="directory != directoryType.Ldap">
|
||||
<div class="form-group">
|
||||
<label for="groupObjectClass">{{'groupObjectClass' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="groupObjectClass" name="GroupObjectClass" [(ngModel)]="sync.groupObjectClass"
|
||||
placeholder="{{'ex' | i18n}} group">
|
||||
</div>
|
||||
<div class="form-group" [hidden]="ldap.ad">
|
||||
<label for="groupPath">{{'groupPath' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="groupPath" name="GroupPath" [(ngModel)]="sync.groupPath" placeholder="{{'ex' | i18n}} CN=Groups">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="groupNameAttribute">{{'groupNameAttribute' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="groupNameAttribute" name="GroupNameAttribute" [(ngModel)]="sync.groupNameAttribute"
|
||||
placeholder="{{'ex' | i18n}} name">
|
||||
</div>
|
||||
<label for="groupNameAttribute">{{'groupNameAttribute' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="groupNameAttribute" name="GroupNameAttribute" [(ngModel)]="sync.groupNameAttribute"
|
||||
placeholder="{{'ex' | i18n}} name">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button appBlurClick type="submit" class="btn btn-primary">
|
||||
<i class="fa fa-save fa-fw"></i>
|
||||
{{'save' | i18n}}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import {
|
||||
Component,
|
||||
ComponentFactoryResolver,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
ViewChild,
|
||||
ViewContainerRef,
|
||||
} from '@angular/core';
|
||||
|
||||
import { ToasterService } from 'angular2-toaster';
|
||||
import { Angulartics2 } from 'angulartics2';
|
||||
|
||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||
|
||||
import { ConfigurationService } from '../../services/configuration.service';
|
||||
@@ -24,7 +19,7 @@ import { SyncConfiguration } from '../../models/syncConfiguration';
|
||||
selector: 'app-settings',
|
||||
templateUrl: 'settings.component.html',
|
||||
})
|
||||
export class SettingsComponent implements OnInit {
|
||||
export class SettingsComponent implements OnInit, OnDestroy {
|
||||
directory: DirectoryType;
|
||||
directoryType = DirectoryType;
|
||||
ldap = new LdapConfiguration();
|
||||
@@ -33,9 +28,7 @@ export class SettingsComponent implements OnInit {
|
||||
sync = new SyncConfiguration();
|
||||
directoryOptions: any[];
|
||||
|
||||
constructor(analytics: Angulartics2, toasterService: ToasterService,
|
||||
i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,
|
||||
private configurationService: ConfigurationService) {
|
||||
constructor(private i18nService: I18nService, private configurationService: ConfigurationService) {
|
||||
this.directoryOptions = [
|
||||
{ name: i18nService.t('select'), value: null },
|
||||
{ name: 'Active Directory / LDAP', value: DirectoryType.Ldap },
|
||||
@@ -55,6 +48,10 @@ export class SettingsComponent implements OnInit {
|
||||
this.sync = (await this.configurationService.getSync()) || this.sync;
|
||||
}
|
||||
|
||||
async ngOnDestroy() {
|
||||
await this.submit();
|
||||
}
|
||||
|
||||
async submit() {
|
||||
if (this.ldap.ad) {
|
||||
this.sync.creationDateAttribute = 'whenCreated';
|
||||
|
||||
Reference in New Issue
Block a user