diff --git a/frontend/src/features/rbac/components/BatchImportModal.tsx b/frontend/src/features/rbac/components/BatchImportModal.tsx index 20a9ba6..8228009 100644 --- a/frontend/src/features/rbac/components/BatchImportModal.tsx +++ b/frontend/src/features/rbac/components/BatchImportModal.tsx @@ -303,184 +303,6 @@ export function BatchImportModal({ onClose, onImported }: BatchImportModalProps) )} - {/* ── Import to LDAP ── */} - {tab === 'to-ldap' && ( - <> - {ldapLoading &&

加载中...

} - {!ldapLoading && !ldapReady && ( -
- LDAP 未配置,请先在「平台配置 → LDAP」中配置 LDAP 连接 -
- )} - {!ldapLoading && ldapReady && ( - <> - {/* OU selector */} -
- -
- - - -
-
- {/* File upload (same CSV format) */} -
- - - - CSV 需包含"姓名"列,系统自动生成拼音用户名和密码 - -
- {preview.length > 0 && ( -
- - - - - - - - - - {preview.slice(0, 30).map((r, i) => ( - - - - - - ))} - {preview.length > 30 && ( - - - - )} - -
姓名用户名(自动)密码(自动)
{r.display_name}{r.username}{r.password}
- ... 共 {preview.length} 条 -
-
- )} - - )} - - )} - - {/* ── From LDAP Import ── */} - {tab === 'from-ldap' && ( - <> - {ldapLoading &&

加载中...

} - {!ldapLoading && !ldapReady && ( -
- LDAP 未配置,请先在「平台配置 → LDAP」中配置 LDAP 连接 -
- )} - {!ldapLoading && ldapReady && ldapOus.length > 0 && ldapUsers.length === 0 && ( -
-

选择组织单元:

- {ldapOus.map((ou) => ( - - ))} -
- )} - {ldapUsers.length > 0 && ( -
-
-

{ldapUsers.length} 个用户

- -
- {ldapUsers.map((u) => ( - - ))} -
- )} - {!ldapLoading && ldapReady && ldapOus.length === 0 && ( -

- LDAP 目录中无可用 OU,请先创建 OU 或检查配置 -

- )} - - )} - - {/* Result */} - {result && ( -
-

成功: {result.success_count ?? (result.success ? 1 : 0)}

- {result.skipped_count > 0 &&

跳过: {result.skipped_count}

} - {result.failed_count > 0 &&

失败: {result.failed_count}

} - {result.failed_users?.map((f: any, i: number) => ( -

- {f.username}: {f.error} -

- ))} - {result.message && !result.success_count && ( -

{result.message}

- )} -
- )} {/* Footer */} @@ -500,57 +322,6 @@ export function BatchImportModal({ onClose, onImported }: BatchImportModalProps) - {/* Create OU sub-dialog */} - {showCreateOu && ( - setShowCreateOu(false)} width="max-w-md"> -
-
-

创建新的组织单位 (OU)

- -
-
-
- - setNewOuName(e.target.value)} - className="w-full px-3 py-2 bg-[var(--dg-bg-tertiary)] border border-[var(--dg-border)] rounded-lg text-sm focus:border-blue-400 focus:outline-none" - placeholder="例如:研发部、市场部" - /> -
-
- - setNewOuDesc(e.target.value)} - className="w-full px-3 py-2 bg-[var(--dg-bg-tertiary)] border border-[var(--dg-border)] rounded-lg text-sm focus:border-blue-400 focus:outline-none" - placeholder="可选描述" - /> -
-
- - -
-
-
-
- )} ); diff --git a/frontend/src/pages/LdapConfigPage.tsx b/frontend/src/pages/LdapConfigPage.tsx index e80aa52..4a92d7a 100644 --- a/frontend/src/pages/LdapConfigPage.tsx +++ b/frontend/src/pages/LdapConfigPage.tsx @@ -1,6 +1,5 @@ import { useState, useEffect, useCallback } from 'react'; import api from '@/api/request'; -import { ConfirmDialog } from '@/components/ConfirmDialog'; import { toast } from '@/hooks/useToast'; import { type LdapConfigData, @@ -13,10 +12,6 @@ import { defaultLdapConfig, } from '@/features/system/ldap/types'; import { LdapConfigForm } from '@/features/system/ldap/components/LdapConfigForm'; -import { LdapManagePanel } from '@/features/system/ldap/components/LdapManagePanel'; -import { LdapCreateOuDialog } from '@/features/system/ldap/components/LdapCreateOuDialog'; -import { LdapAddUserDialog } from '@/features/system/ldap/components/LdapAddUserDialog'; -import { LdapAccountTestDialog } from '@/features/system/ldap/components/LdapAccountTestDialog'; /** * LDAP 配置页(SettingsPage 的 ldap tab) @@ -339,83 +334,6 @@ export default function LdapConfigPage() { onSave={handleSave} /> - {/* ── LDAP 账号管理已移除 ── - 本系统 LDAP 仅作「只读接入」:仅用于域账号登录认证, - 不再提供新建 OU / 添加用户 / 删除用户 / 批量导入到 LDAP 等写操作。 - 如需维护 LDAP 目录,请在域控侧操作。 */} - {false && ( - setShowCreateOu(true)} - onAddUser={openAddUser} - ouUsers={ouUsers} - loadingUsers={loadingUsers} - selectedDns={selectedDns} - onSelectedDnsChange={setSelectedDns} - deleting={deleting} - onDeleteSelected={handleDeleteSelected} - /> - )} - - {/* ── 创建 OU 弹框 ── */} - {false && ( - setShowCreateOu(false)} - onConfirm={handleCreateOu} - /> - )} - - {/* ── 添加用户弹框 ── */} - {false && ( - setShowAddUser(false)} - onConfirm={handleAddUser} - /> - )} - - {/* ── 账号测试弹框 ── */} - {false && ( - - )} - - {/* ── 删除确认弹框 ── */} - { - confirmDelete(); - }} - onCancel={() => setShowDeleteConfirm(false)} - /> ); }