Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: LDAP leader字段名选项修改,增加唯一性检查 #1960

Merged
merged 9 commits into from
Oct 11, 2024
2 changes: 1 addition & 1 deletion src/pages/src/language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"用户过滤器": "User filter",
"过滤器中无需指定对象类,如(objectclass=xxx)": "No object class needs to be specified in the filter, such as (objectclass=xxx)",
"部门对象类": "Department Object Class",
"LDAP服务地址": "LDAP service address",
"LDAP 服务地址": "LDAP service address",
"Bind DN 密码": "Bind DN password",
"根目录 (Base DN)": "Root directory (Base DN)",
"服务地址": "Service address",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/src/language/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"用户过滤器": "用户过滤器",
"过滤器中无需指定对象类,如(objectclass=xxx)": "过滤器中无需指定对象类,如(objectclass=xxx)",
"部门对象类": "部门对象类",
"LDAP服务地址": "LDAP服务地址",
"LDAP 服务地址": "LDAP 服务地址",
"Bind DN 密码": "Bind DN 密码",
"根目录 (Base DN)": "根目录 (Base DN)",
"服务地址": "服务地址",
Expand Down
20 changes: 9 additions & 11 deletions src/pages/src/views/setting/data-source/LdapConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
:model="ldapConfigData"
:rules="rulesLdapConfig">
<Row :title="$t('服务配置')">
<bk-form-item class="w-[560px]" :label="$t('LDAP服务地址')" required property="server_config.server_url">
<bk-form-item class="w-[560px]" :label="$t('LDAP 服务地址')" required property="server_config.server_url">
<bk-input
placeholder="ldap://127.0.0.1:3390"
v-model="ldapConfigData.server_config.server_url"
Expand All @@ -23,6 +23,8 @@
</bk-form-item>
<bk-form-item class="w-[560px]" :label="$t('Bind DN 密码')" required property="server_config.bind_password">
<bk-input
type="password"
autocomplete="new-password"
placeholder="*********"
v-model="ldapConfigData.server_config.bind_password"
@focus="handleFocus"
Expand Down Expand Up @@ -190,12 +192,13 @@
placeholder="manager"
v-model="fieldSettingData.leader_config.leader_field"
:clearable="false"
@change="handleChange">
@change="(val, oldVal) => changeApiFields(val, oldVal)">
<bk-option
v-for="item in leaderOptions"
:key="item.value"
:value="item.value"
:label="item.label"
v-for="item in apiFields"
:key="item.key"
:value="item.key"
:label="item.key"
:disabled="item.disabled"
/>
</bk-select>
</bk-form-item>
Expand Down Expand Up @@ -312,7 +315,6 @@ watch(() => props.isReset, () => {
}
});

const leaderOptions = ref([]);
const userGroupClassOptions = [
{
value: 'groupOfNames',
Expand Down Expand Up @@ -422,10 +424,6 @@ const handleTestConnection = async () => {
connectionText.value = t('测试成功');
nextDisabled.value = false;
userProperties.value = Object.keys(res.data?.user?.properties);
leaderOptions.value = res.data?.user?.properties?.manager?.split(',').map((item: string) => ({
value: item,
label: item,
}));
} else {
connectionStatus.value = false;
connectionText.value = res.data.error_message;
Expand Down