fix: 移除后端普通用户使用统计API中的提供商信息/修复下拉菜单悬停效果 (#121)

* fix: 移除普通用户使用统计页面的提供商信息

普通用户不应该看到后端使用的提供商信息,此前前端筛选框和后端 API
都泄露了这些数据。

- 前端:为提供商筛选下拉菜单添加 isAdmin 条件
- 后端:移除 summary_by_provider 和 records 中的 provider 字段
- 补充:添加遗漏的 first_byte_time_ms 字段

* fix: 修复 SelectItem 下拉菜单悬停高亮效果

将 hover:bg-primary/10 改为 data-[highlighted]:bg-accent,与
DropdownMenuItem 保持一致。radix-vue 使用 data-highlighted 属性
控制高亮状态,这样键盘导航和鼠标悬停的高亮行为才能正确同步。

---------

Co-authored-by: LewisPen <LewisPen@nyadoo.com>
This commit is contained in:
NyaDoo
2026-01-23 18:57:41 +08:00
committed by GitHub
parent 2256ad1233
commit cddccd2b99
3 changed files with 6 additions and 4 deletions

View File

@@ -14,7 +14,9 @@ const props = defineProps<Props>()
const itemClass = computed(() =>
cn(
'relative flex w-full cursor-pointer select-none items-center rounded-lg py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-primary/10 focus:bg-primary/15 text-foreground transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
'relative flex w-full cursor-pointer select-none items-center rounded-lg py-1.5 pl-8 pr-2 text-sm outline-none',
'data-[highlighted]:bg-accent focus:bg-accent text-foreground',
'transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
props.class
)
)

View File

@@ -90,8 +90,9 @@
</SelectContent>
</Select>
<!-- 提供商筛选 -->
<!-- 提供商筛选仅管理员可见 -->
<Select
v-if="isAdmin"
v-model:open="filterProviderSelectOpen"
:model-value="filterProvider"
@update:model-value="$emit('update:filterProvider', $event)"