Skip to content

feat(TAP-13018): audit log enhancement (web) - #665

Open
weiliang110100 wants to merge 6 commits into
developfrom
hardy/TAP-13018-6ae07214
Open

weiliang110100 wants to merge 6 commits into
developfrom
hardy/TAP-13018-6ae07214

Conversation

@weiliang110100

Copy link
Copy Markdown
Contributor

概要

TAP-13018 TapData 审计日志增强——前端。

  • /operation-audit 升级为「审计日志」:发生时间、事件类型、操作人、来源、来源 IP、操作、对象、结果(文字+状态)列;全部审计查询条件;异步操作聚合为一行;详情抽屉含必填字段、时间线、批量对象结果、变更详情与脱敏说明;显示时区;导出 CSV 按钮受 v2_audit_log_export 控制。
  • 结构化渲染,不出现 null、undefined 或未替换变量;历史记录缺失字段显示「不可用(历史记录)」。
  • 系统设置:审计日志保留时间 30–3650 校验,缩短时二次确认。
  • 角色权限树新增「导出审计日志」按钮权限。
  • 访问码与 API 客户端密钥改为掩码显示,复制时经审计接口取得。

依赖:tapdata 同名分支 PR(/api/audit-events、reveal 接口)。

测试总结(候选 297edb2)

范围 命令 结果
页面逻辑单测 node --test apps/daas/tests/audit-log.test.ts 7 通过
格式 / i18n / lint prettier --check、check-i18n、eslint(审计相关文件) 通过;改动文件中原有 lint 报错未变化

待验收

  • 手工验收(开发环境):审计日志页面全流程、导出与导出权限、保留期设置、真实 Engine/API Server 启停与失联——待研发提供 Docker 与外部 MongoDB 后执行。
  • Story Test Design Review Result 待评审人给出。

AgenticOps 版本 main-v1.4-50-6a2a279b

🤖 Generated with Claude Code

…tial reveal

- /operation-audit becomes the Audit Logs page: table with time, event type,
  operator, source, source IP, action, object and outcome (text + status),
  filters for all audit query conditions, logical-operation rows, detail drawer
  with required fields, timeline, batch results, change details and secret
  notes; CSV export gated by v2_audit_log_export; time zone shown.
- Structured rendering never shows null/undefined or unresolved placeholders;
  legacy records show an explicit "unavailable (legacy record)" value.
- System settings validate the audit log retention (30-3650 days) and confirm
  before shortening it.
- Role permission tree adds the export audit logs button permission.
- Access code and API client secret are masked and copied through the audit
  reveal endpoints.
- Pure page logic in views/audit/audit-log.ts with node --test coverage; three
  locale texts generated from the backend audit catalog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@weiliang110100
weiliang110100 requested a review from feynmx October 29, 2026 03:39
weiliang110100 and others added 4 commits October 29, 2026 14:30
- F-01: the role page enables the audit page node v2_audit_log_list (export
  button attached there), matching the module permission point checked by
  the audit API.
- F-03: router guard returns after redirecting to the dashboard when access
  is denied, instead of issuing a second next(false) that left a blank page.
- F-04: legacy records are rendered by the existing operation component, so
  placeholders such as {user}/{parameter1} are replaced.
- F-05: retention input is a plain number field with an explicit range hint,
  so out-of-range values are reported instead of being silently clamped.
- F-06: change field names are shown with the setting labels.
- New unit test for the change field label mapping.

Co-Authored-By: Claude Code <noreply@anthropic.com>
…F-06)

- F-05: the Options API template cannot read the module-scope RETENTION_KEY
  import, so the retention branch never matched and the control stayed an
  el-input-number that silently clamped out-of-range values. The check now
  goes through a method, so the plain number field with the 30-3650 hint is
  actually rendered and out-of-range input is reported.
- F-06: change details use the readable label provided by the backend instead
  of guessing an i18n key from the internal field name.

Co-Authored-By: Claude Code <noreply@anthropic.com>
…05 registry)

- Remove the TypeScript annotation from the plain JS <script> of Setting.vue
  (the previous commit broke the whole settings page); add
  scripts/check-vue-sfc.mjs and run it in lint-staged so SFC syntax errors are
  caught before commit.
- Change details translate the backend key_label with the settings i18n
  convention (case preserved) and fall back to the label, then the field.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
@weiliang110100
weiliang110100 marked this pull request as ready for review October 30, 2026 04:10
- F-11:详情「结果」与列表一致,取操作聚合结果,不再停留在请求阶段的「已受理」
- F-10:服务节点补充 instance,同主机多实例可区分;拼接逻辑抽到 nodeText 便于测试
- 新增 nodeText 单测

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant