config-auth.component.html 9.24 KB
Newer Older
Steven Zou's avatar
Steven Zou committed
1 2 3 4 5
<form #authConfigFrom="ngForm" class="form">
    <section class="form-block">
        <div class="form-group">
            <label for="authMode">{{'CONFIG.AUTH_MODE' | translate }}</label>
            <div class="select">
kunw's avatar
kunw committed
6 7 8 9
                <select id="authMode" name="authMode" [disabled]="disabled(currentConfig.auth_mode)
" [(ngModel)]="currentConfig.auth_mode.value">
                    <option value="db_auth">{{'CONFIG.AUTH_MODE_DB' | translate }}</option>
                    <option value="ldap">{{'CONFIG.AUTH_MODE_LDAP' | translate }}</option>
Steven Zou's avatar
Steven Zou committed
10 11
                </select>
            </div>
kunw's avatar
kunw committed
12 13 14 15
            <a href="javascript:void(0)" role="tooltip" aria-haspopup="true" class="tooltip tooltip-top-right">
                <clr-icon shape="info-circle" class="is-info" size="24"></clr-icon>
                <span class="tooltip-content">{{'CONFIG.TOOLTIP.AUTH_MODE' | translate}}</span>
            </a>
Steven Zou's avatar
Steven Zou committed
16 17 18 19
        </div>
    </section>
    <section class="form-block" *ngIf="showLdap">
        <div class="form-group">
kunw's avatar
kunw committed
20
            <label for="ldapUrl" class="required">{{'CONFIG.LDAP.URL' | translate}}</label>
Steven Zou's avatar
Steven Zou committed
21 22 23 24 25 26 27 28 29 30 31 32
            <label for="ldapUrl" aria-haspopup="true" role="tooltip" class="tooltip tooltip-validation tooltip-md tooltip-top-right" [class.invalid]="ldapUrlInput.invalid && (ldapUrlInput.dirty || ldapUrlInput.touched)">
                      <input name="ldapUrl" type="text" #ldapUrlInput="ngModel" [(ngModel)]="currentConfig.ldap_url.value" 
                      required 
                      id="ldapUrl" 
                      size="40" 
                      [disabled]="disabled(currentConfig.ldap_url)">
                      <span class="tooltip-content">
                          {{'TOOLTIP.ITEM_REQUIRED' | translate}}
                      </span>
                    </label>
        </div>
        <div class="form-group">
kunw's avatar
kunw committed
33
            <label for="ldapSearchDN" class="required">{{'CONFIG.LDAP.SEARCH_DN' | translate}}</label>
Steven Zou's avatar
Steven Zou committed
34 35 36 37 38 39 40 41 42
            <label for="ldapSearchDN" aria-haspopup="true" role="tooltip" class="tooltip tooltip-validation tooltip-md tooltip-top-right" [class.invalid]="ldapSearchDNInput.invalid && (ldapSearchDNInput.dirty || ldapSearchDNInput.touched)">
                      <input name="ldapSearchDN" type="text" #ldapSearchDNInput="ngModel" [(ngModel)]="currentConfig.ldap_search_dn.value" 
                      required 
                      id="ldapSearchDN" 
                      size="40" [disabled]="disabled(currentConfig.ldap_search_dn)">
                      <span class="tooltip-content">
                          {{'TOOLTIP.ITEM_REQUIRED' | translate}}
                      </span>
                    </label>
kunw's avatar
kunw committed
43 44 45 46
            <a href="javascript:void(0)" role="tooltip" aria-haspopup="true" class="tooltip tooltip-top-right">
                <clr-icon shape="info-circle" class="is-info" size="24"></clr-icon>
                <span class="tooltip-content">{{'CONFIG.TOOLTIP.LDAP_SEARCH_DN' | translate}}</span>
            </a>
Steven Zou's avatar
Steven Zou committed
47 48
        </div>
        <div class="form-group">
kunw's avatar
kunw committed
49
            <label for="ldapSearchPwd" class="required">{{'CONFIG.LDAP.SEARCH_PWD' | translate}}</label>
Steven Zou's avatar
Steven Zou committed
50 51 52 53 54 55 56 57 58 59 60
            <label for="ldapSearchPwd" aria-haspopup="true" role="tooltip" class="tooltip tooltip-validation tooltip-md tooltip-top-right" [class.invalid]="ldapSearchPwdInput.invalid && (ldapSearchPwdInput.dirty || ldapSearchPwdInput.touched)">
                      <input name="ldapSearchPwd" type="password" #ldapSearchPwdInput="ngModel" [(ngModel)]="currentConfig.ldap_search_password.value" 
                      required 
                      id="ldapSearchPwd" 
                      size="40" [disabled]="disabled(currentConfig.ldap_search_password)">
                      <span class="tooltip-content">
                          {{'TOOLTIP.ITEM_REQUIRED' | translate}}
                      </span>
                    </label>
        </div>
        <div class="form-group">
kunw's avatar
kunw committed
61
            <label for="ldapBaseDN" class="required">{{'CONFIG.LDAP.BASE_DN' | translate}}</label>
Steven Zou's avatar
Steven Zou committed
62 63 64 65 66 67 68 69 70
            <label for="ldapBaseDN" aria-haspopup="true" role="tooltip" class="tooltip tooltip-validation tooltip-md tooltip-top-right" [class.invalid]="ldapBaseDNInput.invalid && (ldapBaseDNInput.dirty || ldapBaseDNInput.touched)">
                      <input name="ldapBaseDN" type="text" #ldapBaseDNInput="ngModel" [(ngModel)]="currentConfig.ldap_base_dn.value" 
                      required 
                      id="ldapBaseDN" 
                      size="40" [disabled]="disabled(currentConfig.ldap_base_dn)">
                      <span class="tooltip-content">
                          {{'TOOLTIP.ITEM_REQUIRED' | translate}}
                      </span>
                    </label>
kunw's avatar
kunw committed
71 72 73 74
            <a href="javascript:void(0)" role="tooltip" aria-haspopup="true" class="tooltip tooltip-top-right">
                <clr-icon shape="info-circle" class="is-info" size="24"></clr-icon>
                <span class="tooltip-content">{{'CONFIG.TOOLTIP.LDAP_BASE_DN' | translate}}</span>
            </a>
Steven Zou's avatar
Steven Zou committed
75 76
        </div>
        <div class="form-group">
kunw's avatar
kunw committed
77
            <label for="ldapFilter">{{'CONFIG.LDAP.FILTER' | translate}}</label>
Steven Zou's avatar
Steven Zou committed
78 79 80 81 82 83 84 85 86 87
            <label for="ldapFilter" aria-haspopup="true" role="tooltip" class="tooltip tooltip-validation tooltip-md tooltip-top-right">
                      <input name="ldapFilter" type="text" #ldapFilterInput="ngModel" [(ngModel)]="currentConfig.ldap_filter.value" 
                      id="ldapFilter" 
                      size="40" [disabled]="disabled(currentConfig.ldap_filter)">
                      <span class="tooltip-content">
                          {{'TOOLTIP.ITEM_REQUIRED' | translate}}
                      </span>
                    </label>
        </div>
        <div class="form-group">
kunw's avatar
kunw committed
88
            <label for="ldapUid" class="required">{{'CONFIG.LDAP.UID' | translate}}</label>
Steven Zou's avatar
Steven Zou committed
89 90 91 92 93 94 95 96 97
            <label for="ldapUid" aria-haspopup="true" role="tooltip" class="tooltip tooltip-validation tooltip-md tooltip-top-right" [class.invalid]="ldapUidInput.invalid && (ldapUidInput.dirty || ldapUidInput.touched)">
                      <input name="ldapUid" type="text" #ldapUidInput="ngModel" [(ngModel)]="currentConfig.ldap_uid.value" 
                      required 
                      id="ldapUid" 
                      size="40" [disabled]="disabled(currentConfig.ldap_uid)">
                      <span class="tooltip-content">
                          {{'TOOLTIP.ITEM_REQUIRED' | translate}}
                      </span>
                    </label>
kunw's avatar
kunw committed
98 99 100 101
            <a href="javascript:void(0)" role="tooltip" aria-haspopup="true" class="tooltip tooltip-top-right">
                <clr-icon shape="info-circle" class="is-info" size="24"></clr-icon>
                <span class="tooltip-content">{{'CONFIG.TOOLTIP.LDAP_UID' | translate}}</span>
            </a>
Steven Zou's avatar
Steven Zou committed
102 103
        </div>
        <div class="form-group">
kunw's avatar
kunw committed
104
            <label for="ldapScope">{{'CONFIG.LDAP.SCOPE' | translate}}</label>
Steven Zou's avatar
Steven Zou committed
105 106
            <div class="select">
                <select id="ldapScope" name="ldapScope" [(ngModel)]="currentConfig.ldap_scope.value" [disabled]="disabled(currentConfig.ldap_scope)">
kunw's avatar
kunw committed
107 108 109
                    <option value="1">{{'CONFIG.SCOPE_BASE' | translate }}</option>
                    <option value="2">{{'CONFIG.SCOPE_ONE_LEVEL' | translate }}</option>
                    <option value="3">{{'CONFIG.SCOPE_SUBTREE' | translate }}</option>
Steven Zou's avatar
Steven Zou committed
110 111
                </select>
            </div>
kunw's avatar
kunw committed
112 113 114 115
            <a href="javascript:void(0)" role="tooltip" aria-haspopup="true" class="tooltip tooltip-top-right">
                <clr-icon shape="info-circle" class="is-info" size="24"></clr-icon>
                <span class="tooltip-content">{{'CONFIG.TOOLTIP.LDAP_SCOPE' | translate}}</span>
            </a>
Steven Zou's avatar
Steven Zou committed
116 117 118 119 120 121 122
        </div>
    </section>
    <section class="form-block">
        <div class="form-group">
            <label for="proCreation">{{'CONFIG.PRO_CREATION_RESTRICTION' | translate}}</label>
            <div class="select">
                <select id="proCreation" name="proCreation" [(ngModel)]="currentConfig.project_creation_restriction.value" [disabled]="disabled(currentConfig.project_creation_restriction)">
kunw's avatar
kunw committed
123 124
                    <option value="everyone">{{'CONFIG.PRO_CREATION_EVERYONE' | translate }}</option>
                    <option value="adminonly">{{'CONFIG.PRO_CREATION_ADMIN' | translate }}</option>
Steven Zou's avatar
Steven Zou committed
125 126
                </select>
            </div>
kunw's avatar
kunw committed
127 128 129 130
            <a href="javascript:void(0)" role="tooltip" aria-haspopup="true" class="tooltip tooltip-top-right">
                <clr-icon shape="info-circle" class="is-info" size="24"></clr-icon>
                <span class="tooltip-content">{{'CONFIG.TOOLTIP.AUTH_MODE' | translate}}</span>
            </a>
Steven Zou's avatar
Steven Zou committed
131 132 133 134 135 136
        </div>
        <div class="form-group">
            <label for="selfReg">{{'CONFIG.SELF_REGISTRATION' | translate}}</label>
            <clr-checkbox name="selfReg" id="selfReg" [(ngModel)]="currentConfig.self_registration.value" [disabled]="disabled(currentConfig.self_registration)">
                <a href="javascript:void(0)" role="tooltip" aria-haspopup="true" class="tooltip tooltip-top-right" style="top:-8px;">
                    <clr-icon shape="info-circle" class="is-info" size="24"></clr-icon>
kunw's avatar
kunw committed
137
                    <span class="tooltip-content">{{'CONFIG.TOOLTIP.SELF_REGISTRATION' | translate}}</span>
Steven Zou's avatar
Steven Zou committed
138 139 140 141 142
                </a>
            </clr-checkbox>
        </div>
    </section>
</form>