opsx
6b81dbbd4a
feat(ldap): LDAP 改为只读接入,彻底移除账号验证与批量导入写入功能
...
按需求(sql.astx.club/settings):
1. 移除「测试账号验证」按钮
- LdapConfigForm.tsx 删按钮 + onOpenAccountTest prop
- 不再渲染 LdapAccountTestDialog
2. 移除批量导入的 LDAP 写操作(BatchImportModal.tsx)
- TABS 去掉「导入到 LDAP」「从 LDAP 导入」
- 删除对应两个 JSX 代码块(tab === 'to-ldap' / 'from-ldap')
- 删除「创建 OU」子弹窗
- 只保留「本地导入」(CSV 建本地账号,不触碰 LDAP 目录)
3. 移除 LDAP 账号管理面板(含危险写操作)
- 不再渲染 LdapManagePanel(新建 OU / 添加用户 / 删除用户)
- 删除 LdapCreateOuDialog / LdapAddUserDialog / ConfirmDialog 引用
- LdapConfigPage.tsx 421 → 340 行;BatchImportModal.tsx 557 → 329 行
4. 保留(只读用途)
- LDAP 配置表单(服务器 / 绑定 / 搜索 / 属性映射)
- 「测试连接」按钮(验证配置可用,不写 LDAP 目录)
设计原则:LDAP 仅用于域账号登录认证(只读 bind + search),
目录维护请到域控侧操作。
验证(前端 bundle grep,全部归零):
测试账号验证 0 | 导入到 LDAP 0 | 从 LDAP 导入 0
新建 OU 0 | 创建 OU 0 | 危险操作 0 | 此操作不可逆 0
保留:
测试连接 6 | 本地导入 1
镜像 sha256:3970db141d23
/health → {"backend":"go","status":"ok","version":"0.4.0"}
http://sql.astx.club/settings → HTTP 200
2026-10-26 17:49:34 +00:00
opsx
e8355e5d5f
feat(ldap): LDAP 改为只读接入,移除账号验证测试与批量导入写操作
...
按需求调整 settings 页 LDAP 区域:
1. 移除「测试账号验证」按钮
- LdapConfigForm.tsx 删除按钮 + onOpenAccountTest prop
- LdapConfigPage.tsx 不再渲染 LdapAccountTestDialog
2. 移除批量导入的 LDAP 写操作
- BatchImportModal.tsx 的 TABS 去掉「导入到 LDAP」「从 LDAP 导入」
- 只保留「本地导入」(CSV 建本地账号,不触碰 LDAP 目录)
3. 移除 LDAP 账号管理面板(危险写操作)
- 不再渲染 LdapManagePanel(新建 OU / 添加用户 / 删除用户)
- 不再渲染 LdapCreateOuDialog / LdapAddUserDialog
- 面板含「此操作不可逆」删除功能,与只读接入原则冲突
4. 保留(只读用途)
- LDAP 配置表单(服务器/绑定/搜索/属性映射)
- 「测试连接」按钮(验证配置是否可用,不写 LDAP)
设计原则:本系统 LDAP 仅用于域账号登录认证(只读 bind + search),
目录维护请在域控侧操作。
验证(前端 bundle 实测):
测试账号验证: 0 导入到 LDAP: 0 从 LDAP 导入: 0
新建 OU: 0 危险操作: 0 此操作不可逆: 0
测试连接: 6(保留) 本地导入: 1(保留)
/health → {"backend":"go","status":"ok","version":"0.4.0"}
http://sql.astx.club/settings → HTTP 200
2026-10-26 17:45:46 +00:00
Logan.Li
13fb3aceb3
feat(ldap): ad/openldap dual compat and config gating
...
- multi-round user filters (config filter first, then
objectClass=inetOrgPerson, then AD sAMAccountName/userPrincipalName
fallback) applied to login search, user listing and batch import;
previously pure-AD directories found no users
- attribute fallback chains (uid/sAMAccountName/userPrincipalName,
cn/displayName, telephoneNumber/mobile) via ldapEntryAttr
- import errors explain likely cause instead of empty result
- AES-encrypted admin password kept (aiops stores plaintext)
- frontend gating per aiops pattern: LDAP account management panel
hidden with hint until a config is actually saved (was gated on
unsaved form values); batch-import modal hides to/from-LDAP tabs
when unconfigured, local CSV always available
2026-10-26 20:08:46 +08:00
Logan.Li
ac498c7ba2
refactor(frontend): split 7 oversized pages into feature co-location
...
Per guide ch.7 page split pattern (skeleton orchestrates, private
components live in features/<domain>/):
- InstancePage 1716->328, UsersPage 1309->240, TicketsPage 1076->195,
TicketDetailPage 911->287, QueriesPage 883->479, LdapConfigPage 860->393,
WorkflowPage 852->194
- new feature modules: datasource/ rbac/ ticket/ query/ system/ldap/
governance/workflow/ (components + hooks + types + utils)
- stable keys replace index keys in dynamic lists; polling intervals
and toast call sites preserved 1:1 (verified by agents)
- filter/pagination state moved to URL query via new useQueryState hook
(Instance/Users/Tickets/AuditLogs pages): refresh/share/back-button
restore state; composite updates applied atomically
- permission pure functions extracted to lib/permissions.ts (used by
useAuth + useLogin); page-size audit: 0 pages over 700-line budget
2026-10-26 17:54:15 +08:00