Skip to content
This repository was archived by the owner on Jan 20, 2021. It is now read-only.

Commit 4178207

Browse files
committed
Fixing ldap form
1 parent 7c0d6aa commit 4178207

2 files changed

Lines changed: 43 additions & 3 deletions

File tree

src/config/section/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default {
4242
label: 'label.configure.ldap',
4343
listView: true,
4444
args: [
45-
'hostname', 'port'
45+
'hostname', 'port', 'domainid'
4646
]
4747
},
4848
{

src/views/iam/AddLdapAccount.vue

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,14 @@
4848
<a-form
4949
:form="form"
5050
@submit="handleSubmit"
51-
layout="vertical"
52-
>
51+
layout="vertical" >
52+
<a-form-item :label="$t('label.filterby')">
53+
<a-select @change="fetchListLdapUsers" v-model="selectedFilter" >
54+
<a-select-option v-for="opt in filters" :key="opt.id" >
55+
{{ opt.name }}
56+
</a-select-option>
57+
</a-select>
58+
</a-form-item>
5359
<a-form-item :label="$t('label.domain')">
5460
<a-select
5561
showSearch
@@ -119,6 +125,7 @@
119125
<script>
120126
import { api } from '@/api'
121127
import { timeZone } from '@/utils/timezone'
128+
import store from '@/store'
122129
123130
export default {
124131
name: 'AddLdapAccount',
@@ -131,6 +138,8 @@ export default {
131138
listDomains: [],
132139
listRoles: [],
133140
timeZoneMap: [],
141+
filters: [],
142+
selectedFilter: '',
134143
listLoading: false,
135144
timeZoneLoading: false,
136145
domainLoading: false,
@@ -175,8 +184,32 @@ export default {
175184
title: this.$t('label.email'),
176185
dataIndex: 'email',
177186
scopedSlots: { customRender: 'email' }
187+
},
188+
{
189+
title: this.$t('Conflict'),
190+
dataIndex: 'conflictingusersource',
191+
scopedSlots: { customRender: 'conflictingusersource' }
192+
}
193+
]
194+
this.filters = [
195+
{
196+
id: 'NoFilter',
197+
name: 'No filter'
198+
},
199+
{
200+
id: 'LocalDomain',
201+
name: 'Local domain'
202+
},
203+
{
204+
id: 'AnyDomain',
205+
name: 'Any domain'
206+
},
207+
{
208+
id: 'PotentialImport',
209+
name: 'Potential import'
178210
}
179211
]
212+
this.selectedFilter = this.filters[0].id
180213
},
181214
mounted () {
182215
this.fetchData()
@@ -222,8 +255,11 @@ export default {
222255
},
223256
fetchListLdapUsers () {
224257
return new Promise((resolve, reject) => {
258+
this.listLoading = true
225259
const params = {}
226260
params.listtype = 'new'
261+
params.userfilter = this.selectedFilter
262+
params.domainid = store.getters.userInfo.domainid
227263
api('listLdapUsers', params).then(json => {
228264
const listLdapUsers = json.ldapuserresponse.LdapUser
229265
if (listLdapUsers) {
@@ -233,8 +269,12 @@ export default {
233269
}
234270
}
235271
resolve(listLdapUsers)
272+
this.dataSource = listLdapUsers
273+
this.oldDataSource = listLdapUsers
236274
}).catch(error => {
237275
reject(error)
276+
}).finally(() => {
277+
this.listLoading = false
238278
})
239279
})
240280
},

0 commit comments

Comments
 (0)