Repository navigation
Conversation
AsperforMias
left a comment
There was a problem hiding this comment.
感谢贡献!后端排除 runtime engine 避免混入「注册中心」下拉框的方向非常合理,总览环形图防截断、列表双滚动条修复以及服务调试工作台的首屏信息层级也有明显提升。
不过当前 PR(27 个文件,+2818 / -1112)将约 200 行的核心 Bugfix 与大范围 UI 改版混在了一起,且代码和交互层存在几个较关键的问题,建议修复并考虑拆分后再合入:
拆分建议
建议将核心修复与 UI 重构拆为独立 PR,避免低风险 Bugfix 被大改版阻塞:
- 优先合入:
fix(console,ui): exclude runtime engine from mesh list & fix list scrollbars(后端mesh.go、前端meshstore/状态清理、列表双滚动条修复) - 后续拆出:全局导航/集群总览视觉改版,以及事件流/调试/场景配置工作台重构
P0(阻塞合入)
- 服务场景配置子页签不加载后端数据,提交会覆盖线上规则
ui-vue3/src/components/ConfigPage.vue:110-120改为维护组件内部activeIndex,selectOption()不再同步更新props.options.current;ui-vue3/src/views/resources/services/tabs/sceneConfig.vue:343-352依赖watch(() => options.current[0])在切换页签时触发loadConfigData(),导致切到retryNum、sameAreaFirst、paramRoute时永远不拉取后端数据,展示为空默认值,误点提交会直接覆盖线上配置。- 建议:保持
props.options.current同步(或改用显式v-model:activeIndex统一更新所有调用方),并补充组件单测。
P1(建议本轮修复或明确跟进)
-
总览基础设施外链泄漏明文凭据(安全)
ui-vue3/src/views/home/index.vue:88-97, 205-219中maskSecretInUrl只脱敏了展示文本displayValue,<a :href="entry.rawValue">依然把未脱敏的原始 URL 输出到了 DOM 和新标签页地址中;同时正则只匹配(nacos.)?password=,遗漏了user:pass@host、token=、secret=等常见形式。- 建议:在后端
AdminMetadata返回前统一剥离/脱敏 URL 凭据(userinfo 及敏感 query 参数),前端href不应绑定未脱敏 URL。
-
事件流客户端筛选与服务端分页冲突
ui-vue3/src/components/EventTimeline.vue:55-62, 94-103, 133-168的All / Normal / Warning计数与过滤只针对已加载页,容易误导运维认为“告警数为 0”;且筛选后filteredEvents.length === 0会隐藏 footer,若loadMoreTriggerRef一直留在视口内无法再次触发IntersectionObserver,页面会卡在空状态无法继续拉取后续分页。- 建议:最好在后端事件接口支持按
type筛选与分类计数;如果先保留客户端筛选,建议明确提示基于已加载数据,并在filteredEvents.length === 0 && hasMore时提供显式「加载更多」或受控续拉。
-
多处新增硬编码中文破坏 i18n
- 全局左下角菜单
ui-vue3/src/layout/index.vue:59, 75, 84, 90(语言、主题色、重置、退出登录)在英文模式下会直接显示中文(相比改前属于 i18n 退化); ui-vue3/src/views/home/index.vue:48, 75, 94, 101, 187-199, 292-294、ui-vue3/src/views/resources/services/tabs/debug.vue以及场景配置页也新增了较多硬编码中文,且copy/copySuccessfully/reset等已有 key 未复用。- 建议:统一抽入
zh.ts/en.ts。
- 全局左下角菜单
-
Mesh 列表为空时未清理过期缓存
ui-vue3/src/Login.vue:66-69与ui-vue3/src/layout/header/layout_header.vue:114-118判断为if (resolvedMesh && resolvedMesh !== meshStore.mesh);当接口返回空列表(resolvedMesh === '')时不会清理localStorage中残留的旧meshStore.mesh(如升级前残留的'default')。- 建议:改为
if (resolvedMesh !== meshStore.mesh)。
-
排除 runtime engine 后的可观测性缺口(可单开 follow-up issue 跟进)
- 未配置
dubboDiscoveryIdentifier的 K8s Pod 其RuntimeInstance.Mesh为"default",pkg/core/discovery/subscriber/lifecycle_event.go:109-144未按 IP 对齐到真实 Discovery mesh,排除 engine 后这部分 Pod 生命周期事件将无法从 UI 查到; - 此外,总览页「基础设施配置」暂未展示已接入的 Runtime Engine(如 K8s 集群名称与类型),建议后续在
/api/v1/metadata增加只读展示,方便排障确认 Engine 是否生效。
- 未配置
-
非 HTTPS 剪贴板不可用 &
Promise.all缺少容错与卸载保护ui-vue3/src/views/home/index.vue:288-296与ui-vue3/src/views/resources/services/tabs/debug.vue:558-566直接调用navigator.clipboard.writeText,在内网纯 HTTP 部署下navigator.clipboard为undefined会直接报错(仓库已有vue-clipboard3可统一复用);ui-vue3/src/views/home/index.vue:307-327的Promise.all缺少catch(任一接口失败会丢弃另一成功结果并产生未捕获拒绝),且组件卸载后仍可能执行renderDonutChart,建议改用Promise.allSettled并增加isUnmounted守卫。
P2(体验与细节打磨)
- 主题色冲突:
layout/index.vue:269、home/index.vue:401、ConfigPage.vue:232、EventTimeline.vue:236、debug.vue:886等处激活态背景硬编码为#e6f7f3,但文字/图标绑定动态primaryColor,切换其他主题色时会出现视觉割裂,建议改为基于主题色的透明/混色背景。 - 侧边栏账号浮层:
ui-vue3/src/layout/index.vue:38-94在<a-menu>(<ul>)内直接嵌套<div class="pref-menu-row">和<color-picker>,不仅 DOM 语义不规范,点击外部取色弹层时也容易触发<a-dropdown>收起,建议改用a-popover;同时第 40/50 行未拉回用户信息时建议不要硬兜底显示'admin'。 - 表单错误提示:
ConfigPage.vue:127中 Ant Design Vue 校验失败对象没有.message,会弹出submit failed [form check]: [object Object],建议提取e?.errorFields?.[0]?.errors?.[0]。 - 调试页边界:
debug.vue快速切换方法时loadMethodDetail建议加请求序号防竞态,void返回值避免JSON.stringify(undefined),方法搜索无结果时补充空态提示。 - 双滚动条遗漏:
services/tabs/distribution.vue:127、applications/tabs/service.vue:78、applications/tabs/instance.vue:274仍保留固定scrollY,可一并清理。
|
|
@AsperforMias 已在提交 P0
P1
P2
验证
|
There was a problem hiding this comment.
🟡 Changes recommended
An unresolved critical redaction bypass can expose credentials through /api/v1/metadata when URLs or query parameters are malformed.
10 open issues
Malformed URLs can bypass credential redaction · New Keep populated runtime meshes accessible · New Preserve URL-based authentication for Grafana embeds · New Await parameter-route mutations before reporting success · New Show cluster counts as unavailable when loading fails · New Prevent the infrastructure panel from clipping metadata · New Use accessible semantics for method selection · New Avoid leaking Monaco editors when switching methods · New Clear stale method details before loading a new method · New Translate route-card captions in the English locale · New
What changed in this PR
Corrects registry selection for Console resources and refreshes the Vue interface, keeping mesh selection aligned with backend resource ownership.
Changes:
- Filter mesh options, repair stale selections, and add regression tests.
- Redesign overview, navigation, event, debug, and configuration interfaces.
- Simplify scrolling, fix form behavior, and redact infrastructure credentials.
Validation was limited to a standalone URL-sanitization check; project tests and browser checks were not run.
| File | Description |
|---|---|
ui-vue3/src/views/traffic/tagRule/index.vue |
Remove fixed table scrolling. |
ui-vue3/src/views/traffic/routingRule/index.vue |
Remove fixed table scrolling. |
ui-vue3/src/views/resources/services/tabs/sceneConfig.vue |
Update configuration navigation and route layout. |
ui-vue3/src/views/resources/services/tabs/paramRoute.vue |
Make routing cards responsive. |
ui-vue3/src/views/resources/services/tabs/event.vue |
Use the selected mesh directly. |
ui-vue3/src/views/resources/services/tabs/distribution.vue |
Remove fixed table scrolling. |
ui-vue3/src/views/resources/services/tabs/debug.vue |
Rebuild the service debug workbench. |
ui-vue3/src/views/resources/services/search.vue |
Remove fixed table scrolling. |
ui-vue3/src/views/resources/instances/tabs/event.vue |
Use the selected mesh directly. |
ui-vue3/src/views/resources/instances/tabs/configuration.vue |
Correct traffic-disable reset behavior. |
ui-vue3/src/views/resources/instances/index.vue |
Remove fixed table scrolling. |
ui-vue3/src/views/resources/applications/tabs/service.vue |
Remove nested table scrolling. |
ui-vue3/src/views/resources/applications/tabs/instance.vue |
Remove nested table scrolling. |
ui-vue3/src/views/resources/applications/tabs/event.vue |
Use the selected mesh directly. |
ui-vue3/src/views/resources/applications/tabs/config.vue |
Restyle rule cards and scope editors. |
ui-vue3/src/views/resources/applications/index.vue |
Remove fixed table scrolling. |
ui-vue3/src/views/home/index.vue |
Refresh charts, resource links, and metadata display. |
ui-vue3/src/stores/mesh.ts |
Add active-mesh resolution. |
ui-vue3/src/stores/mesh.test.ts |
Test mesh-selection fallback behavior. |
ui-vue3/src/Login.vue |
Resolve stale mesh selections after login. |
ui-vue3/src/layout/tab/layout_tab.vue |
Adjust page height by tab layout. |
ui-vue3/src/layout/index.vue |
Move account preferences into the sidebar. |
ui-vue3/src/layout/header/layout_header.vue |
Simplify navigation and resolve mesh selection. |
ui-vue3/src/components/SearchTable.vue |
Omit unspecified scroll dimensions. |
ui-vue3/src/components/EventTimeline.vue |
Add compact event layout and severity filters. |
ui-vue3/src/components/EventTimeline.test.ts |
Test filtered-event pagination access. |
ui-vue3/src/components/ConfigPage.vue |
Refresh configuration layout and submission handling. |
ui-vue3/src/components/ConfigPage.test.ts |
Test tab events and validation failures. |
ui-vue3/src/base/i18n/zh.ts |
Add Chinese labels and placeholders. |
ui-vue3/src/base/i18n/en.ts |
Add English labels and placeholders. |
pkg/console/handler/overview.go |
Redact credentials from metadata URLs. |
pkg/console/handler/overview_test.go |
Test metadata credential redaction. |
pkg/console/handler/mesh.go |
Prefer discovery meshes over runtime engines. |
pkg/console/handler/mesh_test.go |
Test discovery selection and engine fallback. |
Review effort: Max
| func sanitizeMetadataURL(raw string) string { | ||
| trimmed := strings.TrimSpace(raw) | ||
| if trimmed == "" { | ||
| return "" | ||
| } | ||
| parsed, err := url.Parse(trimmed) | ||
| if err != nil { | ||
| return trimmed | ||
| } | ||
| if parsed.User != nil { | ||
| if _, hasPassword := parsed.User.Password(); hasPassword { | ||
| parsed.User = nil | ||
| } | ||
| } | ||
| if parsed.RawQuery != "" { | ||
| query := parsed.Query() | ||
| changed := false | ||
| for key := range query { | ||
| if isSensitiveQueryKey(key) { | ||
| query.Del(key) | ||
| changed = true | ||
| } | ||
| } | ||
| if changed { | ||
| parsed.RawQuery = query.Encode() | ||
| } | ||
| } | ||
| return parsed.String() | ||
| } |
| // Include the engine as a mesh so K8s resources are discoverable in the UI | ||
| engineCfg := ctx.Config().Engine | ||
| if engineCfg != nil && engineCfg.Type != enginecfg.Mock { | ||
| if len(meshes) == 0 && engineCfg != nil && engineCfg.Type != enginecfg.Mock { |
| Metadata: sanitizeMetadataURL(metadataAddr), | ||
| Config: sanitizeMetadataURL(configAddr), | ||
| Prometheus: sanitizeMetadataURL(prometheusURL), | ||
| Grafana: sanitizeMetadataURL(grafanaURL), |
| await cur.submit(cur.form) | ||
| message.success('submit success') |
| appCount: 0, | ||
| serviceCount: 0, | ||
| insCount: 0 |
| background: #ffffff; | ||
| border: 1px solid #eef0f4; | ||
| border-radius: 10px; | ||
| overflow: hidden; |
| <ul v-else class="method-list" role="listbox" :aria-label="$t('debugDomain.methodList')"> | ||
| <li v-for="entry in filteredMethods" :key="entry.key"> | ||
| <button | ||
| type="button" | ||
| class="method-item" | ||
| :class="{ active: activeKey === entry.key }" | ||
| :title="entry.method.signature || entry.method.methodName" | ||
| :aria-selected="activeKey === entry.key" |
| </span> | ||
| </div> | ||
| <monaco-editor | ||
| v-else |
| } | ||
|
|
||
| async function loadMethodDetail(method: MethodSummary) { | ||
| const reqSeq = ++detailRequestSeq |
| <template #extra> | ||
| <a-button danger type="text" size="small" @click="emit('deleteParamRoute', props.index)"> | ||
| <DeleteOutlined /> | ||
| 删除 |






Please provide a description of this PR:
This PR fixes a registry/mesh selection bug in
/api/v1/meshes(along with several frontend bugs) and polishes the Console UI across the Cluster Overview, Navigation Bar, Resource Lists, Event Timeline, Service Debug Workbench, and Scene Config pages.Bug Fixes
Exclude runtime engine from
/api/v1/mesheswhen discoveries are configuredpkg/console/handler/mesh.go:ListMeshespreviously appended the non-mock Kubernetes runtime engine (id: default) alongside configured registry discoveries (e.g.nacos2.5). Because Applications, Services, merged Instances, and alignedLifecycleEvents belong to the discovery mesh, selecting the engine mesh rendered empty resource lists.ListMeshesnow returns configured discoveries and only falls back to a non-mock engine whenlen(discoveries) == 0.ui-vue3/src/stores/mesh.ts,Login.vue,layout_header.vue: AddedresolveActiveMesh()so stale cached mesh IDs (such asdefault) automatically fall back to the first valid registry mesh on login and page refresh, and removed hardcoded|| 'default'fallbacks in the 3 Event tabs.pkg/console/handler/mesh_test.go) and Vitest unit tests (ui-vue3/src/stores/mesh.test.ts).Remove duplicate vertical scrollbars on list pages
ui-vue3/src/layout/tab/layout_tab.vue: Compute#layout-tab-bodyheight dynamically (calc(100vh - 300px)for detail tab pages vscalc(100vh - 176px)for list pages without the tab header).ui-vue3/src/components/SearchTable.vueand 5 list views (applications/index.vue,instances/index.vue,services/search.vue,routingRule/index.vue,tagRule/index.vue): Removed hardcodedscrollY: '367px'so tables no longer nest a second vertical scrollbar inside the page scroll container.Fix missing i18n placeholder and Scene Config bugs
placeholder.serviceNamei18n keys (zh.ts/en.ts) and unified the Application config tab label to场景配置/Scene Config.ConfigPage.vuesubmit()showingsubmit successeven after validation or server errors.instances/tabs/configuration.vueresettingform.logFlaginstead ofform.flowDisabledFlagin the traffic-disable tab.services/tabs/sceneConfig.vue.param-routefixedheight: 320pxcausing param route cards to overlap the Submit/Reset footer.UI / UX Improvements (Before & After)
1. Cluster Overview & Top Navigation (
home/index.vue,layout_header.vue,layout/index.vue)autoFit: truewith centered totals and clean bottom legends (fixing clipped outside labels and center-text overflow); added password masking, copy, and external open actions to the infrastructure table.2. Resource Lists (
layout_tab.vue,SearchTable.vue, list views)placeholder.serviceNametext in the Services search bar.3. Event Timeline (
EventTimeline.vue)<a-timeline mode="left">with a compact 3-column grid (timestamp | rail | message & source), addedAll / Normal / Warningseverity filters, aligned colors with Dubbo's primary teal palette, and added skeleton loading + full i18n.4. Service Debug Workbench (
services/tabs/debug.vue)5. Scene Config Workbench (
ConfigPage.vue, app/instance/service config tabs)30pxduplicate title andscale(1.1)menu distortion, made rule tables full-width responsive, and moved添加参数路由to the top-right header action bar consistent with Flow Weight and Gray Isolation.Verification
go test -v ./pkg/console/handler/... ./pkg/console/router/...— PASS (TestListMeshes4/4)cd ui-vue3 && npm run test:unit -- --run— PASS (15 test files / 79 tests, includingsrc/stores/mesh.test.ts4/4)eslint&vue-tscon all modified files — zero new errorsTo help us figure out who should review this PR, please put an X in all the areas that this PR affects.