Repository navigation
feat(TAP-13326): rework audit log query bar and drop time zone labels - #680
Draft
weiliang110100 wants to merge 2 commits into
Draft
weiliang110100 wants to merge 2 commits into
weiliang110100 wants to merge 2 commits into
Conversation
- Replace the shared FilterBar on the audit log page with a dedicated, wrapping query bar: quick range, single datetime range, keyword, event type, result, more filters (source, operator, source IP, action, object), search and reset. Event ID and operation ID are no longer query inputs. - Separate draft and applied conditions: show "changes not applied", search applies, refresh refetches applied conditions, applied filters render as removable tags, reset restores the last 7 days. - Compute quick ranges from the current time; switch to custom after a manual range is confirmed. - Turn the action filter into a searchable select grouped by event type and narrowed by the selected event type (135 actions matching the backend AuditAction catalog). - Remove the time zone text from the audit log header and the system trends card, plus unused i18n keys.
- Render the query bar in TablePage's search slot so the table height accounts for it and no longer overflows the card. - Move "changes not applied" and refresh to the end of the action row and show the applied-filter row only when filters exist, removing the blank gap above the table. - Use single i18n keys with named interpolation for the more-filters count, filter tags and the remove-tag label.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
审计日志页原先直接使用公共 FilterBar:时间、事件类型、来源、结果、操作人、IP、操作、对象、事件 ID、操作 ID、关键词共 11 项平铺,改动即生效,右上角另有时区文字;控制台「系统趋势」标题下方也显示时区。本 PR 按 TAP-13326 原型调整:
AuditLog.vue):改为页面专用、可自动换行的一行:快捷范围 → 时间范围 → 关键词 → 事件类型 → 操作结果 → 更多筛选(已生效计数)→ 查询 → 重置。「更多筛选」展开来源、操作人、来源 IP、操作内容、操作对象;不再提供事件 ID、操作 ID 查询入口。公共 FilterBar 未修改,不影响其它页面。el-date-picker(datetimerange,精确到秒,不可清空)。快捷范围按当前时间计算:最近 7 天(往前 6 天 00:00:00 至今天 23:59:59,默认)、今天、最近 24 小时;在面板中手动确定时间后切换为「自定义」。audit-log.ts维护与后端AuditAction一致的 135 个 action 及所属事件类型,复用现有audit_action_*译文;已选事件类型时只列该类型的操作,切换事件类型后不匹配的已选操作自动清空。Dashboard.vue系统趋势卡片中的时区文字;自定义时间选择器仅在「自定义」时显示,靠右对齐。audit_filter_*、audit_reset_filters、audit_time_zone、dashboard_odh_timezone。表格列名、详情抽屉与 CSV 导出文案不变。IT 用例与覆盖
本次只修改 tapdata-web 前端视图与文案,不涉及后端接口或 Java 模块,Maven 集成测试不适用(N/A)。
apps/daas/tests/audit-log.test.ts新增 10 个纯逻辑用例,覆盖快捷范围(含跨月)、路由范围解析、起止时间校验、待查询判断、更多筛选计数、已生效标签、操作分组与联动清空,以及 135 个 action 和查询区文案在三种语言中齐全;原有 11 个用例保留。node --test tests/audit-log.test.ts在当前 Head 上结果为 21 pass / 0 fail。风险与依赖
daas_cluster_cluster_lianjieshuliang_detail重复键,以及Dashboard.vue的 3 个既有类型错误。auth.login)。AuditAction新增同步维护;单测会发现文案缺失,但无法自动发现后端新增的操作。eventId、operationId参数不再生效。关联任务:https://tapdata.atlassian.net/browse/TAP-13326
关联 PR:tapdata/tapdata#3623
验证代码:308ebb0698a19f882c511d28cdeb538df3ca3390
AgenticOps 版本 main-v1.6-69-bce300d8