A modern and elegant dashboard for network traffic visualization and analysis.
feat: Enhance dashboard with mobile optimizations for tables, fix untranslated text in country, proxy, and rule sections, and add an 'About' module with version information.
luoleie0a828e68299
diff --git a/.cursorindexingignore b/.cursorindexingignorenew file mode 100644index 0000000..953908e--- /dev/null+++ b/.cursorindexingignore@@ -0,0 +1,3 @@++# Don't index SpecStory auto-save files, but allow explicit context inclusion via @ references+.specstory/**diff --git "a/.specstory/history/2026-02-06_02-27Z-openclash-\347\234\213\346\235\277\344\274\230\345\214\226.md" "b/.specstory/history/2026-02-06_02-27Z-openclash-\347\234\213\346\235\277\344\274\230\345\214\226.md"new file mode 100644index 0000000..5a5a75f--- /dev/null+++ "b/.specstory/history/2026-02-06_02-27Z-openclash-\347\234\213\346\235\277\344\274\230\345\214\226.md"@@ -0,0 +1,5975 @@+<!-- Generated by SpecStory, Markdown v2.1.0 -->++<!-- cursor Session ee8a1849-c040-4f82-9dd7-74ef9bb8318f (2026-02-06 02:27Z) -->++# OpenClash 看板优化 (2026-02-06 02:27Z)++_**User (2026-02-06 02:27Z)**_++这是我开发的一个用于 OpenClash 流量分析的看板 app。现在我需要你帮我检查和优化这个项目。+1.我的这个应用是宽屏和移动端适配的,但是现在在移动端的情况下,Domains 模块的 Domain List 以及 IP Addreses,Rules 模块,由于模块内部有一些较长的文本,现在都拥挤到了一起。我希望你能合理优化在移动端这些表单,模块的陪伴和适配。另外在小屏模式下,Domains 模块列表中的网站预览图标的背景图也出现了变形。+2.现在在「国家」「代理」「规则」这这几板块中,当我切换到中文之后,依旧有一些文本没有对应显示中文,还是显示英文,我希望你也继续修复这个问题。+3.另外我希望再在页面的左下角下方,增加一个「关于」的模块,当用户点击关于之后,可以弹窗显示当前的版本(先从0.0.1这个版本开始,我这个开源项目刚刚上线,你建议从哪个版本开始呢),并且展示我们开源项目 Github 的地址 https://github.com/foru17/clash-master+++---++_**Agent (model claude-4.6-opus-high-thinking, mode Agent)**_++++++---++<think><details><summary>Thought Process</summary>+Let me start by understanding the project structure and codebase before making any changes.</details></think>++---++<tool-use data-tool-type="generic" data-tool-name="list_dir">+<details>+ <summary>Tool use: **list_dir** • Listed directory, 0 results</summary>++No results found+</details>+</tool-use>++---++<tool-use data-tool-type="generic" data-tool-name="glob_file_search">+<details>+<summary>Tool use: **glob_file_search** • Searched codebase "**/*.{tsx,ts,jsx,js,css,scss}" • **64** results in **1** directory</summary>++Directory: **/Users/luolei/DEV/clash-master** (64 files)++| File |+|------|+| `apps/web/next.config.ts` |+| `apps/collector/src/api.ts` |+| `apps/collector/src/db.ts` |+| `apps/web/components/top-domains-chart.tsx` |+| `apps/web/components/overview/top-domains-simple.tsx` |+| `apps/web/components/domain-top-list.tsx` |+| `apps/web/components/domain-top-grid.tsx` |+| `apps/web/components/domains-table.tsx` |+| `apps/web/components/ips-table.tsx` |+| `apps/web/components/world-traffic-map.tsx` |+| `apps/web/components/navigation.tsx` |+| `apps/web/app/[locale]/layout.tsx` |+| `apps/web/components/ui/pagination.tsx` |+| `apps/web/app/[locale]/page.tsx` |+| `apps/collector/src/geo-service.ts` |+| `apps/web/components/traffic-trend-chart.tsx` |+| `apps/web/components/overview/top-proxies-simple.tsx` |+| `apps/web/lib/api.ts` |+| `apps/web/components/overview/index.tsx` |+| `apps/collector/src/collector.ts` |+| `apps/web/components/backend-config-dialog.tsx` |+| `apps/collector/src/index.ts` |+| `apps/collector/src/websocket.ts` |+| `apps/web/components/ui/alert-dialog.tsx` |+| `apps/web/components/ui/label.tsx` |+| `apps/web/components/ui/dialog.tsx` |+| `apps/web/components/overview/top-countries-simple.tsx` |+| `apps/web/components/stats-cards.tsx` |+| `apps/web/types/modules.d.ts` |+| `packages/shared/src/index.ts` |+| `apps/web/components/proxy-top-grid.tsx` |+| `apps/web/components/country-top-list.tsx` |+| `apps/web/components/top-list-item.tsx` |+| `apps/web/components/overview-card.tsx` |+| `apps/web/components/proxy-top-list.tsx` |+| `apps/web/components/country-traffic-list.tsx` |+| `apps/web/components/country-traffic-chart.tsx` |+| `apps/web/components/proxy-stats-chart.tsx` |+| `apps/web/components/favicon.tsx` |+| `apps/web/components/rule-chain-chart.tsx` |+| `apps/web/components/header.tsx` |+| `apps/web/lib/websocket.ts` |+| `apps/web/components/ui/popover.tsx` |+| `apps/web/components/time-range-picker.tsx` |+| `apps/web/components/language-switcher.tsx` |+| `apps/web/components/traffic-chart.tsx` |+| `apps/web/components/theme-toggle.tsx` |+| `apps/web/app/globals.css` |+| `apps/web/middleware.ts` |+| `apps/web/i18n/routing.ts` |+| `apps/web/i18n/request.ts` |+| `apps/web/next-env.d.ts` |+| `apps/web/lib/utils.ts` |+| `apps/web/components/providers/theme-provider.tsx` |+| `apps/web/components/ui/table.tsx` |+| `apps/web/components/ui/input.tsx` |+| `apps/web/components/ui/badge.tsx` |+| `apps/web/components/ui/separator.tsx` |+| `apps/web/components/ui/switch.tsx` |+| `apps/web/components/ui/select.tsx` |+| `apps/web/components/ui/dropdown-menu.tsx` |+| `apps/web/components/ui/tabs.tsx` |+| `apps/web/components/ui/card.tsx` |+| `apps/web/components/ui/button.tsx` |++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+Let me explore the key files to understand the project structure and identify the issues. I need to look at:+1. The main page, layout, and key components related to Domains, IPs, Rules+2. The i18n translation files (en.json and zh.json)+3. The CSS/styling approach+4. Mobile responsiveness patterns++Let me read multiple files in parallel to understand the project.</details></think>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/app/[locale]/page.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/messages/en.json</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/messages/zh.json</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/app/globals.css</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/domains-table.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/ips-table.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/rule-chain-chart.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/favicon.tsx</summary>++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+Now let me also look at the other components that might have untranslated text, especially the country-related, proxy-related, and navigation components:</details></think>++---++Now let me look at more components to understand the translation issues and the navigation structure:++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/country-traffic-list.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-stats-chart.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/country-traffic-chart.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/country-top-list.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-top-list.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-top-grid.tsx</summary>++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+Now I have a good understanding of the issues. Let me also look at a few more components to find all untranslated text:</details></think>++---++Let me also check remaining components for untranslated text and look at the overview components:++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/overview/top-countries-simple.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/overview/top-proxies-simple.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/overview/top-domains-simple.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/overview/index.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/domain-top-list.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/domain-top-grid.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/world-traffic-map.tsx</summary>++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+Now I have a thorough understanding of the codebase. Let me create a todo list and plan all the changes needed.++## Issues to Fix:++### 1. Mobile Responsiveness Issues+- **Domains Table**: The `grid-cols-12` layout with `gap-4` is too tight on mobile. The domain column takes `col-span-4`, download `col-span-3`, upload `col-span-3`, and IP count `col-span-2`. This is 12 cols total on mobile but with long text, it's crowded.+- **IPs Table**: Similar problem - IP column `col-span-4`, location `col-span-2`, download `col-span-3`, upload `col-span-3`. Also 12 cols on mobile.+++- **Rule Chain Chart**: The rule items pack multiple elements horizontally (icon, rule name, arrow, proxy name, traffic stats), which becomes cramped on smaller screens.+- **Favicon background image**: The favicon container is quite small at `w-5 h-5`, and while the gradient background should render correctly, I need to verify there's no squashing or sizing issues with how the favicon displays in the domains table.++Now I'm looking at the favicon sizing more closely. The issue might be that the favicon container is missing the `shrink-0` class, which could cause it to compress or distort on smaller screens when the grid layout gets tight.++I'm also noticing several hardcoded English strings scattered throughout the components that need translation support. In the proxy stats chart, there are labels like the chart title and tooltip text for traffic metrics and connection counts. The rule chain chart has similar untranslated text that needs to be extracted for i18n.++Looking at the country traffic and world map components, I see the same pattern—chart titles, tooltip labels, and even a hardcoded Chinese label for continents that should be properly localized instead of hardcoded.++Continuing through the list components, I'm finding more hardcoded Chinese strings: "Top 国家/地区" and "Top 代理" for section headers, "暂无数据" for empty states, and action labels like "查看全部" and buttons for sorting by traffic or connections that all need to be extracted for proper internationalization. I'm also seeing hardcoded Chinese strings in domain-top-grid.tsx and noticing that the country name function in top-countries-simple.tsx always returns English regardless of locale settings. Beyond the translation issues, I need to add an About button to the navigation's bottom left corner that opens a dialog displaying the version number.++For the version, I'm thinking 1.0.0 makes sense for a first public open source release since it signals the project is stable and ready for use, though 0.1.0 could work too if they want to emphasize it's still early. I'll go with 1.0.0 following semantic versioning conventions, then create a todo list and start implementing these fixes.++Now I'm mapping out the work needed: for internationalization I'll add translation keys to both language files and update components to use the translation hook, for mobile responsiveness I need to adapt the tables and charts to stack properly on smaller screens and fix the favicon issue, and I'll add an About dialog with a navigation button.</details></think>++---++Now I have a comprehensive understanding of all the issues. Let me create a plan and start implementing:++---++<tool-use data-tool-type="task" data-tool-name="todo_write">+<details><summary>Tool use: **todo_write** • Todo List</summary>++- [-] Fix mobile responsiveness: domains-table, ips-table, rule-chain-chart+- [ ] Fix favicon distortion on mobile (add shrink-0)+- [ ] Fix untranslated text in proxy-stats-chart+- [ ] Fix untranslated text in rule-chain-chart+- [ ] Fix untranslated text in country-traffic-chart+- [ ] Fix untranslated text in world-traffic-map+- [ ] Fix hardcoded text in country-top-list, proxy-top-list, etc.+- [ ] Fix hardcoded text in domain-top-list, domain-top-grid, proxy-top-grid+- [ ] Update en.json and zh.json with all new translation keys+- [ ] Add About dialog with version and GitHub link++</details>+</tool-use>++---++Let me first update the translation files with all needed keys, then update all the components. Let me start with the translation files and the mobile-responsive components:++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/top-domains-chart.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/traffic-trend-chart.tsx</summary>++</details>+</tool-use>++---++Now I have a thorough understanding. Let me start implementing all changes. First, I'll update the translation files with all the new keys needed:++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/messages/en.json</summary>++**Chunk 1**+Lines added: 39, lines removed: 3++```diff+@@ -135,16 +135,52 @@+ "countries": {+ "title": "Countries",+- "details": "Country Details"++ "details": "Country Details",++ "distribution": "Country Traffic Distribution",++ "continents": "Continents:",++ "noData": "No data",++ "connections": "connections"+ },+ "proxies": {+- "title": "Proxies"++ "title": "Proxies",++ "distribution": "Proxy Traffic Distribution",++ "total": "Total",++ "download": "Download",++ "upload": "Upload",++ "connections": "connections",++ "sortByTraffic": "Traffic",++ "sortByConnections": "Connections",++ "noData": "No data",++ "viewAll": "View all"+ },+ "rules": {+- "title": "Rules"++ "title": "Rules",++ "distribution": "Rule Chain Distribution",++ "description": "Traffic distribution by matching rules and their final proxy nodes",++ "connections": "conn"+ },+ "network": {+ "title": "Network",+ "comingSoon": "Real-time connection monitoring coming soon..."+ },++ "map": {++ "title": "Global Traffic Distribution",++ "total": "Total",++ "download": "Download",++ "upload": "Upload",++ "connections": "Connections",++ "hoverHint": "Hover over countries for details",++ "traffic": "Traffic:",++ "low": "Low",++ "high": "High"++ },++ "about": {++ "title": "About",++ "version": "Version",++ "projectName": "Clash Master",++ "description": "Modern and beautiful traffic analysis dashboard for OpenClash",++ "github": "GitHub",++ "openSource": "Open Source Project",++ "license": "MIT License"++ },+ "common": {+ "search": "Search",+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/messages/zh.json</summary>++**Chunk 1**+Lines added: 39, lines removed: 3++```diff+@@ -135,16 +135,52 @@+ "countries": {+ "title": "国家/地区",+- "details": "国家/地区详情"++ "details": "国家/地区详情",++ "distribution": "国家/地区流量分布",++ "continents": "大洲:",++ "noData": "暂无数据",++ "connections": "连接"+ },+ "proxies": {+- "title": "代理节点"++ "title": "代理节点",++ "distribution": "代理节点流量分布",++ "total": "总计",++ "download": "下载",++ "upload": "上传",++ "connections": "连接",++ "sortByTraffic": "流量",++ "sortByConnections": "连接",++ "noData": "暂无数据",++ "viewAll": "查看全部"+ },+ "rules": {+- "title": "规则"++ "title": "规则",++ "distribution": "规则链路分布",++ "description": "按匹配规则和最终代理节点的流量分布",++ "connections": "连接"+ },+ "network": {+ "title": "网络",+ "comingSoon": "实时连接监控功能开发中..."+ },++ "map": {++ "title": "全球流量分布",++ "total": "总计",++ "download": "下载",++ "upload": "上传",++ "connections": "连接数",++ "hoverHint": "悬停查看国家详情",++ "traffic": "流量:",++ "low": "低",++ "high": "高"++ },++ "about": {++ "title": "关于",++ "version": "版本",++ "projectName": "Clash Master",++ "description": "现代美观的 OpenClash 流量分析看板",++ "github": "GitHub",++ "openSource": "开源项目",++ "license": "MIT 许可证"++ },+ "common": {+ "search": "搜索",+```++</details>++</tool-use>++---++<tool-use data-tool-type="task" data-tool-name="todo_write">+<details><summary>Tool use: **todo_write** • Todo List</summary>++- [-] Fix mobile responsiveness: domains-table, ips-table, rule-chain-chart+- [ ] Fix favicon distortion on mobile (add shrink-0)+- [ ] Fix untranslated text in proxy-stats-chart+- [ ] Fix untranslated text in rule-chain-chart+- [ ] Fix untranslated text in country-traffic-chart+- [ ] Fix untranslated text in world-traffic-map+- [ ] Fix hardcoded text in country-top-list, proxy-top-list, etc.+- [ ] Fix hardcoded text in domain-top-list, domain-top-grid, proxy-top-grid+- [x] Update en.json and zh.json with all new translation keys+- [ ] Add About dialog with version and GitHub link++</details>+</tool-use>++---++Now let me update all the components. I'll work on multiple files in parallel:++---++<tool-use data-tool-type="write" data-tool-name="write">++<details><summary>Tool use: **write** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/domains-table.tsx</summary>++**Chunk 1**+Lines added: 3, lines removed: 3++```diff+@@ -101,9 +101,9 @@++ const SortIcon = ({ column }: { column: SortKey }) => {+- if (sortKey !== column) return <ArrowUpDown className="ml-2 h-3 w-3 text-muted-foreground" />;++ if (sortKey !== column) return <ArrowUpDown className="ml-1 h-3 w-3 text-muted-foreground" />;+ return sortOrder === "asc" ? (+- <ArrowUp className="ml-2 h-3 w-3 text-primary" />++ <ArrowUp className="ml-1 h-3 w-3 text-primary" />+ ) : (+- <ArrowDown className="ml-2 h-3 w-3 text-primary" />++ <ArrowDown className="ml-1 h-3 w-3 text-primary" />+ );+ };+```++**Chunk 2**+Lines added: 2, lines removed: 2++```diff+@@ -139,6 +139,6 @@+ <div className="glass-card rounded-2xl overflow-hidden">+ {/* Header */}+- <div className="p-5 border-b border-border/50">+- <div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">++ <div className="p-4 sm:p-5 border-b border-border/50">++ <div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3">+ <div>+ <h3 className="text-lg font-semibold">{t("title")}</h3>+```++**Chunk 3**+Lines added: 3, lines removed: 3++```diff+@@ -159,8 +159,8 @@+ </div>++- {/* Table Header */}+- <div className="grid grid-cols-12 gap-4 px-5 py-3 bg-secondary/30 text-xs font-medium text-muted-foreground uppercase tracking-wider">++ {/* Desktop Table Header - Hidden on mobile */}++ <div className="hidden sm:grid grid-cols-12 gap-3 px-5 py-3 bg-secondary/30 text-xs font-medium text-muted-foreground uppercase tracking-wider">+ <div+- className="col-span-4 sm:col-span-3 flex items-center cursor-pointer hover:text-foreground transition-colors"++ className="col-span-3 flex items-center cursor-pointer hover:text-foreground transition-colors"+ onClick={() => handleSort("domain")}+ >+```++**Chunk 4**+Lines added: 1, lines removed: 1++```diff+@@ -169,5 +169,5 @@+ </div>+ <div+- className="col-span-3 sm:col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"++ className="col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"+ onClick={() => handleSort("totalDownload")}+ >+```++**Chunk 5**+Lines added: 1, lines removed: 1++```diff+@@ -176,5 +176,5 @@+ </div>+ <div+- className="col-span-3 sm:col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"++ className="col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"+ onClick={() => handleSort("totalUpload")}+ >+```++**Chunk 6**+Lines added: 30, lines removed: 1++```diff+@@ -183,14 +183,43 @@+ </div>+ <div+- className="hidden sm:col-span-2 sm:flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"++ className="col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"+ onClick={() => handleSort("totalConnections")}+ >+ {t("conn")}+ <SortIcon column="totalConnections" />+ </div>++ <div className="col-span-1 flex items-center justify-end">++ {t("last")}++ </div>+ <div className="col-span-2 flex items-center justify-end">+ {t("ipCount")}+ </div>+ </div>++++ {/* Mobile Sort Bar - Shown only on mobile */}++ <div className="sm:hidden flex items-center gap-2 px-4 py-2 bg-secondary/30 overflow-x-auto">++ {([++ { key: "domain" as SortKey, label: t("domain") },++ { key: "totalDownload" as SortKey, label: t("download") },++ { key: "totalUpload" as SortKey, label: t("upload") },++ { key: "totalConnections" as SortKey, label: t("conn") },++ ]).map(({ key, label }) => (++ <button++ key={key}++ className={cn(++ "flex items-center gap-0.5 px-2 py-1 rounded-md text-xs font-medium whitespace-nowrap transition-colors",++ sortKey === key++ ? "bg-primary/10 text-primary"++ : "text-muted-foreground hover:text-foreground"++ )}++ onClick={() => handleSort(key)}++ >++ {label}++ {sortKey === key && (++ sortOrder === "asc" ? <ArrowUp className="h-3 w-3" /> : <ArrowDown className="h-3 w-3" />++ )}++ </button>++ ))}++ </div>++ {/* Table Body */}+```++**Chunk 7**+Lines added: 2, lines removed: 2++```diff+@@ -206,8 +235,8 @@+ return (+ <div key={domain.domain} className="group">+- {/* Main Row */}++ {/* Desktop Row */}+ <div+ className={cn(+- "grid grid-cols-12 gap-4 px-5 py-4 items-center hover:bg-secondary/20 transition-colors cursor-pointer",++ "hidden sm:grid grid-cols-12 gap-3 px-5 py-4 items-center hover:bg-secondary/20 transition-colors cursor-pointer",+ isExpanded && "bg-secondary/10"+ )}+```++**Chunk 8**+Lines added: 12, lines removed: 8++```diff+@@ -216,32 +245,36 @@+ >+ {/* Domain with Favicon */}+- <div className="col-span-4 sm:col-span-3 flex items-center gap-3 min-w-0">+- <Favicon domain={domain.domain} size="sm" />++ <div className="col-span-3 flex items-center gap-3 min-w-0">++ <Favicon domain={domain.domain} size="sm" className="shrink-0" />+ <div className="min-w-0">+ <p className="font-medium truncate text-sm">+ {domain.domain || t("unknown")}+ </p>+- <p className="text-xs text-muted-foreground">+- {formatDuration(domain.lastSeen)}+- </p>+ </div>+ </div>++ {/* Download */}+- <div className="col-span-3 sm:col-span-2 text-right tabular-nums text-sm">++ <div className="col-span-2 text-right tabular-nums text-sm">+ <span className="text-blue-500">{formatBytes(domain.totalDownload)}</span>+ </div>++ {/* Upload */}+- <div className="col-span-3 sm:col-span-2 text-right tabular-nums text-sm">++ <div className="col-span-2 text-right tabular-nums text-sm">+ <span className="text-purple-500">{formatBytes(domain.totalUpload)}</span>+ </div>++ {/* Connections */}+- <div className="hidden sm:col-span-2 sm:flex items-center justify-end">++ <div className="col-span-2 flex items-center justify-end">+ <span className="px-2.5 py-1 rounded-full bg-secondary text-xs font-medium">+ {domain.totalConnections}+ </span>+ </div>++++ {/* Last Seen */}++ <div className="col-span-1 text-right">++ <p className="text-xs text-muted-foreground">++ {formatDuration(domain.lastSeen)}++ </p>++ </div>++ {/* IP Count - Clickable */}+```++**Chunk 9**+Lines added: 50, lines removed: 1++```diff+@@ -271,8 +304,57 @@+ </div>+ </div>++++ {/* Mobile Row - Card-style layout */}++ <div++ className={cn(++ "sm:hidden px-4 py-3 hover:bg-secondary/20 transition-colors cursor-pointer",++ isExpanded && "bg-secondary/10"++ )}++ onClick={() => toggleExpand(domain.domain)}++ >++ {/* Top: Favicon + Domain + Expand */}++ <div className="flex items-center gap-2.5 mb-2">++ <Favicon domain={domain.domain} size="sm" className="shrink-0" />++ <div className="flex-1 min-w-0">++ <p className="font-medium text-sm truncate">++ {domain.domain || t("unknown")}++ </p>++ <p className="text-xs text-muted-foreground">++ {formatDuration(domain.lastSeen)}++ </p>++ </div>++ <Button++ variant="ghost"++ size="sm"++ className={cn(++ "h-7 px-2 gap-1 text-xs font-medium shrink-0",++ isExpanded++ ? "bg-primary/10 text-primary"++ : "bg-secondary/50 text-muted-foreground"++ )}++ onClick={(e) => {++ e.stopPropagation();++ toggleExpand(domain.domain);++ }}++ >++ <Server className="h-3 w-3" />++ {domain.ips.length}++ {isExpanded ? <ChevronUp className="h-3 w-3" /> : <ChevronDown className="h-3 w-3" />}++ </Button>++ </div>++++ {/* Bottom: Stats row */}++ <div className="flex items-center justify-between text-xs pl-[30px]">++ <span className="text-blue-500 tabular-nums">↓ {formatBytes(domain.totalDownload)}</span>++ <span className="text-purple-500 tabular-nums">↑ {formatBytes(domain.totalUpload)}</span>++ <span className="px-2 py-0.5 rounded-full bg-secondary text-muted-foreground font-medium">++ {domain.totalConnections} {t("conn")}++ </span>++ </div>++ </div>++ {/* Expanded IP List */}+ {isExpanded && (+- <div className="px-5 pb-4 bg-secondary/5">++ <div className="px-4 sm:px-5 pb-4 bg-secondary/5">+ <div className="pt-2 pb-1 px-1">+ <p className="text-xs font-medium text-muted-foreground mb-2 flex items-center gap-1.5">+```++**Chunk 10**+Lines added: 5, lines removed: 5++```diff+@@ -281,15 +363,15 @@+ </p>+ <div className="flex flex-wrap gap-2">+- {domain.ips.map((ip, ipIndex) => {++ {domain.ips.map((ip) => {+ const gradient = getIPGradient(ip);+ return (+ <div+ key={ip}+- className="flex items-center gap-2 px-3 py-2 rounded-lg bg-card border border-border/50 hover:border-primary/30 hover:shadow-sm transition-all"++ className="flex items-center gap-2 px-2.5 py-1.5 sm:px-3 sm:py-2 rounded-lg bg-card border border-border/50 hover:border-primary/30 hover:shadow-sm transition-all"+ >+- <div className={`w-6 h-6 rounded-md bg-gradient-to-br ${gradient} flex items-center justify-center shrink-0`}>+- <Server className="w-3 h-3 text-white" />++ <div className={`w-5 h-5 sm:w-6 sm:h-6 rounded-md bg-gradient-to-br ${gradient} flex items-center justify-center shrink-0`}>++ <Server className="w-2.5 h-2.5 sm:w-3 sm:h-3 text-white" />+ </div>+- <code className="text-xs font-mono">{ip}</code>++ <code className="text-xs font-mono break-all">{ip}</code>+ </div>+ );+```++**Chunk 11**+Lines added: 2, lines removed: 2++```diff+@@ -307,6 +389,6 @@+ {/* Pagination Footer */}+ {totalPages > 0 && (+- <div className="p-4 border-t border-border/50 bg-secondary/20">+- <div className="flex flex-col sm:flex-row items-center justify-between gap-4">++ <div className="p-3 sm:p-4 border-t border-border/50 bg-secondary/20">++ <div className="flex flex-col sm:flex-row items-center justify-between gap-3">+ {/* Page size selector */}+ <div className="flex items-center gap-2">+```++**Chunk 12**+Lines added: 5, lines removed: 2++```diff+@@ -336,8 +418,11 @@++ {/* Pagination info and controls */}+- <div className="flex items-center gap-3">+- <p className="text-sm text-muted-foreground">++ <div className="flex items-center gap-2 sm:gap-3">++ <p className="text-xs sm:text-sm text-muted-foreground hidden sm:block">+ {t("showing")} {(currentPage - 1) * pageSize + 1} - {Math.min(currentPage * pageSize, filteredData.length)} {t("of")} {filteredData.length}+ </p>++ <p className="text-xs text-muted-foreground sm:hidden">++ {(currentPage - 1) * pageSize + 1}-{Math.min(currentPage * pageSize, filteredData.length)} / {filteredData.length}++ </p>++ <div className="flex items-center gap-1">+```++**Chunk 13**+Lines added: 1, lines removed: 1++```diff+@@ -354,5 +439,5 @@+ {getPageNumbers().map((page, idx) => (+ page === '...' ? (+- <span key={`ellipsis-${idx}`} className="px-2 text-muted-foreground">...</span>++ <span key={`ellipsis-${idx}`} className="px-1 sm:px-2 text-muted-foreground text-xs">...</span>+ ) : (+ <Button+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="write">++<details><summary>Tool use: **write** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/ips-table.tsx</summary>++**Chunk 1**+Lines added: 3, lines removed: 3++```diff+@@ -115,9 +115,9 @@++ const SortIcon = ({ column }: { column: SortKey }) => {+- if (sortKey !== column) return <ArrowUpDown className="ml-2 h-3 w-3 text-muted-foreground" />;++ if (sortKey !== column) return <ArrowUpDown className="ml-1 h-3 w-3 text-muted-foreground" />;+ return sortOrder === "asc" ? (+- <ArrowUp className="ml-2 h-3 w-3 text-primary" />++ <ArrowUp className="ml-1 h-3 w-3 text-primary" />+ ) : (+- <ArrowDown className="ml-2 h-3 w-3 text-primary" />++ <ArrowDown className="ml-1 h-3 w-3 text-primary" />+ );+ };+```++**Chunk 2**+Lines added: 2, lines removed: 2++```diff+@@ -153,6 +153,6 @@+ <div className="glass-card rounded-2xl overflow-hidden">+ {/* Header */}+- <div className="p-5 border-b border-border/50">+- <div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">++ <div className="p-4 sm:p-5 border-b border-border/50">++ <div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3">+ <div>+ <h3 className="text-lg font-semibold">{t("title")}</h3>+```++**Chunk 3**+Lines added: 3, lines removed: 3++```diff+@@ -171,8 +171,8 @@+ </div>++- {/* Table Header */}+- <div className="grid grid-cols-12 gap-4 px-5 py-3 bg-secondary/30 text-xs font-medium text-muted-foreground uppercase tracking-wider">++ {/* Desktop Table Header */}++ <div className="hidden sm:grid grid-cols-12 gap-3 px-5 py-3 bg-secondary/30 text-xs font-medium text-muted-foreground uppercase tracking-wider">+ <div+- className="col-span-4 sm:col-span-3 flex items-center cursor-pointer hover:text-foreground transition-colors"++ className="col-span-3 flex items-center cursor-pointer hover:text-foreground transition-colors"+ onClick={() => handleSort("ip")}+ >+```++**Chunk 4**+Lines added: 1, lines removed: 1++```diff+@@ -184,5 +184,5 @@+ </div>+ <div+- className="col-span-3 sm:col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"++ className="col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"+ onClick={() => handleSort("totalDownload")}+ >+```++**Chunk 5**+Lines added: 34, lines removed: 2++```diff+@@ -191,14 +191,46 @@+ </div>+ <div+- className="col-span-3 sm:col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"++ className="col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"+ onClick={() => handleSort("totalUpload")}+ >+ {t("upload")}+ <SortIcon column="totalUpload" />+ </div>+- <div className="hidden sm:col-span-2 sm:flex items-center justify-end">++ <div className="col-span-1 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"++ onClick={() => handleSort("totalConnections")}++ >++ {t("connections")}++ <SortIcon column="totalConnections" />++ </div>++ <div className="col-span-2 flex items-center justify-end">+ {t("domainCount")}+ </div>+ </div>++++ {/* Mobile Sort Bar */}++ <div className="sm:hidden flex items-center gap-2 px-4 py-2 bg-secondary/30 overflow-x-auto">++ {([++ { key: "ip" as SortKey, label: t("ipAddress") },++ { key: "totalDownload" as SortKey, label: t("download") },++ { key: "totalUpload" as SortKey, label: t("upload") },++ { key: "totalConnections" as SortKey, label: t("connections") },++ ]).map(({ key, label }) => (++ <button++ key={key}++ className={cn(++ "flex items-center gap-0.5 px-2 py-1 rounded-md text-xs font-medium whitespace-nowrap transition-colors",++ sortKey === key++ ? "bg-primary/10 text-primary"++ : "text-muted-foreground hover:text-foreground"++ )}++ onClick={() => handleSort(key)}++ >++ {label}++ {sortKey === key && (++ sortOrder === "asc" ? <ArrowUp className="h-3 w-3" /> : <ArrowDown className="h-3 w-3" />++ )}++ </button>++ ))}++ </div>++ {/* Table Body */}+```++**Chunk 6**+Lines added: 2, lines removed: 2++```diff+@@ -215,8 +247,8 @@+ return (+ <div key={ip.ip} className="group">+- {/* Main Row */}++ {/* Desktop Row */}+ <div+ className={cn(+- "grid grid-cols-12 gap-4 px-5 py-4 items-center hover:bg-secondary/20 transition-colors cursor-pointer",++ "hidden sm:grid grid-cols-12 gap-3 px-5 py-4 items-center hover:bg-secondary/20 transition-colors cursor-pointer",+ isExpanded && "bg-secondary/10"+ )}+```++**Chunk 7**+Lines added: 1, lines removed: 1++```diff+@@ -225,5 +257,5 @@+ >+ {/* IP with Icon */}+- <div className="col-span-4 sm:col-span-3 flex items-center gap-3 min-w-0">++ <div className="col-span-3 flex items-center gap-3 min-w-0">+ <div className={`w-8 h-8 rounded-lg ${ipColor.bg} ${ipColor.text} flex items-center justify-center shrink-0`}>+ <Server className="w-4 h-4" />+```++**Chunk 8**+Lines added: 1, lines removed: 1++```diff+@@ -243,5 +275,5 @@+ {ip.geoIP && ip.geoIP.length > 0 ? (+ <div className="flex items-center gap-1.5">+- <Globe className="w-3 h-3 text-muted-foreground" />++ <Globe className="w-3 h-3 text-muted-foreground shrink-0" />+ <span className="text-xs truncate">{ip.geoIP[0]}</span>+ </div>+```++**Chunk 9**+Lines added: 10, lines removed: 3++```diff+@@ -252,15 +284,22 @@++ {/* Download */}+- <div className="col-span-3 sm:col-span-2 text-right tabular-nums text-sm">++ <div className="col-span-2 text-right tabular-nums text-sm">+ <span className="text-blue-500">{formatBytes(ip.totalDownload)}</span>+ </div>++ {/* Upload */}+- <div className="col-span-3 sm:col-span-2 text-right tabular-nums text-sm">++ <div className="col-span-2 text-right tabular-nums text-sm">+ <span className="text-purple-500">{formatBytes(ip.totalUpload)}</span>+ </div>++++ {/* Connections */}++ <div className="col-span-1 flex items-center justify-end">++ <span className="px-2 py-0.5 rounded-full bg-secondary text-xs font-medium">++ {ip.totalConnections}++ </span>++ </div>++ {/* Domains Count - Clickable */}+- <div className="hidden sm:col-span-2 sm:flex items-center justify-end">++ <div className="col-span-2 flex items-center justify-end">+ <Button+ variant="ghost"+```++**Chunk 10**+Lines added: 59, lines removed: 1++```diff+@@ -287,8 +326,66 @@+ </div>+ </div>++++ {/* Mobile Row - Card-style layout */}++ <div++ className={cn(++ "sm:hidden px-4 py-3 hover:bg-secondary/20 transition-colors cursor-pointer",++ isExpanded && "bg-secondary/10"++ )}++ onClick={() => toggleExpand(ip.ip)}++ >++ {/* Top: IP Icon + IP + Location + Expand */}++ <div className="flex items-center gap-2.5 mb-2">++ <div className={`w-7 h-7 rounded-lg ${ipColor.bg} ${ipColor.text} flex items-center justify-center shrink-0`}>++ <Server className="w-3.5 h-3.5" />++ </div>++ <div className="flex-1 min-w-0">++ <code className="text-sm font-medium truncate block">{ip.ip}</code>++ <div className="flex items-center gap-1.5 text-xs text-muted-foreground">++ {ip.geoIP && ip.geoIP.length > 0 ? (++ <>++ <Globe className="w-3 h-3 shrink-0" />++ <span className="truncate">{ip.geoIP[0]}</span>++ </>++ ) : ip.asn ? (++ <span className="truncate">{ip.asn}</span>++ ) : (++ <span>-</span>++ )}++ </div>++ </div>++ <Button++ variant="ghost"++ size="sm"++ className={cn(++ "h-7 px-2 gap-1 text-xs font-medium shrink-0",++ isExpanded++ ? "bg-primary/10 text-primary"++ : "bg-secondary/50 text-muted-foreground"++ )}++ onClick={(e) => {++ e.stopPropagation();++ toggleExpand(ip.ip);++ }}++ >++ <Link2 className="h-3 w-3" />++ {ip.domains.length}++ {isExpanded ? <ChevronUp className="h-3 w-3" /> : <ChevronDown className="h-3 w-3" />}++ </Button>++ </div>++++ {/* Bottom: Stats row */}++ <div className="flex items-center justify-between text-xs pl-[38px]">++ <span className="text-blue-500 tabular-nums">↓ {formatBytes(ip.totalDownload)}</span>++ <span className="text-purple-500 tabular-nums">↑ {formatBytes(ip.totalUpload)}</span>++ <span className="px-2 py-0.5 rounded-full bg-secondary text-muted-foreground font-medium">++ {ip.totalConnections} {t("connections")}++ </span>++ </div>++ </div>++ {/* Expanded Domains List */}+ {isExpanded && (+- <div className="px-5 pb-4 bg-secondary/5">++ <div className="px-4 sm:px-5 pb-4 bg-secondary/5">+ <div className="pt-2 pb-1 px-1">+ <p className="text-xs font-medium text-muted-foreground mb-2 flex items-center gap-1.5">+```++**Chunk 11**+Lines added: 4, lines removed: 4++```diff+@@ -302,10 +399,10 @@+ <div+ key={domain}+- className="flex items-center gap-2 px-3 py-2 rounded-lg bg-card border border-border/50 hover:border-primary/30 hover:shadow-sm transition-all"++ className="flex items-center gap-2 px-2.5 py-1.5 sm:px-3 sm:py-2 rounded-lg bg-card border border-border/50 hover:border-primary/30 hover:shadow-sm transition-all"+ >+- <div className={`w-6 h-6 rounded-md ${domainColor.bg} ${domainColor.text} flex items-center justify-center shrink-0`}>+- <Globe className="w-3 h-3" />++ <div className={`w-5 h-5 sm:w-6 sm:h-6 rounded-md ${domainColor.bg} ${domainColor.text} flex items-center justify-center shrink-0`}>++ <Globe className="w-2.5 h-2.5 sm:w-3 sm:h-3" />+ </div>+- <span className="text-xs font-medium truncate max-w-[200px]">{domain}</span>++ <span className="text-xs font-medium truncate max-w-[180px] sm:max-w-[200px]">{domain}</span>+ </div>+ );+```++**Chunk 12**+Lines added: 2, lines removed: 2++```diff+@@ -323,6 +420,6 @@+ {/* Pagination Footer */}+ {totalPages > 0 && (+- <div className="p-4 border-t border-border/50 bg-secondary/20">+- <div className="flex flex-col sm:flex-row items-center justify-between gap-4">++ <div className="p-3 sm:p-4 border-t border-border/50 bg-secondary/20">++ <div className="flex flex-col sm:flex-row items-center justify-between gap-3">+ {/* Page size selector */}+ <div className="flex items-center gap-2">+```++**Chunk 13**+Lines added: 5, lines removed: 2++```diff+@@ -352,8 +449,11 @@++ {/* Pagination info and controls */}+- <div className="flex items-center gap-3">+- <p className="text-sm text-muted-foreground">++ <div className="flex items-center gap-2 sm:gap-3">++ <p className="text-xs sm:text-sm text-muted-foreground hidden sm:block">+ {t("showing")} {(currentPage - 1) * pageSize + 1} - {Math.min(currentPage * pageSize, filteredData.length)} {t("of")} {filteredData.length}+ </p>++ <p className="text-xs text-muted-foreground sm:hidden">++ {(currentPage - 1) * pageSize + 1}-{Math.min(currentPage * pageSize, filteredData.length)} / {filteredData.length}++ </p>++ <div className="flex items-center gap-1">+```++**Chunk 14**+Lines added: 1, lines removed: 1++```diff+@@ -370,5 +470,5 @@+ {getPageNumbers().map((page, idx) => (+ page === '...' ? (+- <span key={`ellipsis-${idx}`} className="px-2 text-muted-foreground">...</span>++ <span key={`ellipsis-${idx}`} className="px-1 sm:px-2 text-muted-foreground text-xs">...</span>+ ) : (+ <Button+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="write">++<details><summary>Tool use: **write** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/rule-chain-chart.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: undefined++```diff+@@ -3,4 +3,5 @@+ import { useMemo } from "react";+ import { Network, ArrowRight } from "lucide-react";++ import { useTranslations } from "next-intl";+ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";+ import { formatBytes } from "@/lib/utils";+```++**Chunk 2**+Lines added: 2, lines removed: undefined++```diff+@@ -61,4 +62,6 @@++ export function RuleChainChart({ data }: RuleChainChartProps) {++ const t = useTranslations("rules");+++ const rules = useMemo(() => {+ if (!data) return [];+```++**Chunk 3**+Lines added: 2, lines removed: 2++```diff+@@ -82,8 +85,8 @@+ <CardTitle className="text-lg font-semibold flex items-center gap-2">+ <Network className="h-5 w-5 text-primary" />+- Rule Chain Distribution++ {t("distribution")}+ </CardTitle>+ <p className="text-sm text-muted-foreground mt-1">+- Traffic distribution by matching rules and their final proxy nodes++ {t("description")}+ </p>+ </CardHeader>+```++**Chunk 4**+Lines added: 29, lines removed: 20++```diff+@@ -99,32 +102,41 @@+ >+ {/* Top Row: Chain Flow + Traffic */}+- <div className="flex items-center gap-3">++ <div className="flex items-center gap-2 sm:gap-3">+ {/* Rule Icon */}+ <div+- className="w-9 h-9 rounded-lg flex items-center justify-center shrink-0"++ className="w-8 h-8 sm:w-9 sm:h-9 rounded-lg flex items-center justify-center shrink-0"+ style={{ backgroundColor: `${rule.color}15` }}+ >+- <span className="text-base">{rule.emoji}</span>++ <span className="text-sm sm:text-base">{rule.emoji}</span>+ </div>++- {/* Rule Name */}+- <div className="min-w-0 flex-1">+- <p className="font-medium text-sm truncate" title={rule.formattedRule}>+- {rule.formattedRule}+- </p>+- </div>+-+- {/* Arrow */}+- <ArrowRight className="w-4 h-4 text-muted-foreground shrink-0" />+-+- {/* Proxy */}+- <div className="min-w-0 flex-1">+- <p className="font-medium text-sm text-muted-foreground truncate" title={rule.formattedProxy}>+- {rule.formattedProxy}+- </p>+- </div>++ {/* Rule Name + Proxy (stacked on mobile) */}++ <div className="flex-1 min-w-0 hidden sm:flex items-center gap-3">++ <div className="min-w-0 flex-1">++ <p className="font-medium text-sm truncate" title={rule.formattedRule}>++ {rule.formattedRule}++ </p>++ </div>++ <ArrowRight className="w-4 h-4 text-muted-foreground shrink-0" />++ <div className="min-w-0 flex-1">++ <p className="font-medium text-sm text-muted-foreground truncate" title={rule.formattedProxy}>++ {rule.formattedProxy}++ </p>++ </div>++ </div>++++ {/* Mobile: stacked names */}++ <div className="flex-1 min-w-0 sm:hidden">++ <p className="font-medium text-sm truncate" title={rule.formattedRule}>++ {rule.formattedRule}++ </p>++ <p className="text-xs text-muted-foreground truncate flex items-center gap-1" title={rule.formattedProxy}>++ <ArrowRight className="w-3 h-3 shrink-0" />++ {rule.formattedProxy}++ </p>++ </div>++ {/* Traffic Stats */}+- <div className="text-right shrink-0 min-w-[100px]">++ <div className="text-right shrink-0 min-w-[70px] sm:min-w-[100px]">+ <p className="font-semibold text-sm tabular-nums">+ {formatBytes(rule.total)}+```++**Chunk 5**+Lines added: 1, lines removed: 1++```diff+@@ -137,5 +149,5 @@++ {/* Second Row: Progress Bar + Detailed Stats */}+- <div className="mt-3 flex items-center gap-4">++ <div className="mt-2 sm:mt-3 flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-4">+ {/* Progress Bar */}+ <div className="flex-1 h-1.5 bg-muted rounded-full overflow-hidden">+```++**Chunk 6**+Lines added: 2, lines removed: 2++```diff+@@ -147,6 +159,6 @@++ {/* Detailed Stats */}+- <div className="flex items-center gap-4 text-xs text-muted-foreground shrink-0">+- <span className="tabular-nums">{rule.totalConnections.toLocaleString()} conn</span>++ <div className="flex items-center gap-3 sm:gap-4 text-xs text-muted-foreground shrink-0">++ <span className="tabular-nums">{rule.totalConnections.toLocaleString()} {t("connections")}</span>+ <span className="tabular-nums text-blue-500">↓ {formatBytes(rule.totalDownload)}</span>+ <span className="tabular-nums text-purple-500">↑ {formatBytes(rule.totalUpload)}</span>+```++</details>++</tool-use>++---++<tool-use data-tool-type="task" data-tool-name="todo_write">+<details><summary>Tool use: **todo_write** • Todo List</summary>++- [x] Fix mobile responsiveness: domains-table, ips-table, rule-chain-chart+- [ ] Fix favicon distortion on mobile (add shrink-0)+- [ ] Fix untranslated text in proxy-stats-chart+- [x] Fix untranslated text in rule-chain-chart+- [ ] Fix untranslated text in country-traffic-chart+- [ ] Fix untranslated text in world-traffic-map+- [ ] Fix hardcoded text in country-top-list, proxy-top-list, etc.+- [ ] Fix hardcoded text in domain-top-list, domain-top-grid, proxy-top-grid+- [x] Update en.json and zh.json with all new translation keys+- [ ] Add About dialog with version and GitHub link++</details>+</tool-use>++---++Now let me fix the favicon, proxy-stats-chart, country-traffic-chart, and world-traffic-map in parallel:++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/favicon.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -75,5 +75,5 @@+ <div+ className={cn(+- "rounded-lg overflow-hidden bg-slate-800/50 flex items-center justify-center relative",++ "rounded-lg overflow-hidden bg-slate-800/50 flex items-center justify-center relative shrink-0",+ sizeMap[size],+ className+```++**Chunk 2**+Lines added: 1, lines removed: 1++```diff+@@ -92,5 +92,5 @@+ alt={cleanDomain}+ className={cn(+- "w-full h-full object-contain p-0.5",++ "w-full h-full object-cover p-0.5",+ loading ? "opacity-0" : "opacity-100"+ )}+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="write">++<details><summary>Tool use: **write** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-stats-chart.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: undefined++```diff+@@ -4,4 +4,5 @@+ import { PieChart, Pie, Cell, ResponsiveContainer, Tooltip } from "recharts";+ import { Server } from "lucide-react";++ import { useTranslations } from "next-intl";+ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";+ import { formatBytes } from "@/lib/utils";+```++**Chunk 2**+Lines added: 2, lines removed: undefined++```diff+@@ -27,4 +28,6 @@++ export function ProxyStatsChart({ data }: ProxyStatsChartProps) {++ const t = useTranslations("proxies");+++ const chartData = useMemo(() => {+ if (!data) return [];+```++**Chunk 3**+Lines added: 4, lines removed: 4++```diff+@@ -52,17 +55,17 @@+ <div className="space-y-1 text-xs">+ <div className="flex justify-between gap-4">+- <span className="text-muted-foreground">Total:</span>++ <span className="text-muted-foreground">{t("total")}:</span>+ <span className="font-medium">{formatBytes(item.value)}</span>+ </div>+ <div className="flex justify-between gap-4">+- <span className="text-blue-500">↓ Download:</span>++ <span className="text-blue-500">↓ {t("download")}:</span>+ <span>{formatBytes(item.download)}</span>+ </div>+ <div className="flex justify-between gap-4">+- <span className="text-purple-500">↑ Upload:</span>++ <span className="text-purple-500">↑ {t("upload")}:</span>+ <span>{formatBytes(item.upload)}</span>+ </div>+ <div className="flex justify-between gap-4">+- <span className="text-emerald-500">Connections:</span>++ <span className="text-emerald-500">{t("connections")}:</span>+ <span>{item.connections.toLocaleString()}</span>+ </div>+```++**Chunk 4**+Lines added: 1, lines removed: 1++```diff+@@ -79,5 +82,5 @@+ <CardTitle className="text-lg font-semibold flex items-center gap-2">+ <Server className="h-5 w-5 text-primary" />+- Proxy Traffic Distribution++ {t("distribution")}+ </CardTitle>+ </CardHeader>+```++**Chunk 5**+Lines added: 1, lines removed: 1++```diff+@@ -106,5 +109,5 @@++ {/* Proxy Cards Grid */}+- <div className="grid grid-cols-2 gap-3">++ <div className="grid grid-cols-1 sm:grid-cols-2 gap-3">+ {chartData.map((item) => {+ const percentage = totalTraffic > 0 ? (item.value / totalTraffic) * 100 : 0;+```++**Chunk 6**+Lines added: 1, lines removed: 1++```diff+@@ -158,5 +161,5 @@+ {/* Connections */}+ <p className="text-xs text-muted-foreground">+- {item.connections.toLocaleString()} connections++ {item.connections.toLocaleString()} {t("connections")}+ </p>+ </div>+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="write">++<details><summary>Tool use: **write** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/country-traffic-chart.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: undefined++```diff+@@ -4,4 +4,5 @@+ import { PieChart, Pie, Cell, ResponsiveContainer, Tooltip } from "recharts";+ import { Globe, MapPin } from "lucide-react";++ import { useTranslations } from "next-intl";+ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";+ import { formatBytes } from "@/lib/utils";+```++**Chunk 2**+Lines added: 3, lines removed: undefined++```diff+@@ -57,4 +58,7 @@++ export function CountryTrafficChart({ data }: CountryTrafficChartProps) {++ const t = useTranslations("countries");++ const mapT = useTranslations("map");+++ const chartData = useMemo(() => {+ if (!data) return [];+```++**Chunk 3**+Lines added: 4, lines removed: 4++```diff+@@ -87,17 +91,17 @@+ <div className="space-y-1 text-xs">+ <div className="flex justify-between gap-4">+- <span className="text-muted-foreground">Total:</span>++ <span className="text-muted-foreground">{mapT("total")}:</span>+ <span className="font-medium">{formatBytes(item.value)}</span>+ </div>+ <div className="flex justify-between gap-4">+- <span className="text-blue-500">↓ Download:</span>++ <span className="text-blue-500">↓ {mapT("download")}:</span>+ <span>{formatBytes(item.download)}</span>+ </div>+ <div className="flex justify-between gap-4">+- <span className="text-purple-500">↑ Upload:</span>++ <span className="text-purple-500">↑ {mapT("upload")}:</span>+ <span>{formatBytes(item.upload)}</span>+ </div>+ <div className="flex justify-between gap-4">+- <span className="text-emerald-500">Connections:</span>++ <span className="text-emerald-500">{mapT("connections")}:</span>+ <span>{item.connections.toLocaleString()}</span>+ </div>+```++**Chunk 4**+Lines added: 1, lines removed: 1++```diff+@@ -114,5 +118,5 @@+ <CardTitle className="text-lg font-semibold flex items-center gap-2">+ <Globe className="h-5 w-5 text-primary" />+- Country Traffic Distribution++ {t("distribution")}+ </CardTitle>+ </CardHeader>+```++**Chunk 5**+Lines added: 1, lines removed: 1++```diff+@@ -191,5 +195,5 @@+ <div className="flex items-center gap-1 text-xs text-muted-foreground">+ <MapPin className="w-3 h-3" />+- <span>{item.connections.toLocaleString()} conn</span>++ <span>{item.connections.toLocaleString()} {t("connections")}</span>+ </div>+ </div>+```++**Chunk 6**+Lines added: 1, lines removed: 1++```diff+@@ -201,5 +205,5 @@+ {/* Legend */}+ <div className="flex flex-wrap gap-3 text-xs text-muted-foreground pt-2 border-t border-border">+- <span className="font-medium">大洲:</span>++ <span className="font-medium">{t("continents")}</span>+ {Object.entries(CONTINENT_COLORS)+ .filter(([key]) => key !== "Unknown" && key !== "LOCAL")+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="write">++<details><summary>Tool use: **write** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/world-traffic-map.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: undefined++```diff+@@ -10,4 +10,5 @@+ import { scaleLinear } from "d3-scale";+ import { Globe, Info } from "lucide-react";++ import { useTranslations } from "next-intl";+ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";+ import { formatBytes } from "@/lib/utils";+```++**Chunk 2**+Lines added: 1, lines removed: undefined++```diff+@@ -47,4 +48,5 @@++ export function WorldTrafficMap({ data }: WorldTrafficMapProps) {++ const t = useTranslations("map");+ const [hoveredCountry, setHoveredCountry] = useState<string | null>(null);+ const [tooltipData, setTooltipData] = useState<{+```++**Chunk 3**+Lines added: 1, lines removed: 1++```diff+@@ -158,5 +160,5 @@+ <CardTitle className="text-lg font-semibold flex items-center gap-2">+ <Globe className="h-5 w-5 text-primary" />+- Global Traffic Distribution++ {t("title")}+ </CardTitle>+ </CardHeader>+```++**Chunk 4**+Lines added: 4, lines removed: 4++```diff+@@ -225,19 +227,19 @@+ <div className="space-y-1 text-xs">+ <div className="flex justify-between">+- <span className="text-muted-foreground">Total:</span>++ <span className="text-muted-foreground">{t("total")}:</span>+ <span className="font-medium">+ {formatBytes(tooltipData.traffic)}+ </span>+ </div>+ <div className="flex justify-between">+- <span className="text-blue-500">↓ Download:</span>++ <span className="text-blue-500">↓ {t("download")}:</span>+ <span>{formatBytes(tooltipData.download)}</span>+ </div>+ <div className="flex justify-between">+- <span className="text-purple-500">↑ Upload:</span>++ <span className="text-purple-500">↑ {t("upload")}:</span>+ <span>{formatBytes(tooltipData.upload)}</span>+ </div>+ <div className="flex justify-between">+- <span className="text-emerald-500">Connections:</span>++ <span className="text-emerald-500">{t("connections")}:</span>+ <span>{tooltipData.connections.toLocaleString()}</span>+ </div>+```++**Chunk 5**+Lines added: 1, lines removed: 1++```diff+@@ -250,5 +252,5 @@+ <div className="absolute bottom-2 left-2 flex items-center gap-1 text-xs text-muted-foreground bg-background/80 px-2 py-1 rounded">+ <Info className="w-3 h-3" />+- <span>Hover over countries for details</span>++ <span>{t("hoverHint")}</span>+ </div>+ </div>+```++**Chunk 6**+Lines added: 2, lines removed: 2++```diff+@@ -258,7 +260,7 @@+ {/* Color scale legend */}+ <div className="flex items-center gap-2">+- <span className="text-xs text-muted-foreground">Traffic:</span>++ <span className="text-xs text-muted-foreground">{t("traffic")}</span>+ <div className="flex items-center gap-1">+- <span className="text-xs">Low</span>++ <span className="text-xs">{t("low")}</span>+ <div className="flex">+ <div+```++**Chunk 7**+Lines added: 1, lines removed: 1++```diff+@@ -279,5 +281,5 @@+ />+ </div>+- <span className="text-xs">High</span>++ <span className="text-xs">{t("high")}</span>+ </div>+ </div>+```++</details>++</tool-use>++---++<tool-use data-tool-type="task" data-tool-name="todo_write">+<details><summary>Tool use: **todo_write** • Todo List</summary>++- [x] Fix mobile responsiveness: domains-table, ips-table, rule-chain-chart+- [x] Fix favicon distortion on mobile (add shrink-0)+- [x] Fix untranslated text in proxy-stats-chart+- [x] Fix untranslated text in rule-chain-chart+- [x] Fix untranslated text in country-traffic-chart+- [x] Fix untranslated text in world-traffic-map+- [-] Fix hardcoded text in country-top-list, proxy-top-list, etc.+- [-] Fix hardcoded text in domain-top-list, domain-top-grid, proxy-top-grid+- [x] Update en.json and zh.json with all new translation keys+- [ ] Add About dialog with version and GitHub link++</details>+</tool-use>++---++Now let me fix all the remaining hardcoded text in the overview components. I need to update multiple files in parallel:++---++<tool-use data-tool-type="write" data-tool-name="write">++<details><summary>Tool use: **write** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/country-top-list.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: undefined++```diff+@@ -3,4 +3,5 @@+ import { useMemo } from "react";+ import { MapPin } from "lucide-react";++ import { useTranslations } from "next-intl";+ import { OverviewCard } from "./overview-card";+ import { TopListItem } from "./top-list-item";+```++**Chunk 2**+Lines added: 3, lines removed: undefined++```diff+@@ -37,4 +38,7 @@++ export function CountryTopList({ data, limit = 7, onViewAll }: CountryTopListProps) {++ const t = useTranslations("topCountries");++ const countriesT = useTranslations("countries");+++ const { countries, totalTraffic } = useMemo(() => {+ if (!data) return { countries: [], totalTraffic: 0 };+```++**Chunk 3**+Lines added: 2, lines removed: 2++```diff+@@ -54,7 +58,7 @@+ if (countries.length === 0) {+ return (+- <OverviewCard title="Top 国家/地区" icon={<MapPin className="w-4 h-4" />}>++ <OverviewCard title={t("title")} icon={<MapPin className="w-4 h-4" />}>+ <div className="py-8 text-center text-sm text-muted-foreground">+- 暂无数据++ {countriesT("noData")}+ </div>+ </OverviewCard>+```++**Chunk 4**+Lines added: 2, lines removed: 2++```diff+@@ -64,10 +68,10 @@+ return (+ <OverviewCard+- title="Top 国家/地区"++ title={t("title")}+ icon={<MapPin className="w-4 h-4" />}+ footer={+ onViewAll && (+ <Button variant="ghost" size="sm" className="w-full h-9 text-xs" onClick={onViewAll}>+- 查看全部++ {t("viewAll")}+ </Button>+ )+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="write">++<details><summary>Tool use: **write** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-top-list.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: undefined++```diff+@@ -3,4 +3,5 @@+ import { useMemo, useState } from "react";+ import { Server, Users, ArrowUpDown } from "lucide-react";++ import { useTranslations } from "next-intl";+ import { OverviewCard } from "./overview-card";+ import { TopListItem } from "./top-list-item";+```++**Chunk 2**+Lines added: 2, lines removed: undefined++```diff+@@ -44,4 +45,6 @@+ export function ProxyTopList({ data, limit = 5, onViewAll }: ProxyTopListProps) {+ const [sortBy, setSortBy] = useState<SortBy>("traffic");++ const t = useTranslations("topProxies");++ const proxiesT = useTranslations("proxies");++ const { proxies, totalTraffic, totalConnections } = useMemo(() => {+```++**Chunk 3**+Lines added: 2, lines removed: 2++```diff+@@ -77,7 +80,7 @@+ if (proxies.length === 0) {+ return (+- <OverviewCard title="Top 代理" icon={<Server className="w-4 h-4" />}>++ <OverviewCard title={t("title")} icon={<Server className="w-4 h-4" />}>+ <div className="py-8 text-center text-sm text-muted-foreground">+- 暂无数据++ {proxiesT("noData")}+ </div>+ </OverviewCard>+```++**Chunk 4**+Lines added: 1, lines removed: 1++```diff+@@ -87,5 +90,5 @@+ return (+ <OverviewCard+- title="Top 代理"++ title={t("title")}+ icon={<Server className="w-4 h-4" />}+ action={+```++**Chunk 5**+Lines added: 2, lines removed: 2++```diff+@@ -97,7 +100,7 @@+ >+ {sortBy === "traffic" ? (+- <><ArrowUpDown className="w-3 h-3 mr-1" /> 按流量</>++ <><ArrowUpDown className="w-3 h-3 mr-1" /> {t("sortByTraffic")}</>+ ) : (+- <><Users className="w-3 h-3 mr-1" /> 按连接</>++ <><Users className="w-3 h-3 mr-1" /> {t("sortByConnections")}</>+ )}+ </Button>+```++**Chunk 6**+Lines added: 1, lines removed: 1++```diff+@@ -106,5 +109,5 @@+ onViewAll && (+ <Button variant="ghost" size="sm" className="w-full h-9 text-xs" onClick={onViewAll}>+- 查看全部++ {t("viewAll")}+ </Button>+ )+```++**Chunk 7**+Lines added: 1, lines removed: 1++```diff+@@ -119,5 +122,5 @@+ title={proxy.displayName}+ subtitle={sortBy === "traffic"+- ? `${proxy.totalConnections} 连接`++ ? `${proxy.totalConnections} ${proxiesT("connections")}`+ : `${formatBytes(proxy.total)}`+ }+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="write">++<details><summary>Tool use: **write** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-top-grid.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: undefined++```diff+@@ -3,4 +3,5 @@+ import { useMemo, useState } from "react";+ import { Server, Users, ArrowUpDown, ArrowRight } from "lucide-react";++ import { useTranslations } from "next-intl";+ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";+ import { Button } from "@/components/ui/button";+```++**Chunk 2**+Lines added: 2, lines removed: undefined++```diff+@@ -42,4 +43,6 @@+ export function ProxyTopGrid({ data, limit = 5, onViewAll }: ProxyTopGridProps) {+ const [sortBy, setSortBy] = useState<SortBy>("traffic");++ const t = useTranslations("topProxies");++ const proxiesT = useTranslations("proxies");++ const proxies = useMemo(() => {+```++**Chunk 3**+Lines added: 1, lines removed: 1++```diff+@@ -70,5 +73,5 @@+ <CardTitle className="text-sm font-semibold text-muted-foreground uppercase tracking-wider flex items-center gap-2">+ <Server className="w-4 h-4" />+- Top 代理++ {t("title")}+ </CardTitle>+ <Button+```++**Chunk 4**+Lines added: 2, lines removed: 2++```diff+@@ -79,7 +82,7 @@+ >+ {sortBy === "traffic" ? (+- <><ArrowUpDown className="w-3 h-3 mr-1" /> 流量</>++ <><ArrowUpDown className="w-3 h-3 mr-1" /> {proxiesT("sortByTraffic")}</>+ ) : (+- <><Users className="w-3 h-3 mr-1" /> 连接</>++ <><Users className="w-3 h-3 mr-1" /> {proxiesT("sortByConnections")}</>+ )}+ </Button>+```++**Chunk 5**+Lines added: 1, lines removed: 1++```diff+@@ -142,5 +145,5 @@+ <div className="mt-4 pt-3 border-t border-border/30">+ <Button variant="ghost" size="sm" className="w-full h-9 text-xs" onClick={onViewAll}>+- 查看全部++ {proxiesT("viewAll")}+ <ArrowRight className="w-3 h-3 ml-1" />+ </Button>+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="write">++<details><summary>Tool use: **write** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/domain-top-list.tsx</summary>++**Chunk 1**+Lines added: 2, lines removed: undefined++```diff+@@ -3,7 +3,9 @@+ import { useMemo, useState } from "react";+ import { Globe, Users, ArrowUpDown } from "lucide-react";++ import { useTranslations } from "next-intl";+ import { OverviewCard } from "./overview-card";+ import { TopListItem } from "./top-list-item";+ import { Button } from "@/components/ui/button";++ import { formatBytes } from "@/lib/utils";+ import type { DomainStats } from "@clashstats/shared";++```++**Chunk 2**+Lines added: 2, lines removed: undefined++```diff+@@ -31,4 +33,6 @@+ export function DomainTopList({ data, limit = 7, onViewAll }: DomainTopListProps) {+ const [sortBy, setSortBy] = useState<SortBy>("traffic");++ const t = useTranslations("topDomains");++ const proxiesT = useTranslations("proxies");++ const { domains, totalTraffic, totalConnections } = useMemo(() => {+```++**Chunk 3**+Lines added: 2, lines removed: 2++```diff+@@ -63,7 +67,7 @@+ if (domains.length === 0) {+ return (+- <OverviewCard title="Top 域名" icon={<Globe className="w-4 h-4" />}>++ <OverviewCard title={t("title")} icon={<Globe className="w-4 h-4" />}>+ <div className="py-8 text-center text-sm text-muted-foreground">+- 暂无数据++ {proxiesT("noData")}+ </div>+ </OverviewCard>+```++**Chunk 4**+Lines added: 1, lines removed: 1++```diff+@@ -73,5 +77,5 @@+ return (+ <OverviewCard+- title="Top 域名"++ title={t("title")}+ icon={<Globe className="w-4 h-4" />}+ action={+```++**Chunk 5**+Lines added: 2, lines removed: 2++```diff+@@ -83,7 +87,7 @@+ >+ {sortBy === "traffic" ? (+- <><ArrowUpDown className="w-3 h-3 mr-1" /> 按流量</>++ <><ArrowUpDown className="w-3 h-3 mr-1" /> {t("sortByTraffic")}</>+ ) : (+- <><Users className="w-3 h-3 mr-1" /> 按连接</>++ <><Users className="w-3 h-3 mr-1" /> {t("sortByConnections")}</>+ )}+ </Button>+```++**Chunk 6**+Lines added: 1, lines removed: 1++```diff+@@ -92,5 +96,5 @@+ onViewAll && (+ <Button variant="ghost" size="sm" className="w-full h-9 text-xs" onClick={onViewAll}>+- 查看全部++ {t("viewAll")}+ </Button>+ )+```++**Chunk 7**+Lines added: 1, lines removed: 1++```diff+@@ -116,5 +120,5 @@+ title={domain.domain}+ subtitle={sortBy === "traffic"+- ? `${domain.totalConnections} 连接`++ ? `${domain.totalConnections} ${t("connections")}`+ : `${formatBytes(domain.total)}`+ }+```++**Chunk 8**+Lines added: undefined, lines removed: 2++```diff+@@ -129,5 +133,3 @@+ );+ }+-+- import { formatBytes } from "@/lib/utils";++```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="write">++<details><summary>Tool use: **write** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/domain-top-grid.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: undefined++```diff+@@ -3,4 +3,5 @@+ import { useMemo, useState } from "react";+ import { Globe, Users, ArrowUpDown, ArrowRight } from "lucide-react";++ import { useTranslations } from "next-intl";+ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";+ import { Button } from "@/components/ui/button";+```++**Chunk 2**+Lines added: 2, lines removed: undefined++```diff+@@ -26,4 +27,6 @@+ export function DomainTopGrid({ data, limit = 5, onViewAll }: DomainTopGridProps) {+ const [sortBy, setSortBy] = useState<SortBy>("traffic");++ const t = useTranslations("topDomains");++ const proxiesT = useTranslations("proxies");++ const domains = useMemo(() => {+```++**Chunk 3**+Lines added: 3, lines removed: 3++```diff+@@ -50,11 +53,11 @@+ <CardTitle className="text-sm font-semibold text-muted-foreground uppercase tracking-wider flex items-center gap-2">+ <Globe className="w-4 h-4" />+- Top 域名++ {t("title")}+ </CardTitle>+ <Button variant="ghost" size="sm" className="h-7 px-2 text-xs" onClick={toggleSort}>+ {sortBy === "traffic" ? (+- <><ArrowUpDown className="w-3 h-3 mr-1" /> 流量</>++ <><ArrowUpDown className="w-3 h-3 mr-1" /> {proxiesT("sortByTraffic")}</>+ ) : (+- <><Users className="w-3 h-3 mr-1" /> 连接</>++ <><Users className="w-3 h-3 mr-1" /> {proxiesT("sortByConnections")}</>+ )}+ </Button>+```++**Chunk 4**+Lines added: 1, lines removed: 1++```diff+@@ -118,5 +121,5 @@+ <div className="mt-4 pt-3 border-t border-border/30">+ <Button variant="ghost" size="sm" className="w-full h-9 text-xs" onClick={onViewAll}>+- 查看全部++ {proxiesT("viewAll")}+ <ArrowRight className="w-3 h-3 ml-1" />+ </Button>+```++</details>++</tool-use>++---++<tool-use data-tool-type="task" data-tool-name="todo_write">+<details><summary>Tool use: **todo_write** • Todo List</summary>++- [x] Fix mobile responsiveness: domains-table, ips-table, rule-chain-chart+- [x] Fix favicon distortion on mobile (add shrink-0)+- [x] Fix untranslated text in proxy-stats-chart+- [x] Fix untranslated text in rule-chain-chart+- [x] Fix untranslated text in country-traffic-chart+- [x] Fix untranslated text in world-traffic-map+- [x] Fix hardcoded text in country-top-list, proxy-top-list, etc.+- [x] Fix hardcoded text in domain-top-list, domain-top-grid, proxy-top-grid+- [x] Update en.json and zh.json with all new translation keys+- [-] Add About dialog with version and GitHub link++</details>+</tool-use>++---++Now let me add the "About" dialog. I'll add it to the navigation component:++---++<tool-use data-tool-type="write" data-tool-name="write">++<details><summary>Tool use: **write** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++**Chunk 1**+Lines added: 11, lines removed: undefined++```diff+@@ -14,13 +14,24 @@+ Menu,+ X,++ Info,++ ExternalLink,+ } from "lucide-react";+ import { cn } from "@/lib/utils";+ import { Button } from "@/components/ui/button";+ import { BackendConfigDialog } from "./backend-config-dialog";++ import {++ Dialog,++ DialogContent,++ DialogHeader,++ DialogTitle,++ } from "@/components/ui/dialog";++ interface NavigationProps {+ activeTab: string;+ onTabChange: (tab: string) => void;+ }++++ const APP_VERSION = "1.0.0";++ const GITHUB_URL = "https://github.com/foru17/clash-master";++ const NAV_ITEMS = [+```++**Chunk 2**+Lines added: 2, lines removed: undefined++```diff+@@ -36,7 +47,9 @@+ const [mobileMenuOpen, setMobileMenuOpen] = useState(false);+ const [settingsOpen, setSettingsOpen] = useState(false);++ const [aboutOpen, setAboutOpen] = useState(false);+ const t = useTranslations("nav");+ const headerT = useTranslations("header");+ const backendT = useTranslations("backend");++ const aboutT = useTranslations("about");++ return (+```++**Chunk 3**+Lines added: 11, lines removed: 1++```diff+@@ -85,5 +98,15 @@++ {/* Bottom Actions */}+- <div className="p-4 border-t border-border/40">++ <div className="p-4 border-t border-border/40 space-y-1">++ <button++ onClick={() => setAboutOpen(true)}++ className={cn(++ "w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium transition-all",++ "text-muted-foreground hover:bg-secondary hover:text-foreground"++ )}++ >++ <Info className="w-5 h-5" />++ {aboutT("title")}++ </button>+ <button+ onClick={() => setSettingsOpen(true)}+```++**Chunk 4**+Lines added: 65, lines removed: undefined++```diff+@@ -192,4 +215,69 @@+ isFirstTime={false}+ />++++ {/* About Dialog */}++ <Dialog open={aboutOpen} onOpenChange={setAboutOpen}>++ <DialogContent className="sm:max-w-[420px]">++ <DialogHeader>++ <DialogTitle className="flex items-center gap-2">++ <Info className="w-5 h-5 text-primary" />++ {aboutT("title")}++ </DialogTitle>++ </DialogHeader>++ <div className="space-y-6 py-4">++ {/* App Info */}++ <div className="flex items-center gap-4">++ <div className="w-16 h-16 rounded-2xl bg-primary/10 flex items-center justify-center overflow-hidden shrink-0">++ <Image++ src="/clash-master.png"++ alt="Clash Master"++ width={64}++ height={64}++ className="w-full h-full object-cover"++ />++ </div>++ <div>++ <h3 className="text-xl font-bold">{aboutT("projectName")}</h3>++ <p className="text-sm text-muted-foreground mt-1">++ {aboutT("description")}++ </p>++ </div>++ </div>++++ {/* Version */}++ <div className="flex items-center justify-between p-3 rounded-xl bg-secondary/50 border border-border/50">++ <span className="text-sm font-medium">{aboutT("version")}</span>++ <span className="text-sm font-mono tabular-nums text-primary font-semibold">++ v{APP_VERSION}++ </span>++ </div>++++ {/* License */}++ <div className="flex items-center justify-between p-3 rounded-xl bg-secondary/50 border border-border/50">++ <span className="text-sm font-medium">{aboutT("license")}</span>++ <span className="text-sm text-muted-foreground">MIT</span>++ </div>++++ {/* GitHub Link */}++ <a++ href={GITHUB_URL}++ target="_blank"++ rel="noopener noreferrer"++ className="flex items-center justify-between p-3 rounded-xl bg-secondary/50 border border-border/50 hover:bg-secondary/80 hover:border-primary/30 transition-all group"++ >++ <div className="flex items-center gap-3">++ <svg viewBox="0 0 24 24" className="w-5 h-5 fill-foreground" aria-hidden="true">++ <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />++ </svg>++ <div>++ <p className="text-sm font-medium">{aboutT("openSource")}</p>++ <p className="text-xs text-muted-foreground">{GITHUB_URL}</p>++ </div>++ </div>++ <ExternalLink className="w-4 h-4 text-muted-foreground group-hover:text-primary transition-colors" />++ </a>++ </div>++ </DialogContent>++ </Dialog>+ </>+ );+```++</details>++</tool-use>++---++<tool-use data-tool-type="task" data-tool-name="todo_write">+<details><summary>Tool use: **todo_write** • Todo List</summary>++- [x] Fix mobile responsiveness: domains-table, ips-table, rule-chain-chart+- [x] Fix favicon distortion on mobile (add shrink-0)+- [x] Fix untranslated text in proxy-stats-chart+- [x] Fix untranslated text in rule-chain-chart+- [x] Fix untranslated text in country-traffic-chart+- [x] Fix untranslated text in world-traffic-map+- [x] Fix hardcoded text in country-top-list, proxy-top-list, etc.+- [x] Fix hardcoded text in domain-top-list, domain-top-grid, proxy-top-grid+- [x] Update en.json and zh.json with all new translation keys+- [x] Add About dialog with version and GitHub link++</details>+</tool-use>++---++Now let me check if there are any lint errors in the modified files:++---++<tool-use data-tool-type="generic" data-tool-name="read_lints">+<details>+ <summary>Tool use: **read_lints** • Read lints for 13 files</summary>++Lint paths:++- `/Users/luolei/DEV/clash-master/apps/web/components/domains-table.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/ips-table.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/rule-chain-chart.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/proxy-stats-chart.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/country-traffic-chart.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/world-traffic-map.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/country-top-list.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/proxy-top-list.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/domain-top-list.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/domain-top-grid.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/proxy-top-grid.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/favicon.tsx`++Lint results+++**No lint errors found**+</details>+</tool-use>++---++No lint errors. Let me also quickly verify the `top-countries-simple.tsx` component which has hardcoded English country names that should ideally respect i18n, and check the `country-traffic-list.tsx` too:++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/overview/top-countries-simple.tsx</summary>++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+The `top-countries-simple.tsx` has hardcoded English country names. This is actually from the overview page's country list, and the country names should be localized. However, this is a bigger task because the country names come from a static mapping here. The actual country names from the API (`countryName` field) are probably English.++For this component, the `getCountryName` function uses a hardcoded English mapping. I should add Chinese country names and use the locale to decide. But this is more complex. Let me check if the data from the backend already provides country names... Let me look at what the countryName field provides.++I'm seeing that the API's `countryName` field already provides localized names in some cases, and other components like `country-traffic-list.tsx` fall back to using `country.countryName || country.country`. So I should update `top-countries-simple.tsx` to use the API's country name directly instead of the local mapping, and add Chinese translations to the language files for any remaining hardcoded strings. The user's main issue seems to be English text appearing in the "国家", "代理", "规则" panels that should be localized. I've already covered the main UI text translations, so now I'm focusing on the country names in the top countries component. Since the user specifically mentioned the country panel, adding Chinese country name mappings would complete the localization work.</details></think>++---++The `top-countries-simple.tsx` component has hardcoded English country names. Let me add Chinese country name support:++---++<tool-use data-tool-type="write" data-tool-name="write">++<details><summary>Tool use: **write** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/overview/top-countries-simple.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -3,5 +3,5 @@+ import React, { useMemo } from "react";+ import { Globe, ArrowRight } from "lucide-react";+- import { useTranslations } from "next-intl";++ import { useTranslations, useLocale } from "next-intl";+ import { Button } from "@/components/ui/button";+ import { formatBytes, cn } from "@/lib/utils";+```++**Chunk 2**+Lines added: 1, lines removed: 1++```diff+@@ -34,5 +34,5 @@+ };++- const countryNames: Record<string, string> = {++ const countryNamesEn: Record<string, string> = {+ "CN": "China", "US": "United States", "JP": "Japan", "HK": "Hong Kong", "TW": "Taiwan",+ "SG": "Singapore", "KR": "South Korea", "DE": "Germany", "GB": "United Kingdom", "FR": "France",+```++**Chunk 3**+Lines added: 14, lines removed: 2++```diff+@@ -44,11 +44,23 @@+ "LOCAL": "Local", "UNKNOWN": "Unknown", "PRIVATE": "Private",+ };++++ const countryNamesZh: Record<string, string> = {++ "CN": "中国", "US": "美国", "JP": "日本", "HK": "中国香港", "TW": "中国台湾",++ "SG": "新加坡", "KR": "韩国", "DE": "德国", "GB": "英国", "FR": "法国",++ "NL": "荷兰", "CA": "加拿大", "AU": "澳大利亚", "IN": "印度", "RU": "俄罗斯",++ "BR": "巴西", "TR": "土耳其", "VN": "越南", "TH": "泰国", "ID": "印度尼西亚",++ "MY": "马来西亚", "PH": "菲律宾", "SE": "瑞典", "CH": "瑞士", "IT": "意大利",++ "ES": "西班牙", "PT": "葡萄牙", "PL": "波兰", "UA": "乌克兰", "MX": "墨西哥",++ "AR": "阿根廷", "CL": "智利", "ZA": "南非", "AE": "阿联酋", "SA": "沙特阿拉伯",++ "LOCAL": "本地", "UNKNOWN": "未知", "PRIVATE": "私有",++ };++ function getCountryFlag(countryCode: string): string {+ return countryFlags[countryCode.toUpperCase()] || "🌐";+ }++- function getCountryName(code: string): string {+- return countryNames[code.toUpperCase()] || code;++ function getCountryName(code: string, locale: string): string {++ const names = locale === "zh" ? countryNamesZh : countryNamesEn;++ return names[code.toUpperCase()] || code;+ }++```++**Chunk 4**+Lines added: 1, lines removed: undefined++```diff+@@ -57,4 +69,5 @@+ }: TopCountriesSimpleProps) {+ const t = useTranslations("topCountries");++ const locale = useLocale();++ const sortedCountries = useMemo(() => {+```++**Chunk 5**+Lines added: 1, lines removed: 1++```diff+@@ -108,5 +121,5 @@+ <span className="text-base shrink-0">{getCountryFlag(country.country)}</span>+ <span className="flex-1 text-sm font-medium">+- {getCountryName(country.country)}++ {getCountryName(country.country, locale)}+ </span>+ <span className="text-sm font-bold tabular-nums shrink-0">+```++</details>++</tool-use>++---++Now let me verify the build compiles correctly:++---++<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">+<details><summary>Tool use: **run_terminal_cmd** • Run command: cd /Users/luolei/DEV/clash-master/apps/web && npx tsc --noEmit 2>&1 | head -60</summary>++```bash+cd /Users/luolei/DEV/clash-master/apps/web && npx tsc --noEmit 2>&1 | head -60+```++```+npm error code EPERM+npm error syscall open+npm error path /Users/luolei/.nvm/versions/node/v22.14.0/lib/node_modules/npm/node_modules/@sigstore/verify/dist/key/index.js+npm error errno -1+npm error Error: EPERM: operation not permitted, open '/Users/luolei/.nvm/versions/node/v22.14.0/lib/node_modules/npm/node_modules/@sigstore/verify/dist/key/index.js'+npm error at Object.readFileSync (node:fs:442:20)+npm error at loadSource (node:internal/modules/cjs/loader:1581:17)+npm error at Object..js (node:internal/modules/cjs/loader:1700:44)+npm error at Module.load (node:internal/modules/cjs/loader:1289:32)+npm error at Function._load (node:internal/modules/cjs/loader:1108:12)+npm error at TracingChannel.traceSync (node:diagnostics_channel:322:14)+npm error at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)+npm error at Module.require (node:internal/modules/cjs/loader:1311:12)+npm error at require (node:internal/modules/helpers:136:16)+npm error at Object.<anonymous> (/Users/luolei/.nvm/versions/node/v22.14.0/lib/node_modules/npm/node_modules/@sigstore/verify/dist/verifier.js:21:15) {+npm error errno: -1,+npm error code: 'EPERM',+npm error syscall: 'open',+npm error path: '/Users/luolei/.nvm/versions/node/v22.14.0/lib/node_modules/npm/node_modules/@sigstore/verify/dist/key/index.js'+npm error }+npm error+npm error The operation was rejected by your operating system.+npm error It is likely you do not have the permissions to access this file as the current user+npm error+npm error If you believe this might be a permissions issue, please double-check the+npm error permissions of the file and its containing directories, or try running+npm error the command again as root/Administrator.+npm error Log files were not written due to an error writing to the directory: /Users/luolei/.npm/_logs+npm error You can rerun the command with `--loglevel=verbose` to see the logs in your terminal++```+</details>+</tool-use>++---++<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">+<details><summary>Tool use: **run_terminal_cmd** • Run command: cd /Users/luolei/DEV/clash-master/apps/web && npx tsc --noEmit 2>&1 | head -60</summary>++```bash+cd /Users/luolei/DEV/clash-master/apps/web && npx tsc --noEmit 2>&1 | head -60+```++```++[41m [0m+[41m[37m This is not the tsc command you are looking for [0m+[41m [0m++To get access to the TypeScript compiler, [34mtsc[0m, from the command line either:++- Use [1mnpm install typescript[0m to first add TypeScript to your project [1mbefore[0m using npx+- Use [1myarn[0m to avoid accidentally running code from un-installed packages++```+</details>+</tool-use>++---++<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">+<details><summary>Tool use: **run_terminal_cmd** • Run command: cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -40</summary>++```bash+cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -40+```+</details>+</tool-use>++---++TypeScript 编译通过,没有错误。让我再做最后的检查确认所有修改文件没有 lint 问题:++---++<tool-use data-tool-type="generic" data-tool-name="read_lints">+<details>+ <summary>Tool use: **read_lints** • Read lints for 3 files</summary>++Lint paths:++- `/Users/luolei/DEV/clash-master/apps/web/components/overview/top-countries-simple.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/messages/en.json`+- `/Users/luolei/DEV/clash-master/apps/web/messages/zh.json`++Lint results+++**No lint errors found**+</details>+</tool-use>++---++所有修改完成,没有 lint 错误,TypeScript 编译通过。下面是我所做的所有修改的总结:++---++## 修改总结++### 1. 移动端适配优化++**`domains-table.tsx`** - 域名列表:+- 桌面端和移动端使用完全不同的布局:桌面端保持原有的 `grid-cols-12` 表格布局,移动端改为卡片式布局+- 移动端:域名 + Favicon + 展开按钮在第一行,下载/上传/连接数在第二行水平排列+- 移动端添加了独立的排序栏(可滑动的按钮组)替代表头的排序+- 分页器在移动端更紧凑++**`ips-table.tsx`** - IP 地址表:+- 同样采用桌面/移动端分离布局+- 移动端卡片布局:IP + 图标 + 位置在第一行,流量统计在第二行+- 展开的关联域名区域在小屏幕上更紧凑++**`rule-chain-chart.tsx`** - 规则链路图:+- 规则名称和代理名称在桌面端横向排列(Rule → Proxy)+- 移动端改为纵向堆叠,规则名在上,代理名在下+- 统计数据行在移动端改为 flex-col 布局++### 2. Favicon 修复++**`favicon.tsx`**:+- 容器添加 `shrink-0` 防止在 flex 布局中被压缩变形+- 图片改用 `object-cover` 替代 `object-contain`,避免背景图变形++### 3. 国际化翻译修复++以下组件的硬编码文本全部改为使用 `useTranslations`:++| 组件 | 修复的文本 |+|---|---|+| `proxy-stats-chart.tsx` | "Proxy Traffic Distribution"、Tooltip 标签 |+| `rule-chain-chart.tsx` | "Rule Chain Distribution"、描述文本、"conn" |+| `country-traffic-chart.tsx` | "Country Traffic Distribution"、Tooltip 标签、"大洲:" |+| `world-traffic-map.tsx` | "Global Traffic Distribution"、Tooltip、"Hover..."、图例文字 |+| `country-top-list.tsx` | "Top 国家/地区"、"暂无数据"、"查看全部" |+| `proxy-top-list.tsx` | "Top 代理"、"按流量"/"按连接"、"暂无数据"、"查看全部" |+| `proxy-top-grid.tsx` | "Top 代理"、"流量"/"连接"、"查看全部" |+| `domain-top-list.tsx` | "Top 域名"、"按流量"/"按连接"、"暂无数据"、"查看全部" |+| `domain-top-grid.tsx` | "Top 域名"、"流量"/"连接"、"查看全部" |+| `top-countries-simple.tsx` | 国家名称支持中英文切换 |++**翻译文件更新**(`en.json` + `zh.json`):+- 新增 `countries.distribution`、`countries.continents`、`countries.noData`、`countries.connections`+- 新增 `proxies.distribution`、`proxies.total`、`proxies.download`、`proxies.upload`、`proxies.connections` 等+- 新增 `rules.distribution`、`rules.description`、`rules.connections`+- 新增 `map.*` 系列(地图相关)+- 新增 `about.*` 系列(关于页面)++### 4. 关于弹窗++**`navigation.tsx`**:+- 在桌面端侧边栏底部「设置」按钮上方,新增了「关于」按钮+- 点击弹出 Dialog,展示:+ - 应用 Logo + 名称 + 描述+ - **版本号 `v1.0.0`** — 建议从 `1.0.0` 开始,因为这是首个公开发布的开源版本,符合语义化版本规范(SemVer)中"首次公共 API 发布"的惯例。如果你觉得功能还不够稳定,也可以改为 `0.1.0`+ - MIT 许可证信息+ - GitHub 链接 `https://github.com/foru17/clash-master`(可点击跳转)++---++_**User (2026-02-06 02:27Z)**_++1.现在 Top Domains by Traffic 的流量分布图中,树状bar 右侧的流量显示例 31MB,其中的数字 31和 MB 会在两行显示。另外由于我们页面会自动刷新数据,这里的统计图也会随着数据变化重绘,出现图标的闪动,这里可以优化吗?+2.在 Proxyies 版本中,Proxy Traffic Distribution 下的卡片目前是每一行两个,但是实际上卡片内地信息并没有那么些,我希望这里的代表节点的卡片也能跟其他模块类似的卡片尺寸、排版保持一致,这样可以更好地保持应用体验的一致性。++---++_**Agent (model claude-4.6-opus-high-thinking, mode Agent)**_++++---++++++---++<think><details><summary>Thought Process</summary>+Let me understand the user's two requests:++1. In the "Top Domains by Traffic" chart, the traffic values (like "31MB") are displaying with the number and unit on separate lines. Also, the chart flickers when data refreshes. Need to fix both.++2. In the Proxies section, the "Proxy Traffic Distribution" cards are showing 2 per row, but the user wants them to match the card sizes/layout used in other modules for consistency.++Let me first explore the relevant components to understand the current implementation.</details></think>++---++<tool-use data-tool-type="task" data-tool-name="todo_write">+<details><summary>Tool use: **todo_write** • Todo List</summary>++- [-] Fix Top Domains tree bar chart: traffic label wrapping + refresh flicker+- [ ] Fix Proxy Traffic Distribution card layout to match other modules++</details>+</tool-use>++---++<tool-use data-tool-type="search" data-tool-name="codebase_search">+<details>+ <summary>Tool use: **codebase_search** • Searched codebase "Top Domains by Traffic tree bar chart with traffic display" • **11** results</summary>++| File | Lines |+|------|-------|+| `apps/web/components/top-domains-chart.tsx` | L20-156 |+| `apps/web/components/top-domains-chart.tsx` | L16-156 |+| `apps/web/components/domain-top-list.tsx` | L28-133 |+| `apps/web/components/overview/index.tsx` | L20-149 |+| `apps/web/components/domain-top-grid.tsx` | L22-130 |+| `apps/web/components/top-domains-chart.tsx` | L16 |+| `apps/web/components/overview/top-domains-simple.tsx` | L19-174 |+| `apps/web/components/country-traffic-chart.tsx` | L54-219 |+| `apps/web/components/overview/top-domains-simple.tsx` | L17 |+| `apps/web/components/country-traffic-list.tsx` | L31-124 |+| `apps/web/components/world-traffic-map.tsx` | L46-310 |++</details>+</tool-use>++---++<tool-use data-tool-type="search" data-tool-name="codebase_search">+<details>+ <summary>Tool use: **codebase_search** • Searched codebase "Proxy Traffic Distribution cards grid layout" • **12** results</summary>++| File | Lines |+|------|-------|+| `apps/web/components/proxy-stats-chart.tsx` | L26-172 |+| `apps/web/components/proxy-top-grid.tsx` | L40-154 |+| `apps/web/components/country-traffic-list.tsx` | L31-124 |+| `apps/web/components/domain-top-grid.tsx` | L22-130 |+| `apps/web/components/country-traffic-chart.tsx` | L54-219 |+| `apps/web/components/proxy-top-grid.tsx` | L31-154 |+| `apps/web/components/overview/index.tsx` | L20-149 |+| `apps/web/components/proxy-top-list.tsx` | L42-135 |+| `apps/web/components/proxy-top-list.tsx` | L33-135 |+| `apps/web/components/stats-cards.tsx` | L113-210 |+| `apps/web/components/proxy-top-grid.tsx` | L16 |+| `apps/web/components/rule-chain-chart.tsx` | L54-173 |++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+Now let me read the full files I need to modify:++1. `top-domains-chart.tsx` - to fix the label wrapping and flicker issues+2. `proxy-stats-chart.tsx` - to fix the card layout++Let me read both files in full.</details></think>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/top-domains-chart.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-stats-chart.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/country-traffic-chart.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/country-traffic-list.tsx</summary>++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+Now I have a good understanding of both issues:++**Issue 1: Top Domains chart - label wrapping and flicker**++The `LabelList` in the BarChart is using `formatBytes(value, 0)` which produces text like "31 MB". In the SVG context within recharts, the `whiteSpace: 'nowrap'` style doesn't always work as expected since SVG text elements don't support CSS `white-space`. The label text "31 MB" gets split into two lines.++For the flicker, the chart re-renders completely when data updates because:+1. `chartData` is recalculated via `useMemo` when `data` changes+++2. `ResponsiveContainer` combined with recharts animations triggers the flicker++I can fix the label wrapping by using a custom label renderer with proper SVG text attributes, or removing the space between the number and unit. For the flicker, I should disable animations on the `<Bar>` component or ensure the chart has a stable key during re-renders.++**Issue 2: Proxy Traffic Distribution cards layout**++The proxy cards are currently using a responsive grid that stacks on mobile and shows two columns on larger screens. The user wants to adjust how these cards display.++Looking at the country traffic cards for reference, they're more compact with smaller text and padding, allowing them to fit more columns across different breakpoints. I need to scale down the proxy cards similarly—reducing the font size from `text-2xl` to something smaller like `text-lg`, adjusting padding, and updating the grid to show more columns on larger screens to match the other modules.++For the bar chart label wrapping issue, the problem is that SVG text elements don't respect CSS whitespace properties, so the space between the number and unit causes it to break across lines. I'll need a custom label component that renders everything in a single text element with the right attributes to keep it on one line.</details></think>++---++让我再查看一下 `formatBytes` 函数的实现和 recharts `LabelList` 的行为。++---++<tool-use data-tool-type="search" data-tool-name="grep">+<details>+<summary>Tool use: **grep** • Grep for "export function formatBytes" in "/Users/luolei/DEV/clash-master/apps/web" • 1 match</summary>++Output mode: content+++| File | Content | Line |+|------|------|------|+| `apps/web/lib/utils.ts` | `export function formatBytes(bytes: number, decimals = 2): string \{` | L8 |+++</details>+</tool-use>++---++<tool-use data-tool-type="search" data-tool-name="codebase_search">+<details>+ <summary>Tool use: **codebase_search** • Searched codebase "How does the page auto-refresh data and pass it to TopDomainsChart" • **9** results</summary>++| File | Lines |+|------|-------|+| `apps/web/app/[locale]/page.tsx` | L162-464 |+| `apps/web/app/[locale]/page.tsx` | L152-464 |+| `apps/web/app/[locale]/page.tsx` | L35-126 |+| `apps/web/app/[locale]/page.tsx` | L46 |+| `apps/web/app/[locale]/page.tsx` | L82-464 |+| `apps/web/app/[locale]/layout.tsx` | L19-54 |+| `apps/web/app/[locale]/layout.tsx` | L54 |+| `apps/web/app/globals.css` | L51-127 |+| `apps/web/app/globals.css` | L55 |++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+Now I understand both issues clearly. Let me plan the fixes:++**Issue 1: Bar chart label wrapping + flicker**++The `formatBytes` returns `"31 MB"` with a space. In SVG, `<text>` elements don't wrap by default, but recharts `LabelList` might be creating `<tspan>` elements that cause the visual splitting. The key issue is:++1. The label position is "right" with the right margin being 80px. If the label text is too wide, recharts may try to wrap it.+2. The `whiteSpace: 'nowrap'` won't work in SVG context.+++I'll create a custom label renderer that outputs a proper SVG text element without any wrapping behavior. For the flicker issue, I need to disable the animation on the Bar component since it replays whenever the data refreshes, causing that visual jitter.++**Issue 2: Proxy cards layout**++The current grid setup uses responsive columns with padding and large text sizing. I should tighten the spacing and font sizes to make better use of the available space.++Now I'm adjusting the proxy cards to use the same responsive grid structure as the country cards, with smaller padding and text to create a more compact, consistent layout across both sections.</details></think>++---++现在我清楚了两个问题,让我开始修复:++**问题1**:`formatBytes` 返回 `"31 MB"` 这样的字符串,在 SVG 的 `<text>` 元素中,recharts 的 `LabelList` 可能会分行渲染。另外每次数据刷新时图表动画重播导致闪烁。++**问题2**:代理卡片用的是 `grid-cols-1 sm:grid-cols-2`,而国家卡片用的是 `grid-cols-2 sm:grid-cols-3 lg:grid-cols-4`,需要统一。++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/top-domains-chart.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -1,5 +1,5 @@+ "use client";++- import { useState, useMemo } from "react";++ import { useState, useMemo, useRef } from "react";+ import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Cell, LabelList } from "recharts";+ import { useTranslations } from "next-intl";+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/top-domains-chart.tsx</summary>++**Chunk 1**+Lines added: 21, lines removed: 1++```diff+@@ -31,13 +31,33 @@+ "#F97316", // Orange+ ];++++ // Custom label renderer to prevent text wrapping in SVG++ function renderCustomBarLabel(props: any) {++ const { x, y, width, value, height } = props;++ return (++ <text++ x={x + width + 6}++ y={y + height / 2}++ fill="currentColor"++ fontSize={11}++ fontVariantNumeric="tabular-nums"++ dominantBaseline="central"++ textAnchor="start"++ >++ {formatBytes(value, 0)}++ </text>++ );++ }++ export function TopDomainsChart({ data }: TopDomainsChartProps) {+ const t = useTranslations("domains");+ const commonT = useTranslations("stats");+ const [topN, setTopN] = useState<TopOption>(10);++ // Track whether this is the initial render to only animate on first load++ const hasRenderedRef = useRef(false);++ const chartData = useMemo(() => {+ if (!data) return [];+- return data++ const result = data+ .slice(0, topN)+ .map((domain, index) => ({+```++**Chunk 2**+Lines added: 5, lines removed: undefined++```diff+@@ -49,4 +69,9 @@+ color: COLORS[index % COLORS.length],+ }));++ // After first data load, mark as rendered so subsequent updates skip animation++ if (result.length > 0) {++ setTimeout(() => { hasRenderedRef.current = true; }, 800);++ }++ return result;+ }, [data, topN]);++```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/top-domains-chart.tsx</summary>++**Chunk 1**+Lines added: 7, lines removed: 1++```diff+@@ -162,5 +162,11 @@+ cursor={{ fill: "rgba(128, 128, 128, 0.1)" }}+ />+- <Bar dataKey="total" radius={[0, 4, 4, 0]} maxBarSize={32}>++ <Bar++ dataKey="total"++ radius={[0, 4, 4, 0]}++ maxBarSize={32}++ isAnimationActive={!hasRenderedRef.current}++ animationDuration={600}++ >+ {chartData.map((entry, index) => (+ <Cell key={`cell-${index}`} fill={entry.color} />+```++**Chunk 2**+Lines added: 1, lines removed: 3++```diff+@@ -169,7 +175,5 @@+ dataKey="total"+ position="right"+- formatter={(value: number) => formatBytes(value, 0)}+- className="fill-foreground"+- style={{ fontSize: 10, whiteSpace: 'nowrap' }}++ content={renderCustomBarLabel}+ />+ </Bar>+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-stats-chart.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -109,5 +109,5 @@++ {/* Proxy Cards Grid */}+- <div className="grid grid-cols-1 sm:grid-cols-2 gap-3">++ <div className="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3">+ {chartData.map((item) => {+ const percentage = totalTraffic > 0 ? (item.value / totalTraffic) * 100 : 0;+```++**Chunk 2**+Lines added: 2, lines removed: 2++```diff+@@ -116,8 +116,8 @@+ <div+ key={item.rawName}+- className="p-4 rounded-xl border border-border/50 bg-card/50 hover:bg-card transition-colors"++ className="p-3 rounded-xl border border-border/50 bg-card/50 hover:bg-card transition-colors"+ >+ {/* Header: Color dot + Name */}+- <div className="flex items-center gap-2 mb-3">++ <div className="flex items-center gap-2 mb-2">+ <div+ className="w-3 h-3 rounded-full shrink-0"+```++**Chunk 3**+Lines added: 1, lines removed: 1++```diff+@@ -133,5 +133,5 @@+ {/* Total with percentage */}+ <div className="flex items-baseline justify-between">+- <span className="text-2xl font-bold tabular-nums">++ <span className="text-lg font-bold tabular-nums">+ {formatBytes(item.value)}+ </span>+```++**Chunk 4**+Lines added: 4, lines removed: 3++```diff+@@ -160,7 +160,8 @@++ {/* Connections */}+- <p className="text-xs text-muted-foreground">+- {item.connections.toLocaleString()} {t("connections")}+- </p>++ <div className="flex items-center gap-1 text-xs text-muted-foreground">++ <Server className="w-3 h-3" />++ <span>{item.connections.toLocaleString()} {t("connections")}</span>++ </div>+ </div>+ </div>+```++</details>++</tool-use>++---++<tool-use data-tool-type="generic" data-tool-name="read_lints">+<details>+ <summary>Tool use: **read_lints** • Read lints for 2 files</summary>++Lint paths:++- `/Users/luolei/DEV/clash-master/apps/web/components/top-domains-chart.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/proxy-stats-chart.tsx`++Lint results+++**No lint errors found**+</details>+</tool-use>++---++<tool-use data-tool-type="task" data-tool-name="todo_write">+<details><summary>Tool use: **todo_write** • Todo List</summary>++- [x] Fix Top Domains tree bar chart: traffic label wrapping + refresh flicker+- [x] Fix Proxy Traffic Distribution card layout to match other modules++</details>+</tool-use>++---++<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">+<details><summary>Tool use: **run_terminal_cmd** • Run command: cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -40</summary>++```bash+cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -40+```++```+components/top-domains-chart.tsx(43,7): error TS2322: Type '{ children: string; x: any; y: any; fill: string; fontSize: number; fontVariantNumeric: string; dominantBaseline: "central"; textAnchor: "start"; }' is not assignable to type 'SVGTextElementAttributes<SVGTextElement>'.+ Property 'fontVariantNumeric' does not exist on type 'SVGTextElementAttributes<SVGTextElement>'.++```+</details>+</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/top-domains-chart.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -41,7 +41,7 @@+ fill="currentColor"+ fontSize={11}+- fontVariantNumeric="tabular-nums"+ dominantBaseline="central"+ textAnchor="start"++ style={{ fontVariantNumeric: "tabular-nums" }}+ >+ {formatBytes(value, 0)}+```++</details>++</tool-use>++---++<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">+<details><summary>Tool use: **run_terminal_cmd** • Run command: cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -20</summary>++```bash+cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -20+```+</details>+</tool-use>++---++TypeScript 编译通过,所有修改完成。让我确认一下最终文件的状态:++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/top-domains-chart.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-stats-chart.tsx</summary>++</details>+</tool-use>++---++所有修改完成,TypeScript 编译通过,没有错误。下面是修改总结:++---++## 修改总结++### 1. Top Domains 流量柱状图 — 标签换行 + 刷新闪烁++**`top-domains-chart.tsx`**:++**标签换行修复**:+- 替换了原来的 `LabelList` 默认渲染方式,改用自定义 `renderCustomBarLabel` 函数+- 该函数直接渲染 SVG `<text>` 元素,使用 `dominantBaseline="central"` 和 `textAnchor="start"` 确保文本在单行内正确对齐,不会出现数字和单位(如 `31 MB`)分行显示的问题++```34:49:apps/web/components/top-domains-chart.tsx+// Custom label renderer to prevent text wrapping in SVG+function renderCustomBarLabel(props: any) {+ const { x, y, width, value, height } = props;+ return (+ <text+ x={x + width + 6}+ y={y + height / 2}+ fill="currentColor"+ fontSize={11}+ dominantBaseline="central"+ textAnchor="start"+ style={{ fontVariantNumeric: "tabular-nums" }}+ >+ {formatBytes(value, 0)}+ </text>+ );+}+```++**刷新闪烁修复**:+- 添加 `hasRenderedRef` 引用,追踪是否已经首次渲染+- 首次加载时播放 600ms 入场动画(`isAnimationActive={!hasRenderedRef.current}`)+- 后续数据刷新时跳过动画(`hasRenderedRef.current = true`),避免图表闪烁++```164:169:apps/web/components/top-domains-chart.tsx+ <Bar+ dataKey="total"+ radius={[0, 4, 4, 0]}+ maxBarSize={32}+ isAnimationActive={!hasRenderedRef.current}+ animationDuration={600}+```++### 2. Proxy Traffic Distribution 卡片布局++**`proxy-stats-chart.tsx`**:++- **网格列数**:从 `grid-cols-1 sm:grid-cols-2` 改为 `grid-cols-2 sm:grid-cols-3 lg:grid-cols-4`,与国家流量卡片保持一致+- **卡片内边距**:从 `p-4` 缩小为 `p-3`+- **间距**:从 `mb-3` 缩小为 `mb-2`+- **流量字号**:从 `text-2xl` 缩小为 `text-lg`,与国家卡片统一+- **连接数**:添加了 `Server` 图标,与国家卡片的 `MapPin` 图标风格一致++---++_**User (2026-02-06 02:27Z)**_++现在我们 app 的有些文案的一致性还是有问题。+1.在 Domains 版本中, Domain List 中连接的描述用的是 Conn,而 IP Addresses 中用的是 Connections+2.另外不同卡片中关于连接的图标 icon 也不一致,我希望这块也能统一。+3.由于当前我还在快速迭代这个版本,我们的 About 页面已经有项目的版本号展示,我希望再新增一个版本检测的功能。关于这块你有没有什么好的建议,是否可以通过判断我们在线的 github https://raw.githubusercontent.com/foru17/clash-master/refs/heads/main/package.json 中的版本号来进行处理?(如果获取接口失败,也需要处理)+当线上仓库有新的版本的时候,可以在左下角 About 旁边提示一个可以升级的提示。++---++_**Agent (model claude-4.6-opus-high-thinking, mode Agent)**_++++++---++<think><details><summary>Thought Process</summary>+Let me break down the user's requests:++1. Fix inconsistent "Conn" vs "Connections" text in Domain List and IP Addresses+2. Unify the icons used for connections across different cards+3. Add version checking feature in the About section by fetching the online package.json from GitHub++Let me start by examining the relevant files to understand the current state.</details></think>++---++<tool-use data-tool-type="task" data-tool-name="todo_write">+<details><summary>Tool use: **todo_write** • Todo List</summary>++- [-] Unify "Conn" vs "Connections" text across Domain List and IP Addresses+- [ ] Unify connection icons across all cards/modules+- [ ] Add version check feature: fetch GitHub package.json, show upgrade hint++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/domains-table.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/ips-table.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/messages/en.json</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/messages/zh.json</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+Now let me also check the other components that use "connections" text and connection icons to understand the full picture:++1. **domains-table.tsx**: Uses `t("conn")` for "Conn" (en) / "连接" (zh) — short form+2. **ips-table.tsx**: Uses `t("connections")` for "Connections" (en) / "连接" (zh) — full form+3. **proxy-stats-chart.tsx**: Uses `t("connections")` — "connections" (en) / "连接" (zh)+4. **country-traffic-chart.tsx**: Uses `t("connections")` — "connections" (en) / "连接" (zh)+++5. **rule-chain-chart.tsx**: Uses `t("connections")` — "conn" (en) / "连接" (zh)++For the icons, I'm seeing a pattern where tables use badges without icons, while charts tend to use contextual icons like `Server` for proxy stats and `MapPin` for location-based charts. I need to check what rule-chain-chart and the remaining components are using.++On the text side, the real inconsistency is between Domain List and IP Addresses — one uses "Conn" while the other uses "Connections" in the same table header context. I should standardize these to match, probably keeping "Conn" for compact table headers and "connections" for descriptive text elsewhere. "Conn" for both table headers since space is limited, and keep "connections" for descriptive text in cards. Now I'm checking where connection icons are used to identify any other inconsistencies. I see the issue now — the user wants the connections icon to be consistent across all card types, not different icons based on context. Let me check every place where connections appear with an icon to standardize them.++Looking at the options, `Activity` seems like the most semantically appropriate choice for representing connections, though `Link2` could work too. I'll go with `Activity` since it better conveys the sense of active connections.++Now moving on to Task 3.++The user wants me to implement version checking by fetching the latest version from the remote package.json and comparing it with the current local version. If there's a newer version available, I should display an upgrade hint next to the About button in the sidebar.++My approach is to create a custom hook that handles the version comparison, gracefully handles any fetch failures, and shows a badge indicator when an update is available. I'll also update the About dialog to display the new version information with a link to the update.++Let me start implementing this.++Now I'm working through the text unification issues. The domains table uses `t("conn")` while the ips table uses `t("connections")` — they're in different translation namespaces. I need to decide whether to standardize on the shorter "Conn" label or the more descriptive "Connections" text, then update the translation keys accordingly. Looking at both tables, I see the inconsistency clearly now — the IP table uses "Connections" while the domains table uses "Conn" across desktop headers, mobile sort bars, and stats rows. I need to pick one approach and apply it consistently: either standardize everything to "Conn" by adding that key to the IP translations, or switch the domains table to use "Connections" instead.++Since both are table column headers where space is constrained, and "Conn" is already established in the domains table, I'll go with standardizing both to "Conn" — it's concise, contextually clear, and the Chinese translations are already aligned. Now I'm moving on to unifying the icons across both tables, starting with using `Activity` everywhere.++I need to systematically go through the components and replace connection-related icons — swapping `Server` and `MapPin` for `Activity` in the stats and traffic charts, then checking the grid components for any `Users` icons that might need updating too.</details></think>++---++Let me also check the other components that display connection icons to get the full picture.++---++<tool-use data-tool-type="search" data-tool-name="grep">+<details>+<summary>Tool use: **grep** • Grep for "connections.*className|className.*connections" in "/Users/luolei/DEV/clash-master/apps/web/components" • 9 matches</summary>++Output mode: content+++| File | Content | Line |+|------|------|------|+| `apps/web/components/proxy-stats-chart.tsx` | `<span className="text-emerald-500">\{t("connections")\}:</span>` | L69 |+| `apps/web/components/proxy-top-grid.tsx` | `<><Users className="w-3 h-3 mr-1" /> \{proxiesT("sortByConnections")\}</>` | L86 |+| `apps/web/components/domain-top-grid.tsx` | `<><Users className="w-3 h-3 mr-1" /> \{proxiesT("sortByConnections")\}</>` | L61 |+| `apps/web/components/domain-top-list.tsx` | `<><Users className="w-3 h-3 mr-1" /> \{t("sortByConnections")\}</>` | L91 |+| `apps/web/components/country-traffic-chart.tsx` | `<span className="text-emerald-500">\{mapT("connections")\}:</span>` | L105 |+| `apps/web/components/proxy-top-list.tsx` | `<><Users className="w-3 h-3 mr-1" /> \{t("sortByConnections")\}</>` | L104 |+| `apps/web/components/world-traffic-map.tsx` | `<span className="text-emerald-500">\{t("connections")\}:</span>` | L243 |+| `apps/web/components/rule-chain-chart.tsx` | `<span className="tabular-nums">\{rule.totalConnections.toLocaleString()\} \{t("connections")\}</span>` | L162 |+| `apps/web/components/backend-config-dialog.tsx` | `<div className="text-xs text-muted-foreground">\{t("connectionsCount")\}</div>` | L632 |+++</details>+</tool-use>++---++<tool-use data-tool-type="search" data-tool-name="grep">+<details>+<summary>Tool use: **grep** • Grep for "\{(item|proxy|domain|country|rule)\.(totalC|c)onnections" in "/Users/luolei/DEV/clash-master/apps/web/components" • 13 matches</summary>++Output mode: content+++| File | Content | Line |+|------|------|------|+| `apps/web/components/proxy-stats-chart.tsx` | `<span>\{item.connections.toLocaleString()\}</span>` | L70 |+| `apps/web/components/proxy-stats-chart.tsx` | `<span>\{item.connections.toLocaleString()\} \{t("connections")\}</span>` | L164 |+| `apps/web/components/proxy-top-grid.tsx` | `\{proxy.totalConnections\}` | L129 |+| `apps/web/components/domain-top-grid.tsx` | `\{domain.totalConnections\}` | L113 |+| `apps/web/components/domain-top-list.tsx` | `? `$\{domain.totalConnections\} $\{t("connections")\}`` | L122 |+| `apps/web/components/country-traffic-chart.tsx` | `<span>\{item.connections.toLocaleString()\}</span>` | L106 |+| `apps/web/components/country-traffic-chart.tsx` | `<span>\{item.connections.toLocaleString()\} \{t("connections")\}</span>` | L197 |+| `apps/web/components/proxy-top-list.tsx` | `? `$\{proxy.totalConnections\} $\{proxiesT("connections")\}`` | L124 |+| `apps/web/components/rule-chain-chart.tsx` | `<span className="tabular-nums">\{rule.totalConnections.toLocaleString()\} \{t("connections")\}</span>` | L162 |+| `apps/web/components/domains-table.tsx` | `\{domain.totalConnections\}` | L269 |+| `apps/web/components/domains-table.tsx` | `\{domain.totalConnections\} \{t("conn")\}` | L351 |+| `apps/web/components/overview/top-domains-simple.tsx` | `\{domain.totalConnections\}` | L153 |+| `apps/web/components/country-traffic-list.tsx` | `<span>\{country.totalConnections.toLocaleString()\}</span>` | L117 |+++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/rule-chain-chart.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-top-grid.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/domain-top-grid.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/package.json</summary>++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+Now let me also check the `domain-top-list.tsx` and `proxy-top-list.tsx` for consistency, and the `top-domains-simple.tsx` for connection icons.</details></think>++---++Now let me also check the remaining components and the apps/web package.json for the version.++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/domain-top-list.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-top-list.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/overview/top-domains-simple.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/package.json</summary>++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+Now I have a comprehensive understanding. Let me plan all the changes:++## Task 1: Unify "Conn" vs "Connections" text++The inconsistency:+- `domains-table.tsx` line 188, 205, 351: Uses `t("conn")` → "Conn" (en) / "连接" (zh)+- `ips-table.tsx` line 202, 216, 382: Uses `t("connections")` → "Connections" (en) / "连接" (zh)++Both are table views with the same structure, so they should be consistent. Since they're column headers in tables where space is limited, I'll standardize both to "Conn".+++I need to update `ips-table.tsx` to use `t("conn")` instead of `t("connections")` in three places, then add the "conn" key to both the English and Chinese translation files under the `ips` namespace.++## Task 2: Unify connection icons++Looking at the icons used for connections count across different components, I see `proxy-stats-chart.tsx` uses a Server icon while `country-traffic-chart.tsx` appears to use a Map icon. I need to check what other components are using and standardize on a single icon choice. I'm weighing the icon options for the connections sort buttons. `Link2` makes the most semantic sense since it represents actual connections or links, and it's already being used in `top-domains-simple.tsx` for the same purpose, so I should stick with that for consistency.++Now I need to update the connection icons across several chart and list components — swapping out `Server`, `MapPin`, and `Users` icons for `Link2` in the card and list views where connection counts are displayed, though the tooltip-only labels in some charts won't need changes.++For the sort toggle buttons that show connection count icons, I'll also replace `Users` with `Link2` across the grid and list components.++Starting on the version check feature, I'm planning to create a custom hook that will handle version checking logic. I need to think through the version check implementation more carefully. The fetch from GitHub's raw content should work fine since raw.githubusercontent.com supports CORS, so I can use the browser's fetch API directly. The hook needs to check periodically—maybe every 30 minutes—cache results, and handle errors gracefully without breaking the UI. Let me start implementing the hook and then integrate it into the navigation component.++For the current version, I'll need to centralize it rather than hardcoding "1.0.0" in navigation.tsx. The simplest approach is to define a version constant in a shared location that both the hook and navigation component can import from, then compare it against the fetched version to determine if an upgrade is available.++Looking at the remote repository structure, the root package.json is a monorepo configuration without a meaningful version field, but the actual app version lives in apps/web/package.json. I need to fetch from the correct path to get the current version of the deployed app. The root package.json doesn't have a version field, so I need to either point to the apps/web package.json instead or add a version to the root. Since the user specified the root URL, I'll add a version field there to keep everything consistent and make the fetch work as intended.++Now I'm mapping out all the changes needed across the translation files and components. I need to update the translation files to add the connection label and version check strings, then go through the component files to swap out the icon references from `Server`, `MapPin`, and `Users` to `Link2` for the connections display, and update the translation key from `connections` to `conn` in the table component.++Actually, I'm second-guessing the icon choice—`Link2` is more about URL links than network connections, so `Activity` or `Zap` might better represent the concept of active connections. Let me reconsider before I start implementing.++Looking at the lucide-react options, `Link2` represents chain links, `Activity` is a heartbeat pulse, `Cable` is for physical connections, and `Plug` is for connecting. I think `Link2` works fine semantically for connections, and it's already being used elsewhere in the codebase like in `ips-table.tsx` for the domain count button, so there's consistency there. Let me check how it's actually being used in that file to make sure I'm making the right call. I'm seeing the semantic overlap now — `Link2` is being used for both "sort by connections" in the domains view and for "associated domains" in the IPs table, which are two different concepts. I should use `Activity` for network connections and keep `Link2` strictly for relationship links, then systematically update all the connection count icons across the codebase to use this clearer distinction. I'm finishing the list of icon replacements needed across the components, then reconsidering whether `Users` actually makes sense for connection counts since `Activity` would be more semantically accurate for representing active connections. Looking at the usage patterns, `Users` appears in several grid and list components while `MapPin` and `Server` are used less frequently, so standardizing on `Activity` would create better consistency across the codebase. Now I'm ready to implement everything. I'm creating a version check hook that fetches the package.json from the GitHub repository and compares the current version against the remote version... Writing the version check hook...++Now I'm setting up the UI to display update notifications—adding a badge next to the About button and version details in the dialog itself. I'll also need to add the translation strings for the version information and update prompts.++I'm reconsidering the icon choice for the connections feature—the heartbeat/ECG line doesn't quite fit the network context, so maybe something like `Unplug` or `Cable` would work better, or I could just stick with `Link`.++Actually, `Link2` makes the most sense here since it visually represents connected links and is immediately recognizable at small sizes, even though it's used elsewhere in the ips-table for associated domains. The context is different enough that it won't be confusing. I'll use `Link2` for both the connection count cards and the sort buttons that toggle by connections.++Looking at the existing code, I notice `top-domains-simple.tsx` already uses `Link2` for the "sort by connections" toggle, which validates this choice. But I'm seeing inconsistency across other components—some use `ArrowUpDown` and `Users` for the same sort toggles. I should standardize these across all components to match the established pattern. Now I'm ready to implement everything. I'll add a version check hook and update the necessary files — adding translation keys for the new version notification feature, modifying the IPS table to use the correct translation key, and updating the component files to integrate the version checking and navigation badge. Finishing the last component change for the sort button, then moving on to replacing an inline SVG with the Link2 icon in the top domains component. For the navigation file, I need to add a version check, update the badge styling, and refresh the about dialog information. The web package.json already has version 1.0.0 set, but I'm reconsidering whether to update the root package.json instead since the user provided that specific URL.++Actually, I think using the apps/web/package.json makes more sense since that's where the actual app version lives in this monorepo structure. I'll add the version field to the root package.json to match the user's URL, then note in the implementation which path to reference.</details></think>++---++Now I have a complete picture. Let me implement all three changes in parallel.++---++<tool-use data-tool-type="task" data-tool-name="todo_write">+<details><summary>Tool use: **todo_write** • Todo List</summary>++- [-] Unify "Conn" vs "Connections" text across Domain List and IP Addresses+- [-] Unify connection icons across all cards/modules+- [-] Add version check feature: fetch GitHub package.json, show upgrade hint++</details>+</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="write">++<details><summary>Tool use: **write** • Edit file: /Users/luolei/DEV/clash-master/apps/web/hooks/use-version-check.ts</summary>++**Chunk 1**+Lines added: 85, lines removed: 1++```diff+@@ -1,1 +1,85 @@+-++ "use client";++++ import { useState, useEffect, useCallback } from "react";++++ const GITHUB_PACKAGE_URL =++ "https://raw.githubusercontent.com/foru17/clash-master/refs/heads/main/package.json";++ const CHECK_INTERVAL = 30 * 60 * 1000; // Check every 30 minutes++ const FETCH_TIMEOUT = 10000; // 10 seconds++++ /**++ * Compare two semver version strings.++ * Returns > 0 if remote is newer, 0 if equal, < 0 if current is newer.++ */++ function compareVersions(current: string, remote: string): number {++ const a = current.replace(/^v/, "").split(".").map(Number);++ const b = remote.replace(/^v/, "").split(".").map(Number);++ for (let i = 0; i < Math.max(a.length, b.length); i++) {++ const diff = (b[i] || 0) - (a[i] || 0);++ if (diff !== 0) return diff;++ }++ return 0;++ }++++ interface VersionCheckResult {++ /** The latest version from GitHub, null if not yet checked or failed */++ latestVersion: string | null;++ /** Whether a newer version is available */++ hasUpdate: boolean;++ /** Whether the check is currently in progress */++ isChecking: boolean;++ /** Manually trigger a version check */++ checkNow: () => void;++ }++++ export function useVersionCheck(currentVersion: string): VersionCheckResult {++ const [latestVersion, setLatestVersion] = useState<string | null>(null);++ const [hasUpdate, setHasUpdate] = useState(false);++ const [isChecking, setIsChecking] = useState(false);++++ const check = useCallback(async () => {++ setIsChecking(true);++ try {++ const controller = new AbortController();++ const timeoutId = setTimeout(() => controller.abort(), FETCH_TIMEOUT);++++ const res = await fetch(GITHUB_PACKAGE_URL, {++ cache: "no-store",++ signal: controller.signal,++ });++++ clearTimeout(timeoutId);++++ if (!res.ok) {++ setIsChecking(false);++ return;++ }++++ const pkg = await res.json();++ if (pkg.version) {++ setLatestVersion(pkg.version);++ setHasUpdate(compareVersions(currentVersion, pkg.version) > 0);++ }++ } catch {++ // Silently fail — network errors, timeouts, CORS issues, etc.++ } finally {++ setIsChecking(false);++ }++ }, [currentVersion]);++++ useEffect(() => {++ // Initial check with a short delay to avoid blocking page load++ const initialTimer = setTimeout(check, 3000);++++ // Periodic checks++ const interval = setInterval(check, CHECK_INTERVAL);++++ return () => {++ clearTimeout(initialTimer);++ clearInterval(interval);++ };++ }, [check]);++++ return { latestVersion, hasUpdate, isChecking, checkNow: check };++ }+++```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/messages/en.json</summary>++**Chunk 1**+Lines added: 1, lines removed: undefined++```diff+@@ -127,4 +127,5 @@+ "upload": "Upload",+ "connections": "Connections",++ "conn": "Conn",+ "ipsCount": "IPs",+ "showing": "Showing",+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/messages/en.json</summary>++**Chunk 1**+Lines added: 7, lines removed: 1++```diff+@@ -182,5 +182,11 @@+ "github": "GitHub",+ "openSource": "Open Source Project",+- "license": "MIT License"++ "license": "MIT License",++ "currentVersion": "Current Version",++ "latestVersion": "Latest Version",++ "updateAvailable": "Update Available",++ "upToDate": "Up to date",++ "checkingUpdate": "Checking for updates...",++ "viewOnGitHub": "View on GitHub"+ },+ "common": {+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/messages/zh.json</summary>++**Chunk 1**+Lines added: 1, lines removed: undefined++```diff+@@ -127,4 +127,5 @@+ "upload": "上传",+ "connections": "连接",++ "conn": "连接",+ "ipsCount": "个 IP",+ "showing": "显示",+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/messages/zh.json</summary>++**Chunk 1**+Lines added: 7, lines removed: 1++```diff+@@ -182,5 +182,11 @@+ "github": "GitHub",+ "openSource": "开源项目",+- "license": "MIT 许可证"++ "license": "MIT 许可证",++ "currentVersion": "当前版本",++ "latestVersion": "最新版本",++ "updateAvailable": "有新版本",++ "upToDate": "已是最新版本",++ "checkingUpdate": "正在检查更新...",++ "viewOnGitHub": "在 GitHub 查看"+ },+ "common": {+```++</details>++</tool-use>++---++Now let me update all the component files in parallel — fix text consistency and unify icons:++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/ips-table.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -200,5 +200,5 @@+ onClick={() => handleSort("totalConnections")}+ >+- {t("connections")}++ {t("conn")}+ <SortIcon column="totalConnections" />+ </div>+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/ips-table.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -214,5 +214,5 @@+ { key: "totalDownload" as SortKey, label: t("download") },+ { key: "totalUpload" as SortKey, label: t("upload") },+- { key: "totalConnections" as SortKey, label: t("connections") },++ { key: "totalConnections" as SortKey, label: t("conn") },+ ]).map(({ key, label }) => (+ <button+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/ips-table.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -380,5 +380,5 @@+ <span className="text-purple-500 tabular-nums">↑ {formatBytes(ip.totalUpload)}</span>+ <span className="px-2 py-0.5 rounded-full bg-secondary text-muted-foreground font-medium">+- {ip.totalConnections} {t("connections")}++ {ip.totalConnections} {t("conn")}+ </span>+ </div>+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-stats-chart.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -3,5 +3,5 @@+ import { useMemo } from "react";+ import { PieChart, Pie, Cell, ResponsiveContainer, Tooltip } from "recharts";+- import { Server } from "lucide-react";++ import { Server, Link2 } from "lucide-react";+ import { useTranslations } from "next-intl";+ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-stats-chart.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -161,5 +161,5 @@+ {/* Connections */}+ <div className="flex items-center gap-1 text-xs text-muted-foreground">+- <Server className="w-3 h-3" />++ <Link2 className="w-3 h-3" />+ <span>{item.connections.toLocaleString()} {t("connections")}</span>+ </div>+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/country-traffic-chart.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -3,5 +3,5 @@+ import { useMemo } from "react";+ import { PieChart, Pie, Cell, ResponsiveContainer, Tooltip } from "recharts";+- import { Globe, MapPin } from "lucide-react";++ import { Globe, Link2 } from "lucide-react";+ import { useTranslations } from "next-intl";+ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/country-traffic-chart.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -194,5 +194,5 @@+ {/* Connections */}+ <div className="flex items-center gap-1 text-xs text-muted-foreground">+- <MapPin className="w-3 h-3" />++ <Link2 className="w-3 h-3" />+ <span>{item.connections.toLocaleString()} {t("connections")}</span>+ </div>+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/country-traffic-list.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -2,5 +2,5 @@++ import { useMemo } from "react";+- import { MapPin, ArrowDown, ArrowUp } from "lucide-react";++ import { Link2, ArrowDown, ArrowUp } from "lucide-react";+ import { formatBytes } from "@/lib/utils";+ import type { CountryStats } from "@clashstats/shared";+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/country-traffic-list.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -114,5 +114,5 @@+ {/* Connections */}+ <div className="flex items-center gap-1 text-xs text-muted-foreground">+- <MapPin className="w-3 h-3" />++ <Link2 className="w-3 h-3" />+ <span>{country.totalConnections.toLocaleString()}</span>+ </div>+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-top-grid.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -2,5 +2,5 @@++ import { useMemo, useState } from "react";+- import { Server, Users, ArrowUpDown, ArrowRight } from "lucide-react";++ import { Server, Link2, ArrowUpDown, ArrowRight } from "lucide-react";+ import { useTranslations } from "next-intl";+ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-top-grid.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -84,5 +84,5 @@+ <><ArrowUpDown className="w-3 h-3 mr-1" /> {proxiesT("sortByTraffic")}</>+ ) : (+- <><Users className="w-3 h-3 mr-1" /> {proxiesT("sortByConnections")}</>++ <><Link2 className="w-3 h-3 mr-1" /> {proxiesT("sortByConnections")}</>+ )}+ </Button>+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-top-grid.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -126,5 +126,5 @@+ </span>+ <span className="text-muted-foreground flex items-center gap-1">+- <Users className="w-3 h-3" />++ <Link2 className="w-3 h-3" />+ {proxy.totalConnections}+ </span>+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/domain-top-grid.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -2,5 +2,5 @@++ import { useMemo, useState } from "react";+- import { Globe, Users, ArrowUpDown, ArrowRight } from "lucide-react";++ import { Globe, Link2, ArrowUpDown, ArrowRight } from "lucide-react";+ import { useTranslations } from "next-intl";+ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/domain-top-grid.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -59,5 +59,5 @@+ <><ArrowUpDown className="w-3 h-3 mr-1" /> {proxiesT("sortByTraffic")}</>+ ) : (+- <><Users className="w-3 h-3 mr-1" /> {proxiesT("sortByConnections")}</>++ <><Link2 className="w-3 h-3 mr-1" /> {proxiesT("sortByConnections")}</>+ )}+ </Button>+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/domain-top-grid.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -110,5 +110,5 @@+ </div>+ <span className="flex items-center gap-1">+- <Users className="w-3 h-3" />++ <Link2 className="w-3 h-3" />+ {domain.totalConnections}+ </span>+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/domain-top-list.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -2,5 +2,5 @@++ import { useMemo, useState } from "react";+- import { Globe, Users, ArrowUpDown } from "lucide-react";++ import { Globe, Link2, ArrowUpDown } from "lucide-react";+ import { useTranslations } from "next-intl";+ import { OverviewCard } from "./overview-card";+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/domain-top-list.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -89,5 +89,5 @@+ <><ArrowUpDown className="w-3 h-3 mr-1" /> {t("sortByTraffic")}</>+ ) : (+- <><Users className="w-3 h-3 mr-1" /> {t("sortByConnections")}</>++ <><Link2 className="w-3 h-3 mr-1" /> {t("sortByConnections")}</>+ )}+ </Button>+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-top-list.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -2,5 +2,5 @@++ import { useMemo, useState } from "react";+- import { Server, Users, ArrowUpDown } from "lucide-react";++ import { Server, Link2, ArrowUpDown } from "lucide-react";+ import { useTranslations } from "next-intl";+ import { OverviewCard } from "./overview-card";+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/proxy-top-list.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -102,5 +102,5 @@+ <><ArrowUpDown className="w-3 h-3 mr-1" /> {t("sortByTraffic")}</>+ ) : (+- <><Users className="w-3 h-3 mr-1" /> {t("sortByConnections")}</>++ <><Link2 className="w-3 h-3 mr-1" /> {t("sortByConnections")}</>+ )}+ </Button>+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/overview/top-domains-simple.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 3++```diff+@@ -148,7 +148,5 @@+ </div>+ <span className="flex items-center gap-1 tabular-nums">+- <svg className="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">+- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1" />+- </svg>++ <Link2 className="w-3 h-3" />+ {domain.totalConnections}+ </span>+```++</details>++</tool-use>++---++Now let me also check the overview proxies/countries simple components for connection icons, and update the navigation.tsx with version check:++---++<tool-use data-tool-type="search" data-tool-name="codebase_search">+<details>+ <summary>Tool use: **codebase_search** • Searched codebase "TopProxiesSimple TopCountriesSimple connection icon" • **9** results</summary>++| File | Lines |+|------|-------|+| `apps/web/components/overview/top-proxies-simple.tsx` | L20-155 |+| `apps/web/components/overview/top-domains-simple.tsx` | L19-172 |+| `apps/web/components/overview/top-proxies-simple.tsx` | L15-155 |+| `apps/web/components/overview/top-proxies-simple.tsx` | L20 |+| `apps/web/components/overview/index.tsx` | L20-149 |+| `apps/web/components/overview/top-countries-simple.tsx` | L64-165 |+| `apps/web/components/overview/top-domains-simple.tsx` | L17 |+| `apps/web/components/overview/top-countries-simple.tsx` | L33 |+| `apps/web/components/overview/top-countries-simple.tsx` | L61-165 |++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+Let me check the top-proxies-simple.tsx for connection icon usage.</details></think>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/overview/top-proxies-simple.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/overview/top-countries-simple.tsx</summary>++</details>+</tool-use>++---++Good - `top-proxies-simple.tsx` also has the same inline SVG for connections. Let me fix it and then update `navigation.tsx` with the version check feature:++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/overview/top-proxies-simple.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 3++```diff+@@ -129,7 +129,5 @@+ </div>+ <span className="flex items-center gap-1 tabular-nums">+- <svg className="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">+- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1" />+- </svg>++ <Link2 className="w-3 h-3" />+ {proxyItem.totalConnections}+ </span>+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++**Chunk 1**+Lines added: 2, lines removed: undefined++```diff+@@ -16,4 +16,6 @@+ Info,+ ExternalLink,++ ArrowUpCircle,++ RefreshCw,+ } from "lucide-react";+ import { cn } from "@/lib/utils";+```++**Chunk 2**+Lines added: 1, lines removed: undefined++```diff+@@ -26,4 +28,5 @@+ DialogTitle,+ } from "@/components/ui/dialog";++ import { useVersionCheck } from "@/hooks/use-version-check";++ interface NavigationProps {+```++</details>++</tool-use>++---++Now update the navigation component with the version check hook and enhanced About dialog:++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: undefined++```diff+@@ -55,4 +55,5 @@+ const backendT = useTranslations("backend");+ const aboutT = useTranslations("about");++ const { latestVersion, hasUpdate, isChecking, checkNow } = useVersionCheck(APP_VERSION);++ return (+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++**Chunk 1**+Lines added: 10, lines removed: 1++```diff+@@ -106,10 +106,19 @@+ onClick={() => setAboutOpen(true)}+ className={cn(+- "w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium transition-all",++ "w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium transition-all relative",+ "text-muted-foreground hover:bg-secondary hover:text-foreground"+ )}+ >+ <Info className="w-5 h-5" />+ {aboutT("title")}++ {hasUpdate && (++ <span className="ml-auto flex items-center gap-1.5 text-xs text-emerald-500 font-medium">++ <span className="relative flex h-2 w-2">++ <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75" />++ <span className="relative inline-flex rounded-full h-2 w-2 bg-emerald-500" />++ </span>++ v{latestVersion}++ </span>++ )}+ </button>+ <button+```++</details>++</tool-use>++---++Now update the About dialog to show the version check info:++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++**Chunk 1**+Lines added: 67, lines removed: 6++```diff+@@ -258,10 +258,71 @@+ </div>++- {/* Version */}+- <div className="flex items-center justify-between p-3 rounded-xl bg-secondary/50 border border-border/50">+- <span className="text-sm font-medium">{aboutT("version")}</span>+- <span className="text-sm font-mono tabular-nums text-primary font-semibold">+- v{APP_VERSION}+- </span>++ {/* Version Info */}++ <div className="space-y-2">++ {/* Current Version */}++ <div className="flex items-center justify-between p-3 rounded-xl bg-secondary/50 border border-border/50">++ <span className="text-sm font-medium">{aboutT("currentVersion")}</span>++ <span className="text-sm font-mono tabular-nums text-primary font-semibold">++ v{APP_VERSION}++ </span>++ </div>++++ {/* Latest Version / Update Status */}++ <div className={cn(++ "flex items-center justify-between p-3 rounded-xl border",++ hasUpdate++ ? "bg-emerald-500/5 border-emerald-500/20"++ : "bg-secondary/50 border-border/50"++ )}>++ <span className="text-sm font-medium">{aboutT("latestVersion")}</span>++ <div className="flex items-center gap-2">++ {isChecking ? (++ <span className="text-xs text-muted-foreground flex items-center gap-1.5">++ <RefreshCw className="w-3 h-3 animate-spin" />++ {aboutT("checkingUpdate")}++ </span>++ ) : hasUpdate && latestVersion ? (++ <span className="text-sm font-mono tabular-nums text-emerald-500 font-semibold flex items-center gap-1.5">++ <ArrowUpCircle className="w-4 h-4" />++ v{latestVersion}++ </span>++ ) : latestVersion ? (++ <span className="text-sm text-muted-foreground">++ ✓ {aboutT("upToDate")}++ </span>++ ) : (++ <Button++ variant="ghost"++ size="sm"++ className="h-7 px-2 text-xs"++ onClick={checkNow}++ >++ <RefreshCw className="w-3 h-3 mr-1" />++ Check++ </Button>++ )}++ </div>++ </div>++++ {/* Update Available Banner */}++ {hasUpdate && latestVersion && (++ <a++ href={`${GITHUB_URL}/releases`}++ target="_blank"++ rel="noopener noreferrer"++ className="flex items-center gap-3 p-3 rounded-xl bg-emerald-500/10 border border-emerald-500/20 hover:bg-emerald-500/15 transition-colors group"++ >++ <ArrowUpCircle className="w-5 h-5 text-emerald-500 shrink-0" />++ <div className="flex-1 min-w-0">++ <p className="text-sm font-medium text-emerald-600 dark:text-emerald-400">++ {aboutT("updateAvailable")}++ </p>++ <p className="text-xs text-muted-foreground">++ v{APP_VERSION} → v{latestVersion}++ </p>++ </div>++ <ExternalLink className="w-4 h-4 text-emerald-500 group-hover:translate-x-0.5 transition-transform shrink-0" />++ </a>++ )}+ </div>++```++</details>++</tool-use>++---++Now let me also add the version to the root `package.json` so the fetch URL works:++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/package.json</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -1,2 +1,2 @@+- {"name":"openclash-stats","private":true,"workspaces":["apps/*","packages/*"],"packageManager":"[email protected]","scripts":{"build":"turbo build","dev":"turbo dev","lint":"turbo lint"},"devDependencies":{"turbo":"^2.3.0"}}++ {"name":"openclash-stats","version":"1.0.0","private":true,"workspaces":["apps/*","packages/*"],"packageManager":"[email protected]","scripts":{"build":"turbo build","dev":"turbo dev","lint":"turbo lint"},"devDependencies":{"turbo":"^2.3.0"}}++```++</details>++</tool-use>++---++Now let me run lint checks and TypeScript compilation:++---++<tool-use data-tool-type="generic" data-tool-name="read_lints">+<details>+ <summary>Tool use: **read_lints** • Read lints for 12 files</summary>++Lint paths:++- `/Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/hooks/use-version-check.ts`+- `/Users/luolei/DEV/clash-master/apps/web/components/ips-table.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/proxy-stats-chart.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/country-traffic-chart.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/country-traffic-list.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/proxy-top-grid.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/domain-top-grid.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/domain-top-list.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/proxy-top-list.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/overview/top-domains-simple.tsx`+- `/Users/luolei/DEV/clash-master/apps/web/components/overview/top-proxies-simple.tsx`++Lint results+++**No lint errors found**+</details>+</tool-use>++---++<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">+<details><summary>Tool use: **run_terminal_cmd** • Run command: cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -40</summary>++```bash+cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -40+```+</details>+</tool-use>++---++<tool-use data-tool-type="task" data-tool-name="todo_write">+<details><summary>Tool use: **todo_write** • Todo List</summary>++- [x] Unify "Conn" vs "Connections" text across Domain List and IP Addresses+- [x] Unify connection icons across all cards/modules+- [x] Add version check feature: fetch GitHub package.json, show upgrade hint++</details>+</tool-use>++---++所有修改完成,TypeScript 编译通过,无 lint 错误。以下是修改总结:++---++## 修改总结++### 1. 文案统一:「Conn」 vs 「Connections」++**问题**:Domain List 表头用 "Conn",IP Addresses 表头用 "Connections"。++**修复**:将 IP Addresses 表格中所有的 `t("connections")` 统一改为 `t("conn")`,并在翻译文件中添加对应 key:++- **`ips-table.tsx`**:3 处改动(桌面表头、移动端排序栏、移动端统计行)+- **`en.json`**:`ips` 添加 `"conn": "Conn"`+- **`zh.json`**:`ips` 添加 `"conn": "连接"`++### 2. 连接图标统一++**问题**:不同卡片中「连接数」使用了不同图标:+- `Server` (代理卡片)+- `MapPin` (国家卡片)+- `Users` (Top 列表/网格)+- 内联 SVG (概览简化卡片)++**修复**:全部统一使用 `Link2`(链接图标),语义上最贴合"连接"概念。涉及 **10 个组件文件**:++| 组件 | 原图标 | 改为 |+|---|---|---|+| `proxy-stats-chart.tsx` | `Server` | `Link2` |+| `country-traffic-chart.tsx` | `MapPin` | `Link2` |+| `country-traffic-list.tsx` | `MapPin` | `Link2` |+| `proxy-top-grid.tsx` | `Users` (2处) | `Link2` |+| `domain-top-grid.tsx` | `Users` (2处) | `Link2` |+| `domain-top-list.tsx` | `Users` | `Link2` |+| `proxy-top-list.tsx` | `Users` | `Link2` |+| `top-domains-simple.tsx` | 内联SVG | `Link2` |+| `top-proxies-simple.tsx` | 内联SVG | `Link2` |++### 3. 版本检测功能++**新建文件** `apps/web/hooks/use-version-check.ts`:+- 自定义 Hook,从 GitHub 远程仓库的 `package.json` 获取最新版本+- 初次加载后 3 秒检查一次,之后每 30 分钟自动检查+- 10 秒超时,失败静默处理不影响用户体验+- 内置 semver 版本比较逻辑++**`navigation.tsx` 更新**:++- 侧边栏 About 按钮:当检测到新版本时,右侧显示一个**绿色脉冲点 + 版本号**(如 `v1.1.0`)++- About 弹窗增强:+ - 显示「当前版本」和「最新版本」两行+ - 检测中:显示旋转图标 + "正在检查更新..."+ - 已是最新:显示 ✓ + "已是最新版本"+ - 有更新:绿色高亮显示新版本号 + 升级横幅(点击跳转 GitHub Releases)++**`package.json`(根目录)**:添加 `"version": "1.0.0"` 字段,使远程 URL `https://raw.githubusercontent.com/foru17/clash-master/refs/heads/main/package.json` 返回正确的版本信息。++**翻译文件**:`en.json` 和 `zh.json` 新增版本检测相关 key:+- `about.currentVersion` / `about.latestVersion` / `about.updateAvailable` / `about.upToDate` / `about.checkingUpdate` / `about.viewOnGitHub`++---++_**User (2026-02-06 02:27Z)**_++现在我们线上的 package.json 中没有版本号,我们默认初始版本是 1.0.0,那我这次发布是不是应该递增下?++---++_**Agent (model claude-4.6-opus-high-thinking, mode Agent)**_++++---++++++---++<think><details><summary>Thought Process</summary>+The user is asking about version numbering for their release. They mention that the online package.json doesn't have a version number, and the default initial version is 1.0.0. They want to know if they should increment the version for this release.++Let me check the current package.json files to see what versions are set.</details></think>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/package.json</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/package.json</summary>++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+The user is asking whether they should increment the version for this release. Currently both package.json files have version 1.0.0. Since the user mentioned that the online package.json doesn't have a version number yet, and they set the default initial version as 1.0.0, they're asking if they should bump it for the upcoming release.++Given the significant changes made in this session (mobile responsiveness, i18n fixes, About dialog, version check, chart optimizations, UI consistency improvements), this would be a minor version bump at minimum.++Following Semantic Versioning:+- MAJOR (x.0.0): Breaking changes+++- MINOR (0.x.0): New features, backward compatible+- PATCH (0.0.x): Bug fixes++The changes include new features like the About dialog and version check, plus bug fixes for mobile responsiveness, i18n, chart flickering, and layout consistency, so I should bump this to 1.1.0 and update both package.json files accordingly.</details></think>++---++是的,应该递增版本号!根据 **语义化版本规范 (SemVer)**:++- **MAJOR (x.0.0)**:不兼容的 API 修改+- **MINOR (0.x.0)**:向下兼容的功能性新增+- **PATCH (0.0.x)**:向下兼容的问题修正++这次我们做了大量改动,包括:+- ✨ **新功能**:About 弹窗、版本检测+- 🐛 **Bug 修复**:移动端适配、国际化文本修复、图表闪烁+- 💄 **UI 改进**:图标统一、文案一致性、卡片布局优化++这些改动包含了新功能,但没有破坏性变更,建议从 `1.0.0` 递增到 **`1.1.0`**。++帮你更新两个 `package.json`:++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/package.json</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -1,2 +1,2 @@+- {"name":"openclash-stats","version":"1.0.0","private":true,"workspaces":["apps/*","packages/*"],"packageManager":"[email protected]","scripts":{"build":"turbo build","dev":"turbo dev","lint":"turbo lint"},"devDependencies":{"turbo":"^2.3.0"}}++ {"name":"openclash-stats","version":"1.1.0","private":true,"workspaces":["apps/*","packages/*"],"packageManager":"[email protected]","scripts":{"build":"turbo build","dev":"turbo dev","lint":"turbo lint"},"devDependencies":{"turbo":"^2.3.0"}}++```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/package.json</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -1,5 +1,5 @@+ {+ "name": "@clashstats/web",+- "version": "1.0.0",++ "version": "1.1.0",+ "private": true,+ "scripts": {+```++</details>++</tool-use>++---++<tool-use data-tool-type="search" data-tool-name="grep">+<details>+<summary>Tool use: **grep** • Grep for "currentVersion|APP_VERSION|1\.0\.0" in "/Users/luolei/DEV/clash-master/apps/web" • 8 matches</summary>++Output mode: content+++| File | Content | Line |+|------|------|------|+| `apps/web/components/navigation.tsx` | `const APP_VERSION = "1.0.0";` | L37 |+| `apps/web/components/navigation.tsx` | `const \{ latestVersion, hasUpdate, isChecking, checkNow \} = useVersionCheck(APP_VERSION);` | L57 |+| `apps/web/components/navigation.tsx` | `<span className="text-sm font-medium">\{aboutT("currentVersion")\}</span>` | L264 |+| `apps/web/components/navigation.tsx` | `v\{APP_VERSION\}` | L266 |+| `apps/web/components/navigation.tsx` | `v\{APP_VERSION\} → v\{latestVersion\}` | L321 |+| `apps/web/hooks/use-version-check.ts` | `export function useVersionCheck(currentVersion: string): VersionCheckResult \{` | L35 |+| `apps/web/hooks/use-version-check.ts` | `setHasUpdate(compareVersions(currentVersion, pkg.version) > 0);` | L61 |+| `apps/web/hooks/use-version-check.ts` | `\}, [currentVersion]);` | L68 |+++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+The `APP_VERSION` in `navigation.tsx` is hardcoded as "1.0.0". I should update this to "1.1.0" as well, or better yet, make it read from package.json dynamically. Let me check how this is set up.++Actually, let me just update the hardcoded version for now. In a production setup, you'd typically read from package.json, but for now let's keep it consistent.++Wait, actually it would be much better to import the version from package.json. Let me check if that's feasible in Next.js.++In Next.js, you can import from package.json like:+++I'm importing the version directly from package.json and assigning it to the APP_VERSION constant, which keeps everything in sync automatically.</details></think>++---++发现 `navigation.tsx` 中的版本号是硬编码的 `"1.0.0"`,最好让它自动从 `package.json` 读取,这样以后只需要改一处就行了:++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: undefined++```diff+@@ -29,4 +29,5 @@+ } from "@/components/ui/dialog";+ import { useVersionCheck } from "@/hooks/use-version-check";++ import packageJson from "../package.json";++ interface NavigationProps {+```++**Chunk 2**+Lines added: 1, lines removed: 1++```diff+@@ -35,5 +36,5 @@+ }++- const APP_VERSION = "1.0.0";++ const APP_VERSION = packageJson.version;+ const GITHUB_URL = "https://github.com/foru17/clash-master";++```++</details>++</tool-use>++---++<tool-use data-tool-type="generic" data-tool-name="read_lints">+<details>+ <summary>Tool use: **read_lints** • Read lints for 1 file</summary>++Lint paths:++- `/Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx`++Lint results+++**No lint errors found**+</details>+</tool-use>++---++<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">+<details><summary>Tool use: **run_terminal_cmd** • Run command: cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -20</summary>++```bash+cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -20+```+</details>+</tool-use>++---++编译通过,没有问题。现在做了以下更新:++1. **根目录 `package.json`**:`1.0.0` → `1.1.0`+2. **`apps/web/package.json`**:`1.0.0` → `1.1.0`+3. **`navigation.tsx`**:版本号不再硬编码,改为从 `package.json` 动态读取,以后升版只需要改 `apps/web/package.json` 一处即可。++---++关于版本号的建议,后续你可以这样规划:++| 版本 | 场景 |+|------|------|+| `1.1.0` | 本次发布(新增 About、版本检测、i18n 修复、UI 优化) |+| `1.1.1` | 后续小 bug 修复 |+| `1.2.0` | 下次新增功能 |+| `2.0.0` | 如果有重大架构变更或不兼容改动 |++发布时可以配合 GitHub Release 打 tag(如 `v1.1.0`),方便版本检测功能对比线上最新版本。++---++_**User (2026-02-06 02:27Z)**_++从 1.0.0 跳到 1.1.0 这样太大了,我还会频繁发布,这样会导致版本顺序上升。另外+我希望在 About 的 Github 仓库后面,可以再展示下当前我这个项目的 Star 的数量,应该有对应的接口或者在线的 api 提供这个展示)++---++_**Agent (model claude-4.6-opus-high-thinking, mode Agent)**_++++++---++<think><details><summary>Thought Process</summary>+The user has two requests:++1. Version numbering: They think jumping from 1.0.0 to 1.1.0 is too big for frequent releases. They want smaller increments. I should suggest using patch versions like 1.0.1, 1.0.2, etc. for frequent releases.++2. Show GitHub stars count in the About dialog: They want to display the star count for the GitHub repo. I can use the GitHub API: `https://api.github.com/repos/foru17/clash-master` which returns `stargazers_count`.++Let me first update the version to 1.0.1, then work on adding the GitHub stars feature.+++Now I need to examine the About dialog structure to see where I can integrate the GitHub stars display.</details></think>++---++<tool-use data-tool-type="task" data-tool-name="todo_write">+<details><summary>Tool use: **todo_write** • Todo List</summary>++- [-] 版本号改为 1.0.1(patch 级别递增)+- [ ] About 弹窗中展示 GitHub Star 数量++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/messages/en.json</summary>++</details>+</tool-use>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/messages/zh.json</summary>++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+Now let me plan the changes:++1. **Version**: Change from 1.1.0 to 1.0.1 (patch level increment for frequent releases)+2. **GitHub Stars**: Add a star count display in the About dialog, fetched from GitHub API (`https://api.github.com/repos/foru17/clash-master`)++For the GitHub stars, I can either:+- Fetch it in the `useVersionCheck` hook (since it already fetches from GitHub)+- Create a separate hook+- Fetch it directly in the navigation component++I think the cleanest approach is to add it to the `useVersionCheck` hook since we're already making a GitHub-related API call there.++I'll check the GitHub API endpoint directly since it provides the stargazers count along with other repo metadata, then examine the current `useVersionCheck` hook to see how best to integrate this.</details></think>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/hooks/use-version-check.ts</summary>++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+Now I have a clear picture. Let me:++1. Change version from 1.1.0 to 1.0.1 in both package.json files+2. Add GitHub stars fetching - I'll extend the `useVersionCheck` hook to also fetch the star count from the GitHub API (`https://api.github.com/repos/foru17/clash-master`), or create a separate small hook. I think adding it to the existing hook makes sense since both are GitHub-related data.+3. Display the star count in the About dialog next to the GitHub link.++Let me also add translation keys for "stars" if needed.+++Now I'm implementing these changes across the codebase.</details></think>++---++好的,两个改动:+1. 版本号改为 `1.0.1`(用 patch 级别递增,适合频繁发布)+2. About 弹窗中展示 GitHub Star 数量(通过 GitHub API `https://api.github.com/repos/foru17/clash-master` 获取 `stargazers_count`)++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/package.json</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -1,2 +1,2 @@+- {"name":"openclash-stats","version":"1.1.0","private":true,"workspaces":["apps/*","packages/*"],"packageManager":"[email protected]","scripts":{"build":"turbo build","dev":"turbo dev","lint":"turbo lint"},"devDependencies":{"turbo":"^2.3.0"}}++ {"name":"openclash-stats","version":"1.0.1","private":true,"workspaces":["apps/*","packages/*"],"packageManager":"[email protected]","scripts":{"build":"turbo build","dev":"turbo dev","lint":"turbo lint"},"devDependencies":{"turbo":"^2.3.0"}}++```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/package.json</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -1,5 +1,5 @@+ {+ "name": "@clashstats/web",+- "version": "1.1.0",++ "version": "1.0.1",+ "private": true,+ "scripts": {+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="write">++<details><summary>Tool use: **write** • Edit file: /Users/luolei/DEV/clash-master/apps/web/hooks/use-version-check.ts</summary>++**Chunk 1**+Lines added: 2, lines removed: undefined++```diff+@@ -5,4 +5,6 @@+ const GITHUB_PACKAGE_URL =+ "https://raw.githubusercontent.com/foru17/clash-master/refs/heads/main/package.json";++ const GITHUB_API_URL =++ "https://api.github.com/repos/foru17/clash-master";+ const CHECK_INTERVAL = 30 * 60 * 1000; // Check every 30 minutes+ const FETCH_TIMEOUT = 10000; // 10 seconds+```++**Chunk 2**+Lines added: 2, lines removed: undefined++```diff+@@ -29,4 +31,6 @@+ /** Whether the check is currently in progress */+ isChecking: boolean;++ /** GitHub stars count, null if not yet fetched or failed */++ stars: number | null;+ /** Manually trigger a version check */+ checkNow: () => void;+```++**Chunk 3**+Lines added: 1, lines removed: undefined++```diff+@@ -37,4 +41,5 @@+ const [hasUpdate, setHasUpdate] = useState(false);+ const [isChecking, setIsChecking] = useState(false);++ const [stars, setStars] = useState<number | null>(null);++ const check = useCallback(async () => {+```++**Chunk 4**+Lines added: 27, lines removed: 14++```diff+@@ -44,21 +49,34 @@+ const timeoutId = setTimeout(() => controller.abort(), FETCH_TIMEOUT);++- const res = await fetch(GITHUB_PACKAGE_URL, {+- cache: "no-store",+- signal: controller.signal,+- });++ // Fetch version and stars in parallel++ const [pkgRes, repoRes] = await Promise.allSettled([++ fetch(GITHUB_PACKAGE_URL, {++ cache: "no-store",++ signal: controller.signal,++ }),++ fetch(GITHUB_API_URL, {++ cache: "no-store",++ signal: controller.signal,++ }),++ ]);++ clearTimeout(timeoutId);++- if (!res.ok) {+- setIsChecking(false);+- return;+- }+-+- const pkg = await res.json();+- if (pkg.version) {+- setLatestVersion(pkg.version);+- setHasUpdate(compareVersions(currentVersion, pkg.version) > 0);+- }++ // Handle version check++ if (pkgRes.status === "fulfilled" && pkgRes.value.ok) {++ const pkg = await pkgRes.value.json();++ if (pkg.version) {++ setLatestVersion(pkg.version);++ setHasUpdate(compareVersions(currentVersion, pkg.version) > 0);++ }++ }++++ // Handle stars count++ if (repoRes.status === "fulfilled" && repoRes.value.ok) {++ const repo = await repoRes.value.json();++ if (typeof repo.stargazers_count === "number") {++ setStars(repo.stargazers_count);++ }++ }+ } catch {+ // Silently fail — network errors, timeouts, CORS issues, etc.+```++**Chunk 5**+Lines added: 1, lines removed: 1++```diff+@@ -81,5 +99,5 @@+ }, [check]);++- return { latestVersion, hasUpdate, isChecking, checkNow: check };++ return { latestVersion, hasUpdate, isChecking, stars, checkNow: check };+ }++```++</details>++</tool-use>++---++现在更新 `navigation.tsx`,解构出 `stars`,并在 About 弹窗的 GitHub 链接旁展示 Star 数量:++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++**Chunk 1**+Lines added: 1, lines removed: 1++```diff+@@ -56,5 +56,5 @@+ const backendT = useTranslations("backend");+ const aboutT = useTranslations("about");+- const { latestVersion, hasUpdate, isChecking, checkNow } = useVersionCheck(APP_VERSION);++ const { latestVersion, hasUpdate, isChecking, stars, checkNow } = useVersionCheck(APP_VERSION);++ return (+```++</details>++</tool-use>++---++Now update the GitHub link section in the About dialog to show the star count:++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++**Chunk 1**+Lines added: 14, lines removed: 4++```diff+@@ -342,13 +342,23 @@+ >+ <div className="flex items-center gap-3">+- <svg viewBox="0 0 24 24" className="w-5 h-5 fill-foreground" aria-hidden="true">++ <svg viewBox="0 0 24 24" className="w-5 h-5 fill-foreground shrink-0" aria-hidden="true">+ <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />+ </svg>+- <div>++ <div className="min-w-0">+ <p className="text-sm font-medium">{aboutT("openSource")}</p>+- <p className="text-xs text-muted-foreground">{GITHUB_URL}</p>++ <p className="text-xs text-muted-foreground truncate">{GITHUB_URL}</p>+ </div>+ </div>+- <ExternalLink className="w-4 h-4 text-muted-foreground group-hover:text-primary transition-colors" />++ <div className="flex items-center gap-2 shrink-0">++ {stars !== null && (++ <span className="flex items-center gap-1 text-xs font-medium text-amber-500 bg-amber-500/10 px-2 py-1 rounded-full">++ <svg viewBox="0 0 16 16" className="w-3.5 h-3.5 fill-amber-500" aria-hidden="true">++ <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25z" />++ </svg>++ {stars >= 1000 ? `${(stars / 1000).toFixed(1)}k` : stars}++ </span>++ )}++ <ExternalLink className="w-4 h-4 text-muted-foreground group-hover:text-primary transition-colors" />++ </div>+ </a>+ </div>+```++</details>++</tool-use>++---++<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">+<details><summary>Tool use: **run_terminal_cmd** • Run command: cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -20</summary>++```bash+cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -20+```+</details>+</tool-use>++---++<tool-use data-tool-type="task" data-tool-name="todo_write">+<details><summary>Tool use: **todo_write** • Todo List</summary>++- [x] 版本号改为 1.0.1(patch 级别递增)+- [x] About 弹窗中展示 GitHub Star 数量++</details>+</tool-use>++---++TypeScript 编译通过,所有改动完成。总结一下:++### 1. 版本号调整+- **根目录 `package.json`** 和 **`apps/web/package.json`**:`1.1.0` → `1.0.1`+- 后续频繁发布建议:`1.0.1` → `1.0.2` → `1.0.3` ...,有较大功能更新时再升 minor(如 `1.1.0`)++### 2. GitHub Star 展示+- 在 `useVersionCheck` hook 中增加了对 GitHub API (`https://api.github.com/repos/foru17/clash-master`) 的请求,获取 `stargazers_count`+- 版本检测和 Star 数量**并行请求**(`Promise.allSettled`),互不阻塞,任一失败不影响另一个+- About 弹窗中 GitHub 链接右侧展示 ⭐ Star 数量,带星标图标和金色徽章样式+- 超过 1000 会显示为 `1.2k` 格式,美观简洁++效果大致如下:++```+┌─────────────────────────────────────┐+│ 🔗 开源项目 ⭐ 42 →│+│ https://github.com/foru17/clash... │+└─────────────────────────────────────┘+```++---++_**User (2026-02-06 02:27Z)**_++现在还有一个问题,我点击 about之后,当这个 star 的标签第一次请求和渲染之后,弹窗会出现晃动,似乎是渲染的高度导致的,需要优化这里的问题++---++_**Agent (model claude-4.6-opus-high-thinking, mode Agent)**_++++++---++<think><details><summary>Thought Process</summary>+The user is saying that when they click "About", the dialog shakes/jumps after the star count loads because the height changes when the star badge renders. This is a classic layout shift issue - the GitHub link section changes height when the star count appears.++Let me look at the current implementation to understand the layout and fix it.++The issue is in the GitHub link area in `navigation.tsx`. When `stars` is initially `null`, the star badge isn't rendered. Then when the API returns data, the badge appears and causes a layout shift.++Solutions:+1. Reserve space for the star badge even when loading (use a fixed min-height or a placeholder)+2. Set a fixed height for the dialog content+++3. Use a skeleton/placeholder for the star count while loading++I think the cleanest fix is to reserve space for the badge by always rendering the container with a consistent height, whether it's showing a loading state or the actual star count. Let me check the current navigation.tsx code to see how it's structured.</details></think>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+The issue is that when `stars` is `null`, the star badge isn't rendered at all. When the API returns, the badge appears and causes the dialog to change height, leading to a visual "shake".++The fix is to always reserve space for the star badge. I can either:+1. Always render the star badge container with a fixed size, showing a skeleton/placeholder when loading+2. Use `visibility: invisible` instead of conditional rendering++The cleanest approach: always render the star badge area with the same dimensions. When stars is null and we're still checking, show a subtle loading placeholder. When stars is loaded, show the actual count. This way the layout never shifts.+++I should focus on the star badge since that's what the user mentioned, though I'll keep in mind the version check section might have a similar issue. I'll implement the star badge with a persistent placeholder that swaps in the actual count once it loads.</details></think>++---++问题很清楚——Star 数量是异步加载的,初始为 `null` 时不渲染,数据返回后才出现徽章,导致弹窗高度突变产生晃动。解决方案是始终预留 Star 徽章的空间,加载中显示骨架占位符。++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++**Chunk 1**+Lines added: 14, lines removed: 8++```diff+@@ -351,12 +351,18 @@+ </div>+ <div className="flex items-center gap-2 shrink-0">+- {stars !== null && (+- <span className="flex items-center gap-1 text-xs font-medium text-amber-500 bg-amber-500/10 px-2 py-1 rounded-full">+- <svg viewBox="0 0 16 16" className="w-3.5 h-3.5 fill-amber-500" aria-hidden="true">+- <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25z" />+- </svg>+- {stars >= 1000 ? `${(stars / 1000).toFixed(1)}k` : stars}+- </span>+- )}++ <span className="flex items-center gap-1 text-xs font-medium px-2 py-1 rounded-full min-w-[3rem] justify-center h-6">++ {stars !== null ? (++ <>++ <svg viewBox="0 0 16 16" className="w-3.5 h-3.5 fill-amber-500 shrink-0" aria-hidden="true">++ <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25z" />++ </svg>++ <span className="text-amber-500 bg-amber-500/10 px-1.5 py-0.5 rounded-full">++ {stars >= 1000 ? `${(stars / 1000).toFixed(1)}k` : stars}++ </span>++ </>++ ) : (++ <span className="w-8 h-4 bg-secondary/80 rounded animate-pulse" />++ )}++ </span>+ <ExternalLink className="w-4 h-4 text-muted-foreground group-hover:text-primary transition-colors" />+ </div>+```++</details>++</tool-use>++---++<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">+<details><summary>Tool use: **run_terminal_cmd** • Run command: cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -20</summary>++```bash+cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -20+```+</details>+</tool-use>++---++编译通过。核心改动:++**之前**:`stars === null` 时整个徽章不渲染 → 数据返回后突然出现 → 弹窗高度变化 → 晃动++**现在**:Star 徽章区域**始终占位**(固定 `h-6`、`min-w-[3rem]`):+- **加载中**:显示一个灰色脉冲骨架动画(`animate-pulse`),与最终徽章占位相同+- **加载完成**:平滑替换为真实的 ⭐ 数字++这样弹窗打开时布局就是稳定的,不会因为异步数据返回导致高度跳变。++---++_**User (2026-02-06 02:27Z)**_++现在还是有这个问题,当我点击检查版本的按钮的时候 Check 也会导致窗口晃动++---++_**Agent (model claude-4.6-opus-high-thinking, mode Agent)**_++++++---++<think><details><summary>Thought Process</summary>+The user is saying that when clicking the "Check" button (for version check), the dialog also shakes/shifts. Let me look at the version check section of the About dialog more carefully.</details></think>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+The problem is clear. The "Latest Version" row has different heights depending on the state:+1. When `isChecking` - shows "Checking for updates..." text+2. When `hasUpdate && latestVersion` - shows version with ArrowUpCircle icon+3. When `latestVersion` (but no update) - shows "✓ Up to date"+4. When no `latestVersion` - shows a "Check" Button++These all have different heights and widths. And then additionally, when `hasUpdate && latestVersion`, there's the "Update Available Banner" that appears/disappears, changing the dialog height.+++I also notice the "Check" button text is hardcoded in English instead of using i18n. The main fix is to give the right side of the "Latest Version" row a fixed height matching the button so state changes don't cause layout shifts, and I should replace the hardcoded text with proper localization. The "Update Available Banner" appearing will still cause a shift, but that's acceptable UX since it's a new element—though I could smooth the transition or reserve space to mitigate it.</details></think>++---++问题在于版本检测区域的右侧内容在不同状态间切换时(Check 按钮 → 检查中 → 结果),每个状态的尺寸不同导致布局跳动。需要固定右侧区域的高度。++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++**Chunk 1**+Lines added: 2, lines removed: 2++```diff+@@ -271,11 +271,11 @@+ {/* Latest Version / Update Status */}+ <div className={cn(+- "flex items-center justify-between p-3 rounded-xl border",++ "flex items-center justify-between p-3 rounded-xl border min-h-[3rem]",+ hasUpdate+ ? "bg-emerald-500/5 border-emerald-500/20"+ : "bg-secondary/50 border-border/50"+ )}>+ <span className="text-sm font-medium">{aboutT("latestVersion")}</span>+- <div className="flex items-center gap-2">++ <div className="flex items-center gap-2 h-7 min-w-[5.5rem] justify-end">+ {isChecking ? (+ <span className="text-xs text-muted-foreground flex items-center gap-1.5">+```++**Chunk 2**+Lines added: 1, lines removed: 1++```diff+@@ -300,5 +300,5 @@+ >+ <RefreshCw className="w-3 h-3 mr-1" />+- Check++ {aboutT("checkNow")}+ </Button>+ )}+```++**Chunk 3**+Lines added: 24, lines removed: 19++```diff+@@ -307,23 +307,28 @@++ {/* Update Available Banner */}+- {hasUpdate && latestVersion && (+- <a+- href={`${GITHUB_URL}/releases`}+- target="_blank"+- rel="noopener noreferrer"+- className="flex items-center gap-3 p-3 rounded-xl bg-emerald-500/10 border border-emerald-500/20 hover:bg-emerald-500/15 transition-colors group"+- >+- <ArrowUpCircle className="w-5 h-5 text-emerald-500 shrink-0" />+- <div className="flex-1 min-w-0">+- <p className="text-sm font-medium text-emerald-600 dark:text-emerald-400">+- {aboutT("updateAvailable")}+- </p>+- <p className="text-xs text-muted-foreground">+- v{APP_VERSION} → v{latestVersion}+- </p>+- </div>+- <ExternalLink className="w-4 h-4 text-emerald-500 group-hover:translate-x-0.5 transition-transform shrink-0" />+- </a>+- )}++ <div className={cn(++ "grid transition-all duration-200 ease-in-out",++ hasUpdate && latestVersion ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"++ )}>++ <div className="overflow-hidden">++ <a++ href={`${GITHUB_URL}/releases`}++ target="_blank"++ rel="noopener noreferrer"++ className="flex items-center gap-3 p-3 rounded-xl bg-emerald-500/10 border border-emerald-500/20 hover:bg-emerald-500/15 transition-colors group"++ >++ <ArrowUpCircle className="w-5 h-5 text-emerald-500 shrink-0" />++ <div className="flex-1 min-w-0">++ <p className="text-sm font-medium text-emerald-600 dark:text-emerald-400">++ {aboutT("updateAvailable")}++ </p>++ <p className="text-xs text-muted-foreground">++ v{APP_VERSION} → v{latestVersion}++ </p>++ </div>++ <ExternalLink className="w-4 h-4 text-emerald-500 group-hover:translate-x-0.5 transition-transform shrink-0" />++ </a>++ </div>++ </div>+ </div>++```++</details>++</tool-use>++---++现在添加 "Check" 按钮的翻译 key:++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/messages/en.json</summary>++**Chunk 1**+Lines added: 2, lines removed: 1++```diff+@@ -187,5 +187,6 @@+ "updateAvailable": "Update Available",+ "upToDate": "Up to date",+- "checkingUpdate": "Checking for updates...",++ "checkingUpdate": "Checking...",++ "checkNow": "Check",+ "viewOnGitHub": "View on GitHub"+ },+```++</details>++</tool-use>++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/messages/zh.json</summary>++**Chunk 1**+Lines added: 2, lines removed: 1++```diff+@@ -187,5 +187,6 @@+ "updateAvailable": "有新版本",+ "upToDate": "已是最新版本",+- "checkingUpdate": "正在检查更新...",++ "checkingUpdate": "检查中...",++ "checkNow": "检查",+ "viewOnGitHub": "在 GitHub 查看"+ },+```++</details>++</tool-use>++---++<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">+<details><summary>Tool use: **run_terminal_cmd** • Run command: cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -20</summary>++```bash+cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -20+```+</details>+</tool-use>++---++编译通过。做了以下修复:++### 防止版本检测区域晃动++1. **右侧状态区域固定尺寸**:加了 `h-7 min-w-[5.5rem] justify-end`,不论是 "Check" 按钮、"检查中..." 还是结果展示,都在固定的空间内渲染,避免状态切换时尺寸变化。++2. **外层行固定最小高度**:加了 `min-h-[3rem]`,保证整行高度一致。++3. **更新提示横幅平滑过渡**:之前用的是 `{hasUpdate && ...}` 条件渲染,会导致突然出现/消失。改为 CSS `grid-rows` 动画(`grid-rows-[0fr]` → `grid-rows-[1fr]`),配合 `opacity` 和 `transition-all duration-200`,实现平滑展开效果。++4. **顺手修复**:把硬编码的 "Check" 按钮文字改为 `aboutT("checkNow")`,中文下显示为"检查";同时缩短了 "Checking for updates..." 为 "Checking..." / "检查中...",减少文字长度波动。++---++_**User (2026-02-06 02:27Z)**_++现在这个窗口中这四个小模板的间距不一致,感觉很别扭,不符合视觉设计的规范,优化这个问题。++---++_**Agent (model claude-4.6-opus-high-thinking, mode Agent)**_++++++---++<think><details><summary>Thought Process</summary>+The user is pointing out that the four sections in the About dialog have inconsistent spacing. Looking at the screenshot:++1. App Info (Clash Master + description)+2. Version Info (Current Version + Latest Version)+3. License (MIT License)+4. GitHub Link (Open Source Project)++The spacing between these sections looks uneven. Let me check the current code.</details></think>++---++<tool-use data-tool-type="read" data-tool-name="read_file">+<details><summary>Tool use: **read_file** • Read file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++</details>+</tool-use>++---++<think><details><summary>Thought Process</summary>+Looking at the screenshot and code, the issue is clear. The four sections use `space-y-6` on the parent container, but:++1. **App Info** - standalone section+2. **Version Info** - wrapped in its own `<div className="space-y-2">` which includes Current Version, Latest Version, and Update Banner+3. **License** - standalone section+4. **GitHub Link** - standalone section++The problem is that `space-y-6` creates 1.5rem (24px) gaps between all four top-level children. But visually:+- The gap between App Info and Version Info section looks correct (larger)+++- The gap between Version Info and License is 24px, and between License and GitHub is also 24px, but on the screenshot the gap between "Latest Version" and "MIT License" appears much larger than the 8px spacing within the Version Info group itself. This creates an awkward visual inconsistency.++The fix is to group all the row-like items (Current Version, Latest Version, License, GitHub) together with uniform spacing, while keeping App Info separated at the top with a larger gap.++I'm restructuring this so App Info sits at the top with a bigger bottom margin, then all the card rows below it use consistent `space-y-2` spacing throughout—merging the Version section's internal spacing with License and GitHub into one cohesive group.</details></think>++---++从截图看出来了,问题在于布局结构:外层用 `space-y-6`(24px 间距),但版本信息内部用 `space-y-2`(8px 间距),导致 Current Version 和 Latest Version 之间很紧凑,而 Latest Version 和 MIT License 之间间距大了很多,视觉上参差不齐。++解决方案:把所有卡片行放到同一个 `space-y-2` 组中,App Info 单独和卡片组之间用稍大间距分隔。++---++<tool-use data-tool-type="write" data-tool-name="search_replace">++<details><summary>Tool use: **search_replace** • Edit file: /Users/luolei/DEV/clash-master/apps/web/components/navigation.tsx</summary>++**Chunk 1**+Lines added: 2, lines removed: 2++```diff+@@ -239,7 +239,7 @@+ </DialogTitle>+ </DialogHeader>+- <div className="space-y-6 py-4">++ <div className="py-4">+ {/* App Info */}+- <div className="flex items-center gap-4">++ <div className="flex items-center gap-4 mb-4">+ <div className="w-16 h-16 rounded-2xl bg-primary/10 flex items-center justify-center overflow-hidden shrink-0">+ <Image+```++**Chunk 2**+Lines added: 1, lines removed: 1++```diff+@@ -259,5 +259,5 @@+ </div>++- {/* Version Info */}++ {/* All card rows with consistent spacing */}+ <div className="space-y-2">+ {/* Current Version */}+```++**Chunk 3**+Lines added: 40, lines removed: 40++```diff+@@ -331,46 +331,46 @@+ </div>+ </div>+- </div>++- {/* License */}+- <div className="flex items-center justify-between p-3 rounded-xl bg-secondary/50 border border-border/50">+- <span className="text-sm font-medium">{aboutT("license")}</span>+- <span className="text-sm text-muted-foreground">MIT</span>+- </div>++ {/* License */}++ <div className="flex items-center justify-between p-3 rounded-xl bg-secondary/50 border border-border/50">++ <span className="text-sm font-medium">{aboutT("license")}</span>++ <span className="text-sm text-muted-foreground">MIT</span>++ </div>++- {/* GitHub Link */}+- <a+- href={GITHUB_URL}+- target="_blank"+- rel="noopener noreferrer"+- className="flex items-center justify-between p-3 rounded-xl bg-secondary/50 border border-border/50 hover:bg-secondary/80 hover:border-primary/30 transition-all group"+- >+- <div className="flex items-center gap-3">+- <svg viewBox="0 0 24 24" className="w-5 h-5 fill-foreground shrink-0" aria-hidden="true">+- <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />+- </svg>+- <div className="min-w-0">+- <p className="text-sm font-medium">{aboutT("openSource")}</p>+- <p className="text-xs text-muted-foreground truncate">{GITHUB_URL}</p>+- </div>+- </div>+- <div className="flex items-center gap-2 shrink-0">+- <span className="flex items-center gap-1 text-xs font-medium px-2 py-1 rounded-full min-w-[3rem] justify-center h-6">+- {stars !== null ? (+- <>+- <svg viewBox="0 0 16 16" className="w-3.5 h-3.5 fill-amber-500 shrink-0" aria-hidden="true">+- <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25z" />+- </svg>+- <span className="text-amber-500 bg-amber-500/10 px-1.5 py-0.5 rounded-full">+- {stars >= 1000 ? `${(stars / 1000).toFixed(1)}k` : stars}+- </span>+- </>+- ) : (+- <span className="w-8 h-4 bg-secondary/80 rounded animate-pulse" />+- )}+- </span>+- <ExternalLink className="w-4 h-4 text-muted-foreground group-hover:text-primary transition-colors" />+- </div>+- </a>++ {/* GitHub Link */}++ <a++ href={GITHUB_URL}++ target="_blank"++ rel="noopener noreferrer"++ className="flex items-center justify-between p-3 rounded-xl bg-secondary/50 border border-border/50 hover:bg-secondary/80 hover:border-primary/30 transition-all group"++ >++ <div className="flex items-center gap-3">++ <svg viewBox="0 0 24 24" className="w-5 h-5 fill-foreground shrink-0" aria-hidden="true">++ <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />++ </svg>++ <div className="min-w-0">++ <p className="text-sm font-medium">{aboutT("openSource")}</p>++ <p className="text-xs text-muted-foreground truncate">{GITHUB_URL}</p>++ </div>++ </div>++ <div className="flex items-center gap-2 shrink-0">++ <span className="flex items-center gap-1 text-xs font-medium px-2 py-1 rounded-full min-w-[3rem] justify-center h-6">++ {stars !== null ? (++ <>++ <svg viewBox="0 0 16 16" className="w-3.5 h-3.5 fill-amber-500 shrink-0" aria-hidden="true">++ <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25z" />++ </svg>++ <span className="text-amber-500 bg-amber-500/10 px-1.5 py-0.5 rounded-full">++ {stars >= 1000 ? `${(stars / 1000).toFixed(1)}k` : stars}++ </span>++ </>++ ) : (++ <span className="w-8 h-4 bg-secondary/80 rounded animate-pulse" />++ )}++ </span>++ <ExternalLink className="w-4 h-4 text-muted-foreground group-hover:text-primary transition-colors" />++ </div>++ </a>++ </div>+ </div>+ </DialogContent>+```++</details>++</tool-use>++---++<tool-use data-tool-type="shell" data-tool-name="run_terminal_cmd">+<details><summary>Tool use: **run_terminal_cmd** • Run command: cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -20</summary>++```bash+cd /Users/luolei/DEV/clash-master/apps/web && ./node_modules/.bin/tsc --noEmit 2>&1 | head -20+```+</details>+</tool-use>++---++编译通过。改动说明:++**之前的布局结构**(间距不一致):+```+space-y-6(24px)+├── App Info+├── space-y-2(8px) ← 版本组内部 8px+│ ├── Current Version+│ └── Latest Version+├── License ← 距上方 24px ❌ 差异大+└── GitHub Link ← 距上方 24px ❌ 差异大+```++**现在的布局结构**(间距统一):+```+├── App Info(mb-4,底部 16px 间距,与卡片区分隔)+└── space-y-2(8px) ← 所有卡片统一 8px 间距+ ├── Current Version+ ├── Latest Version+ ├── (Update Banner)+ ├── License ← 距上方 8px ✅+ └── GitHub Link ← 距上方 8px ✅+```++四张卡片现在都在同一个 `space-y-2` 容器中,间距完全一致(8px),只有顶部 App Info 用 `mb-4` 稍大间距与卡片区域做视觉分隔。++---+diff --git a/apps/web/components/country-top-list.tsx b/apps/web/components/country-top-list.tsxindex 7642ea3..af3f3f8 100644--- a/apps/web/components/country-top-list.tsx+++ b/apps/web/components/country-top-list.tsx@@ -2,6 +2,7 @@import { useMemo } from "react";import { MapPin } from "lucide-react";+import { useTranslations } from "next-intl";import { OverviewCard } from "./overview-card";import { TopListItem } from "./top-list-item";import { Button } from "@/components/ui/button";@@ -36,6 +37,9 @@ function getContinentColor(continent: string): string {}export function CountryTopList({ data, limit = 7, onViewAll }: CountryTopListProps) {+ const t = useTranslations("topCountries");+ const countriesT = useTranslations("countries");+const { countries, totalTraffic } = useMemo(() => {if (!data) return { countries: [], totalTraffic: 0 };const list = data@@ -53,9 +57,9 @@ export function CountryTopList({ data, limit = 7, onViewAll }: CountryTopListProif (countries.length === 0) {return (- <OverviewCard title="Top 国家/地区" icon={<MapPin className="w-4 h-4" />}>+ <OverviewCard title={t("title")} icon={<MapPin className="w-4 h-4" />}><div className="py-8 text-center text-sm text-muted-foreground">- 暂无数据+ {countriesT("noData")}</div></OverviewCard>);@@ -63,12 +67,12 @@ export function CountryTopList({ data, limit = 7, onViewAll }: CountryTopListProreturn (<OverviewCard- title="Top 国家/地区"+ title={t("title")}icon={<MapPin className="w-4 h-4" />}footer={onViewAll && (<Button variant="ghost" size="sm" className="w-full h-9 text-xs" onClick={onViewAll}>- 查看全部+ {t("viewAll")}</Button>)}diff --git a/apps/web/components/country-traffic-chart.tsx b/apps/web/components/country-traffic-chart.tsxindex fc09c14..69f2b85 100644--- a/apps/web/components/country-traffic-chart.tsx+++ b/apps/web/components/country-traffic-chart.tsx@@ -2,7 +2,8 @@import { useMemo } from "react";import { PieChart, Pie, Cell, ResponsiveContainer, Tooltip } from "recharts";-import { Globe, MapPin } from "lucide-react";+import { Globe, Link2 } from "lucide-react";+import { useTranslations } from "next-intl";import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";import { formatBytes } from "@/lib/utils";import type { CountryStats } from "@clashstats/shared";@@ -56,6 +57,9 @@ function getContinentColor(continent: string): string {}export function CountryTrafficChart({ data }: CountryTrafficChartProps) {+ const t = useTranslations("countries");+ const mapT = useTranslations("map");+const chartData = useMemo(() => {if (!data) return [];return data.map((country) => ({@@ -86,19 +90,19 @@ export function CountryTrafficChart({ data }: CountryTrafficChartProps) {</div><div className="space-y-1 text-xs"><div className="flex justify-between gap-4">- <span className="text-muted-foreground">Total:</span>+ <span className="text-muted-foreground">{mapT("total")}:</span><span className="font-medium">{formatBytes(item.value)}</span></div><div className="flex justify-between gap-4">- <span className="text-blue-500">↓ Download:</span>+ <span className="text-blue-500">↓ {mapT("download")}:</span><span>{formatBytes(item.download)}</span></div><div className="flex justify-between gap-4">- <span className="text-purple-500">↑ Upload:</span>+ <span className="text-purple-500">↑ {mapT("upload")}:</span><span>{formatBytes(item.upload)}</span></div><div className="flex justify-between gap-4">- <span className="text-emerald-500">Connections:</span>+ <span className="text-emerald-500">{mapT("connections")}:</span><span>{item.connections.toLocaleString()}</span></div></div>@@ -113,7 +117,7 @@ export function CountryTrafficChart({ data }: CountryTrafficChartProps) {<CardHeader className="pb-2"><CardTitle className="text-lg font-semibold flex items-center gap-2"><Globe className="h-5 w-5 text-primary" />- Country Traffic Distribution+ {t("distribution")}</CardTitle></CardHeader><CardContent className="space-y-6">@@ -189,8 +193,8 @@ export function CountryTrafficChart({ data }: CountryTrafficChartProps) {{/* Connections */}<div className="flex items-center gap-1 text-xs text-muted-foreground">- <MapPin className="w-3 h-3" />- <span>{item.connections.toLocaleString()} conn</span>+ <Link2 className="w-3 h-3" />+ <span>{item.connections.toLocaleString()} {t("connections")}</span></div></div></div>@@ -200,7 +204,7 @@ export function CountryTrafficChart({ data }: CountryTrafficChartProps) {{/* Legend */}<div className="flex flex-wrap gap-3 text-xs text-muted-foreground pt-2 border-t border-border">- <span className="font-medium">大洲:</span>+ <span className="font-medium">{t("continents")}</span>{Object.entries(CONTINENT_COLORS).filter(([key]) => key !== "Unknown" && key !== "LOCAL").map(([continent, color]) => (diff --git a/apps/web/components/country-traffic-list.tsx b/apps/web/components/country-traffic-list.tsxindex 8cffe0b..b92f026 100644--- a/apps/web/components/country-traffic-list.tsx+++ b/apps/web/components/country-traffic-list.tsx@@ -1,7 +1,7 @@"use client";import { useMemo } from "react";-import { MapPin, ArrowDown, ArrowUp } from "lucide-react";+import { Link2, ArrowDown, ArrowUp } from "lucide-react";import { formatBytes } from "@/lib/utils";import type { CountryStats } from "@clashstats/shared";@@ -113,7 +113,7 @@ export function CountryTrafficList({ data }: CountryTrafficListProps) {{/* Connections */}<div className="flex items-center gap-1 text-xs text-muted-foreground">- <MapPin className="w-3 h-3" />+ <Link2 className="w-3 h-3" /><span>{country.totalConnections.toLocaleString()}</span></div></div>diff --git a/apps/web/components/domain-top-grid.tsx b/apps/web/components/domain-top-grid.tsxindex 3c3c3ab..cb1ffa3 100644--- a/apps/web/components/domain-top-grid.tsx+++ b/apps/web/components/domain-top-grid.tsx@@ -1,7 +1,8 @@"use client";import { useMemo, useState } from "react";-import { Globe, Users, ArrowUpDown, ArrowRight } from "lucide-react";+import { Globe, Link2, ArrowUpDown, ArrowRight } from "lucide-react";+import { useTranslations } from "next-intl";import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";import { Button } from "@/components/ui/button";import { formatBytes } from "@/lib/utils";@@ -25,6 +26,8 @@ function getInitials(domain: string): string {export function DomainTopGrid({ data, limit = 5, onViewAll }: DomainTopGridProps) {const [sortBy, setSortBy] = useState<SortBy>("traffic");+ const t = useTranslations("topDomains");+ const proxiesT = useTranslations("proxies");const domains = useMemo(() => {if (!data) return [];@@ -49,13 +52,13 @@ export function DomainTopGrid({ data, limit = 5, onViewAll }: DomainTopGridProps<div className="flex items-center justify-between"><CardTitle className="text-sm font-semibold text-muted-foreground uppercase tracking-wider flex items-center gap-2"><Globe className="w-4 h-4" />- Top 域名+ {t("title")}</CardTitle><Button variant="ghost" size="sm" className="h-7 px-2 text-xs" onClick={toggleSort}>{sortBy === "traffic" ? (- <><ArrowUpDown className="w-3 h-3 mr-1" /> 流量</>+ <><ArrowUpDown className="w-3 h-3 mr-1" /> {proxiesT("sortByTraffic")}</>) : (- <><Users className="w-3 h-3 mr-1" /> 连接</>+ <><Link2 className="w-3 h-3 mr-1" /> {proxiesT("sortByConnections")}</>)}</Button></div>@@ -106,7 +109,7 @@ export function DomainTopGrid({ data, limit = 5, onViewAll }: DomainTopGridProps<span className="text-purple-500">↑ {formatBytes(domain.totalUpload)}</span></div><span className="flex items-center gap-1">- <Users className="w-3 h-3" />+ <Link2 className="w-3 h-3" />{domain.totalConnections}</span></div>@@ -117,7 +120,7 @@ export function DomainTopGrid({ data, limit = 5, onViewAll }: DomainTopGridProps{onViewAll && (<div className="mt-4 pt-3 border-t border-border/30"><Button variant="ghost" size="sm" className="w-full h-9 text-xs" onClick={onViewAll}>- 查看全部+ {proxiesT("viewAll")}<ArrowRight className="w-3 h-3 ml-1" /></Button></div>diff --git a/apps/web/components/domain-top-list.tsx b/apps/web/components/domain-top-list.tsxindex 30c03a8..98a18a0 100644--- a/apps/web/components/domain-top-list.tsx+++ b/apps/web/components/domain-top-list.tsx@@ -1,10 +1,12 @@"use client";import { useMemo, useState } from "react";-import { Globe, Users, ArrowUpDown } from "lucide-react";+import { Globe, Link2, ArrowUpDown } from "lucide-react";+import { useTranslations } from "next-intl";import { OverviewCard } from "./overview-card";import { TopListItem } from "./top-list-item";import { Button } from "@/components/ui/button";+import { formatBytes } from "@/lib/utils";import type { DomainStats } from "@clashstats/shared";interface DomainTopListProps {@@ -30,6 +32,8 @@ function getInitials(domain: string): string {export function DomainTopList({ data, limit = 7, onViewAll }: DomainTopListProps) {const [sortBy, setSortBy] = useState<SortBy>("traffic");+ const t = useTranslations("topDomains");+ const proxiesT = useTranslations("proxies");const { domains, totalTraffic, totalConnections } = useMemo(() => {if (!data) return { domains: [], totalTraffic: 0, totalConnections: 0 };@@ -62,9 +66,9 @@ export function DomainTopList({ data, limit = 7, onViewAll }: DomainTopListPropsif (domains.length === 0) {return (- <OverviewCard title="Top 域名" icon={<Globe className="w-4 h-4" />}>+ <OverviewCard title={t("title")} icon={<Globe className="w-4 h-4" />}><div className="py-8 text-center text-sm text-muted-foreground">- 暂无数据+ {proxiesT("noData")}</div></OverviewCard>);@@ -72,7 +76,7 @@ export function DomainTopList({ data, limit = 7, onViewAll }: DomainTopListPropsreturn (<OverviewCard- title="Top 域名"+ title={t("title")}icon={<Globe className="w-4 h-4" />}action={<Button@@ -82,16 +86,16 @@ export function DomainTopList({ data, limit = 7, onViewAll }: DomainTopListPropsonClick={toggleSort}>{sortBy === "traffic" ? (- <><ArrowUpDown className="w-3 h-3 mr-1" /> 按流量</>+ <><ArrowUpDown className="w-3 h-3 mr-1" /> {t("sortByTraffic")}</>) : (- <><Users className="w-3 h-3 mr-1" /> 按连接</>+ <><Link2 className="w-3 h-3 mr-1" /> {t("sortByConnections")}</>)}</Button>}footer={onViewAll && (<Button variant="ghost" size="sm" className="w-full h-9 text-xs" onClick={onViewAll}>- 查看全部+ {t("viewAll")}</Button>)}@@ -115,7 +119,7 @@ export function DomainTopList({ data, limit = 7, onViewAll }: DomainTopListProps}title={domain.domain}subtitle={sortBy === "traffic"- ? `${domain.totalConnections} 连接`+ ? `${domain.totalConnections} ${t("connections")}`: `${formatBytes(domain.total)}`}value={sortBy === "traffic" ? domain.total : domain.totalConnections}@@ -128,5 +132,3 @@ export function DomainTopList({ data, limit = 7, onViewAll }: DomainTopListProps</OverviewCard>);}--import { formatBytes } from "@/lib/utils";diff --git a/apps/web/components/domains-table.tsx b/apps/web/components/domains-table.tsxindex a457ef0..7219b1c 100644--- a/apps/web/components/domains-table.tsx+++ b/apps/web/components/domains-table.tsx@@ -100,11 +100,11 @@ export function DomainsTable({ data }: DomainsTableProps) {};const SortIcon = ({ column }: { column: SortKey }) => {- if (sortKey !== column) return <ArrowUpDown className="ml-2 h-3 w-3 text-muted-foreground" />;+ if (sortKey !== column) return <ArrowUpDown className="ml-1 h-3 w-3 text-muted-foreground" />;return sortOrder === "asc" ? (- <ArrowUp className="ml-2 h-3 w-3 text-primary" />+ <ArrowUp className="ml-1 h-3 w-3 text-primary" />) : (- <ArrowDown className="ml-2 h-3 w-3 text-primary" />+ <ArrowDown className="ml-1 h-3 w-3 text-primary" />);};@@ -138,8 +138,8 @@ export function DomainsTable({ data }: DomainsTableProps) {return (<div className="glass-card rounded-2xl overflow-hidden">{/* Header */}- <div className="p-5 border-b border-border/50">- <div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">+ <div className="p-4 sm:p-5 border-b border-border/50">+ <div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"><div><h3 className="text-lg font-semibold">{t("title")}</h3><p className="text-sm text-muted-foreground">@@ -158,41 +158,70 @@ export function DomainsTable({ data }: DomainsTableProps) {</div></div>- {/* Table Header */}- <div className="grid grid-cols-12 gap-4 px-5 py-3 bg-secondary/30 text-xs font-medium text-muted-foreground uppercase tracking-wider">+ {/* Desktop Table Header - Hidden on mobile */}+ <div className="hidden sm:grid grid-cols-12 gap-3 px-5 py-3 bg-secondary/30 text-xs font-medium text-muted-foreground uppercase tracking-wider"><div- className="col-span-4 sm:col-span-3 flex items-center cursor-pointer hover:text-foreground transition-colors"+ className="col-span-3 flex items-center cursor-pointer hover:text-foreground transition-colors"onClick={() => handleSort("domain")}>{t("domain")}<SortIcon column="domain" /></div><div- className="col-span-3 sm:col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"+ className="col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"onClick={() => handleSort("totalDownload")}>{t("download")}<SortIcon column="totalDownload" /></div><div- className="col-span-3 sm:col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"+ className="col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"onClick={() => handleSort("totalUpload")}>{t("upload")}<SortIcon column="totalUpload" /></div><div- className="hidden sm:col-span-2 sm:flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"+ className="col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"onClick={() => handleSort("totalConnections")}>{t("conn")}<SortIcon column="totalConnections" /></div>+ <div className="col-span-1 flex items-center justify-end">+ {t("last")}+ </div><div className="col-span-2 flex items-center justify-end">{t("ipCount")}</div></div>+ {/* Mobile Sort Bar - Shown only on mobile */}+ <div className="sm:hidden flex items-center gap-2 px-4 py-2 bg-secondary/30 overflow-x-auto">+ {([+ { key: "domain" as SortKey, label: t("domain") },+ { key: "totalDownload" as SortKey, label: t("download") },+ { key: "totalUpload" as SortKey, label: t("upload") },+ { key: "totalConnections" as SortKey, label: t("conn") },+ ]).map(({ key, label }) => (+ <button+ key={key}+ className={cn(+ "flex items-center gap-0.5 px-2 py-1 rounded-md text-xs font-medium whitespace-nowrap transition-colors",+ sortKey === key+ ? "bg-primary/10 text-primary"+ : "text-muted-foreground hover:text-foreground"+ )}+ onClick={() => handleSort(key)}+ >+ {label}+ {sortKey === key && (+ sortOrder === "asc" ? <ArrowUp className="h-3 w-3" /> : <ArrowDown className="h-3 w-3" />+ )}+ </button>+ ))}+ </div>+{/* Table Body */}<div className="divide-y divide-border/30 min-h-[300px]">{paginatedData.length === 0 ? (@@ -205,45 +234,49 @@ export function DomainsTable({ data }: DomainsTableProps) {return (<div key={domain.domain} className="group">- {/* Main Row */}+ {/* Desktop Row */}<divclassName={cn(- "grid grid-cols-12 gap-4 px-5 py-4 items-center hover:bg-secondary/20 transition-colors cursor-pointer",+ "hidden sm:grid grid-cols-12 gap-3 px-5 py-4 items-center hover:bg-secondary/20 transition-colors cursor-pointer",isExpanded && "bg-secondary/10")}style={{ animationDelay: `${index * 50}ms` }}onClick={() => toggleExpand(domain.domain)}>{/* Domain with Favicon */}- <div className="col-span-4 sm:col-span-3 flex items-center gap-3 min-w-0">- <Favicon domain={domain.domain} size="sm" />+ <div className="col-span-3 flex items-center gap-3 min-w-0">+ <Favicon domain={domain.domain} size="sm" className="shrink-0" /><div className="min-w-0"><p className="font-medium truncate text-sm">{domain.domain || t("unknown")}</p>- <p className="text-xs text-muted-foreground">- {formatDuration(domain.lastSeen)}- </p></div></div>{/* Download */}- <div className="col-span-3 sm:col-span-2 text-right tabular-nums text-sm">+ <div className="col-span-2 text-right tabular-nums text-sm"><span className="text-blue-500">{formatBytes(domain.totalDownload)}</span></div>{/* Upload */}- <div className="col-span-3 sm:col-span-2 text-right tabular-nums text-sm">+ <div className="col-span-2 text-right tabular-nums text-sm"><span className="text-purple-500">{formatBytes(domain.totalUpload)}</span></div>{/* Connections */}- <div className="hidden sm:col-span-2 sm:flex items-center justify-end">+ <div className="col-span-2 flex items-center justify-end"><span className="px-2.5 py-1 rounded-full bg-secondary text-xs font-medium">{domain.totalConnections}</span></div>+ {/* Last Seen */}+ <div className="col-span-1 text-right">+ <p className="text-xs text-muted-foreground">+ {formatDuration(domain.lastSeen)}+ </p>+ </div>+{/* IP Count - Clickable */}<div className="col-span-2 flex items-center justify-end"><Button@@ -271,26 +304,75 @@ export function DomainsTable({ data }: DomainsTableProps) {</div></div>+ {/* Mobile Row - Card-style layout */}+ <div+ className={cn(+ "sm:hidden px-4 py-3 hover:bg-secondary/20 transition-colors cursor-pointer",+ isExpanded && "bg-secondary/10"+ )}+ onClick={() => toggleExpand(domain.domain)}+ >+ {/* Top: Favicon + Domain + Expand */}+ <div className="flex items-center gap-2.5 mb-2">+ <Favicon domain={domain.domain} size="sm" className="shrink-0" />+ <div className="flex-1 min-w-0">+ <p className="font-medium text-sm truncate">+ {domain.domain || t("unknown")}+ </p>+ <p className="text-xs text-muted-foreground">+ {formatDuration(domain.lastSeen)}+ </p>+ </div>+ <Button+ variant="ghost"+ size="sm"+ className={cn(+ "h-7 px-2 gap-1 text-xs font-medium shrink-0",+ isExpanded+ ? "bg-primary/10 text-primary"+ : "bg-secondary/50 text-muted-foreground"+ )}+ onClick={(e) => {+ e.stopPropagation();+ toggleExpand(domain.domain);+ }}+ >+ <Server className="h-3 w-3" />+ {domain.ips.length}+ {isExpanded ? <ChevronUp className="h-3 w-3" /> : <ChevronDown className="h-3 w-3" />}+ </Button>+ </div>++ {/* Bottom: Stats row */}+ <div className="flex items-center justify-between text-xs pl-[30px]">+ <span className="text-blue-500 tabular-nums">↓ {formatBytes(domain.totalDownload)}</span>+ <span className="text-purple-500 tabular-nums">↑ {formatBytes(domain.totalUpload)}</span>+ <span className="px-2 py-0.5 rounded-full bg-secondary text-muted-foreground font-medium">+ {domain.totalConnections} {t("conn")}+ </span>+ </div>+ </div>+{/* Expanded IP List */}{isExpanded && (- <div className="px-5 pb-4 bg-secondary/5">+ <div className="px-4 sm:px-5 pb-4 bg-secondary/5"><div className="pt-2 pb-1 px-1"><p className="text-xs font-medium text-muted-foreground mb-2 flex items-center gap-1.5"><Globe className="h-3 w-3" />{t("associatedIPs")}</p><div className="flex flex-wrap gap-2">- {domain.ips.map((ip, ipIndex) => {+ {domain.ips.map((ip) => {const gradient = getIPGradient(ip);return (<divkey={ip}- className="flex items-center gap-2 px-3 py-2 rounded-lg bg-card border border-border/50 hover:border-primary/30 hover:shadow-sm transition-all"+ className="flex items-center gap-2 px-2.5 py-1.5 sm:px-3 sm:py-2 rounded-lg bg-card border border-border/50 hover:border-primary/30 hover:shadow-sm transition-all">- <div className={`w-6 h-6 rounded-md bg-gradient-to-br ${gradient} flex items-center justify-center shrink-0`}>- <Server className="w-3 h-3 text-white" />+ <div className={`w-5 h-5 sm:w-6 sm:h-6 rounded-md bg-gradient-to-br ${gradient} flex items-center justify-center shrink-0`}>+ <Server className="w-2.5 h-2.5 sm:w-3 sm:h-3 text-white" /></div>- <code className="text-xs font-mono">{ip}</code>+ <code className="text-xs font-mono break-all">{ip}</code></div>);})}@@ -306,8 +388,8 @@ export function DomainsTable({ data }: DomainsTableProps) {{/* Pagination Footer */}{totalPages > 0 && (- <div className="p-4 border-t border-border/50 bg-secondary/20">- <div className="flex flex-col sm:flex-row items-center justify-between gap-4">+ <div className="p-3 sm:p-4 border-t border-border/50 bg-secondary/20">+ <div className="flex flex-col sm:flex-row items-center justify-between gap-3">{/* Page size selector */}<div className="flex items-center gap-2"><DropdownMenu>@@ -335,10 +417,13 @@ export function DomainsTable({ data }: DomainsTableProps) {</div>{/* Pagination info and controls */}- <div className="flex items-center gap-3">- <p className="text-sm text-muted-foreground">+ <div className="flex items-center gap-2 sm:gap-3">+ <p className="text-xs sm:text-sm text-muted-foreground hidden sm:block">{t("showing")} {(currentPage - 1) * pageSize + 1} - {Math.min(currentPage * pageSize, filteredData.length)} {t("of")} {filteredData.length}</p>+ <p className="text-xs text-muted-foreground sm:hidden">+ {(currentPage - 1) * pageSize + 1}-{Math.min(currentPage * pageSize, filteredData.length)} / {filteredData.length}+ </p><div className="flex items-center gap-1"><Button@@ -353,7 +438,7 @@ export function DomainsTable({ data }: DomainsTableProps) {{getPageNumbers().map((page, idx) => (page === '...' ? (- <span key={`ellipsis-${idx}`} className="px-2 text-muted-foreground">...</span>+ <span key={`ellipsis-${idx}`} className="px-1 sm:px-2 text-muted-foreground text-xs">...</span>) : (<Buttonkey={page}diff --git a/apps/web/components/favicon.tsx b/apps/web/components/favicon.tsxindex 262a8f6..8c82a6d 100644--- a/apps/web/components/favicon.tsx+++ b/apps/web/components/favicon.tsx@@ -74,7 +74,7 @@ export function Favicon({ domain, size = "md", className }: FaviconProps) {return (<divclassName={cn(- "rounded-lg overflow-hidden bg-slate-800/50 flex items-center justify-center relative",+ "rounded-lg overflow-hidden bg-slate-800/50 flex items-center justify-center relative shrink-0",sizeMap[size],className)}@@ -91,7 +91,7 @@ export function Favicon({ domain, size = "md", className }: FaviconProps) {src={faviconUrl}alt={cleanDomain}className={cn(- "w-full h-full object-contain p-0.5",+ "w-full h-full object-cover p-0.5",loading ? "opacity-0" : "opacity-100")}onError={() => setError(true)}diff --git a/apps/web/components/ips-table.tsx b/apps/web/components/ips-table.tsxindex 115840e..d4f7d9d 100644--- a/apps/web/components/ips-table.tsx+++ b/apps/web/components/ips-table.tsx@@ -114,11 +114,11 @@ export function IPsTable({ data }: IPsTableProps) {};const SortIcon = ({ column }: { column: SortKey }) => {- if (sortKey !== column) return <ArrowUpDown className="ml-2 h-3 w-3 text-muted-foreground" />;+ if (sortKey !== column) return <ArrowUpDown className="ml-1 h-3 w-3 text-muted-foreground" />;return sortOrder === "asc" ? (- <ArrowUp className="ml-2 h-3 w-3 text-primary" />+ <ArrowUp className="ml-1 h-3 w-3 text-primary" />) : (- <ArrowDown className="ml-2 h-3 w-3 text-primary" />+ <ArrowDown className="ml-1 h-3 w-3 text-primary" />);};@@ -152,8 +152,8 @@ export function IPsTable({ data }: IPsTableProps) {return (<div className="glass-card rounded-2xl overflow-hidden">{/* Header */}- <div className="p-5 border-b border-border/50">- <div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">+ <div className="p-4 sm:p-5 border-b border-border/50">+ <div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"><div><h3 className="text-lg font-semibold">{t("title")}</h3><p className="text-sm text-muted-foreground">{t("topIPsByTraffic")}</p>@@ -170,10 +170,10 @@ export function IPsTable({ data }: IPsTableProps) {</div></div>- {/* Table Header */}- <div className="grid grid-cols-12 gap-4 px-5 py-3 bg-secondary/30 text-xs font-medium text-muted-foreground uppercase tracking-wider">+ {/* Desktop Table Header */}+ <div className="hidden sm:grid grid-cols-12 gap-3 px-5 py-3 bg-secondary/30 text-xs font-medium text-muted-foreground uppercase tracking-wider"><div- className="col-span-4 sm:col-span-3 flex items-center cursor-pointer hover:text-foreground transition-colors"+ className="col-span-3 flex items-center cursor-pointer hover:text-foreground transition-colors"onClick={() => handleSort("ip")}>{t("ipAddress")}@@ -183,24 +183,56 @@ export function IPsTable({ data }: IPsTableProps) {{t("location")}</div><div- className="col-span-3 sm:col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"+ className="col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"onClick={() => handleSort("totalDownload")}>{t("download")}<SortIcon column="totalDownload" /></div><div- className="col-span-3 sm:col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"+ className="col-span-2 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"onClick={() => handleSort("totalUpload")}>{t("upload")}<SortIcon column="totalUpload" /></div>- <div className="hidden sm:col-span-2 sm:flex items-center justify-end">+ <div className="col-span-1 flex items-center justify-end cursor-pointer hover:text-foreground transition-colors"+ onClick={() => handleSort("totalConnections")}+ >+ {t("conn")}+ <SortIcon column="totalConnections" />+ </div>+ <div className="col-span-2 flex items-center justify-end">{t("domainCount")}</div></div>+ {/* Mobile Sort Bar */}+ <div className="sm:hidden flex items-center gap-2 px-4 py-2 bg-secondary/30 overflow-x-auto">+ {([+ { key: "ip" as SortKey, label: t("ipAddress") },+ { key: "totalDownload" as SortKey, label: t("download") },+ { key: "totalUpload" as SortKey, label: t("upload") },+ { key: "totalConnections" as SortKey, label: t("conn") },+ ]).map(({ key, label }) => (+ <button+ key={key}+ className={cn(+ "flex items-center gap-0.5 px-2 py-1 rounded-md text-xs font-medium whitespace-nowrap transition-colors",+ sortKey === key+ ? "bg-primary/10 text-primary"+ : "text-muted-foreground hover:text-foreground"+ )}+ onClick={() => handleSort(key)}+ >+ {label}+ {sortKey === key && (+ sortOrder === "asc" ? <ArrowUp className="h-3 w-3" /> : <ArrowDown className="h-3 w-3" />+ )}+ </button>+ ))}+ </div>+{/* Table Body */}<div className="divide-y divide-border/30 min-h-[300px]">{paginatedData.length === 0 ? (@@ -214,17 +246,17 @@ export function IPsTable({ data }: IPsTableProps) {return (<div key={ip.ip} className="group">- {/* Main Row */}+ {/* Desktop Row */}<divclassName={cn(- "grid grid-cols-12 gap-4 px-5 py-4 items-center hover:bg-secondary/20 transition-colors cursor-pointer",+ "hidden sm:grid grid-cols-12 gap-3 px-5 py-4 items-center hover:bg-secondary/20 transition-colors cursor-pointer",isExpanded && "bg-secondary/10")}style={{ animationDelay: `${index * 50}ms` }}onClick={() => toggleExpand(ip.ip)}>{/* IP with Icon */}- <div className="col-span-4 sm:col-span-3 flex items-center gap-3 min-w-0">+ <div className="col-span-3 flex items-center gap-3 min-w-0"><div className={`w-8 h-8 rounded-lg ${ipColor.bg} ${ipColor.text} flex items-center justify-center shrink-0`}><Server className="w-4 h-4" /></div>@@ -242,7 +274,7 @@ export function IPsTable({ data }: IPsTableProps) {<div className="col-span-2 flex items-center">{ip.geoIP && ip.geoIP.length > 0 ? (<div className="flex items-center gap-1.5">- <Globe className="w-3 h-3 text-muted-foreground" />+ <Globe className="w-3 h-3 text-muted-foreground shrink-0" /><span className="text-xs truncate">{ip.geoIP[0]}</span></div>) : (@@ -251,17 +283,24 @@ export function IPsTable({ data }: IPsTableProps) {</div>{/* Download */}- <div className="col-span-3 sm:col-span-2 text-right tabular-nums text-sm">+ <div className="col-span-2 text-right tabular-nums text-sm"><span className="text-blue-500">{formatBytes(ip.totalDownload)}</span></div>{/* Upload */}- <div className="col-span-3 sm:col-span-2 text-right tabular-nums text-sm">+ <div className="col-span-2 text-right tabular-nums text-sm"><span className="text-purple-500">{formatBytes(ip.totalUpload)}</span></div>+ {/* Connections */}+ <div className="col-span-1 flex items-center justify-end">+ <span className="px-2 py-0.5 rounded-full bg-secondary text-xs font-medium">+ {ip.totalConnections}+ </span>+ </div>+{/* Domains Count - Clickable */}- <div className="hidden sm:col-span-2 sm:flex items-center justify-end">+ <div className="col-span-2 flex items-center justify-end"><Buttonvariant="ghost"size="sm"@@ -287,9 +326,67 @@ export function IPsTable({ data }: IPsTableProps) {</div></div>+ {/* Mobile Row - Card-style layout */}+ <div+ className={cn(+ "sm:hidden px-4 py-3 hover:bg-secondary/20 transition-colors cursor-pointer",+ isExpanded && "bg-secondary/10"+ )}+ onClick={() => toggleExpand(ip.ip)}+ >+ {/* Top: IP Icon + IP + Location + Expand */}+ <div className="flex items-center gap-2.5 mb-2">+ <div className={`w-7 h-7 rounded-lg ${ipColor.bg} ${ipColor.text} flex items-center justify-center shrink-0`}>+ <Server className="w-3.5 h-3.5" />+ </div>+ <div className="flex-1 min-w-0">+ <code className="text-sm font-medium truncate block">{ip.ip}</code>+ <div className="flex items-center gap-1.5 text-xs text-muted-foreground">+ {ip.geoIP && ip.geoIP.length > 0 ? (+ <>+ <Globe className="w-3 h-3 shrink-0" />+ <span className="truncate">{ip.geoIP[0]}</span>+ </>+ ) : ip.asn ? (+ <span className="truncate">{ip.asn}</span>+ ) : (+ <span>-</span>+ )}+ </div>+ </div>+ <Button+ variant="ghost"+ size="sm"+ className={cn(+ "h-7 px-2 gap-1 text-xs font-medium shrink-0",+ isExpanded+ ? "bg-primary/10 text-primary"+ : "bg-secondary/50 text-muted-foreground"+ )}+ onClick={(e) => {+ e.stopPropagation();+ toggleExpand(ip.ip);+ }}+ >+ <Link2 className="h-3 w-3" />+ {ip.domains.length}+ {isExpanded ? <ChevronUp className="h-3 w-3" /> : <ChevronDown className="h-3 w-3" />}+ </Button>+ </div>++ {/* Bottom: Stats row */}+ <div className="flex items-center justify-between text-xs pl-[38px]">+ <span className="text-blue-500 tabular-nums">↓ {formatBytes(ip.totalDownload)}</span>+ <span className="text-purple-500 tabular-nums">↑ {formatBytes(ip.totalUpload)}</span>+ <span className="px-2 py-0.5 rounded-full bg-secondary text-muted-foreground font-medium">+ {ip.totalConnections} {t("conn")}+ </span>+ </div>+ </div>+{/* Expanded Domains List */}{isExpanded && (- <div className="px-5 pb-4 bg-secondary/5">+ <div className="px-4 sm:px-5 pb-4 bg-secondary/5"><div className="pt-2 pb-1 px-1"><p className="text-xs font-medium text-muted-foreground mb-2 flex items-center gap-1.5"><Link2 className="h-3 w-3" />@@ -301,12 +398,12 @@ export function IPsTable({ data }: IPsTableProps) {return (<divkey={domain}- className="flex items-center gap-2 px-3 py-2 rounded-lg bg-card border border-border/50 hover:border-primary/30 hover:shadow-sm transition-all"+ className="flex items-center gap-2 px-2.5 py-1.5 sm:px-3 sm:py-2 rounded-lg bg-card border border-border/50 hover:border-primary/30 hover:shadow-sm transition-all">- <div className={`w-6 h-6 rounded-md ${domainColor.bg} ${domainColor.text} flex items-center justify-center shrink-0`}>- <Globe className="w-3 h-3" />+ <div className={`w-5 h-5 sm:w-6 sm:h-6 rounded-md ${domainColor.bg} ${domainColor.text} flex items-center justify-center shrink-0`}>+ <Globe className="w-2.5 h-2.5 sm:w-3 sm:h-3" /></div>- <span className="text-xs font-medium truncate max-w-[200px]">{domain}</span>+ <span className="text-xs font-medium truncate max-w-[180px] sm:max-w-[200px]">{domain}</span></div>);})}@@ -322,8 +419,8 @@ export function IPsTable({ data }: IPsTableProps) {{/* Pagination Footer */}{totalPages > 0 && (- <div className="p-4 border-t border-border/50 bg-secondary/20">- <div className="flex flex-col sm:flex-row items-center justify-between gap-4">+ <div className="p-3 sm:p-4 border-t border-border/50 bg-secondary/20">+ <div className="flex flex-col sm:flex-row items-center justify-between gap-3">{/* Page size selector */}<div className="flex items-center gap-2"><DropdownMenu>@@ -351,10 +448,13 @@ export function IPsTable({ data }: IPsTableProps) {</div>{/* Pagination info and controls */}- <div className="flex items-center gap-3">- <p className="text-sm text-muted-foreground">+ <div className="flex items-center gap-2 sm:gap-3">+ <p className="text-xs sm:text-sm text-muted-foreground hidden sm:block">{t("showing")} {(currentPage - 1) * pageSize + 1} - {Math.min(currentPage * pageSize, filteredData.length)} {t("of")} {filteredData.length}</p>+ <p className="text-xs text-muted-foreground sm:hidden">+ {(currentPage - 1) * pageSize + 1}-{Math.min(currentPage * pageSize, filteredData.length)} / {filteredData.length}+ </p><div className="flex items-center gap-1"><Button@@ -369,7 +469,7 @@ export function IPsTable({ data }: IPsTableProps) {{getPageNumbers().map((page, idx) => (page === '...' ? (- <span key={`ellipsis-${idx}`} className="px-2 text-muted-foreground">...</span>+ <span key={`ellipsis-${idx}`} className="px-1 sm:px-2 text-muted-foreground text-xs">...</span>) : (<Buttonkey={page}diff --git a/apps/web/components/navigation.tsx b/apps/web/components/navigation.tsxindex 74c3907..2f5d0f9 100644--- a/apps/web/components/navigation.tsx+++ b/apps/web/components/navigation.tsx@@ -13,16 +13,31 @@ import {Settings,Menu,X,+ Info,+ ExternalLink,+ ArrowUpCircle,+ RefreshCw,} from "lucide-react";import { cn } from "@/lib/utils";import { Button } from "@/components/ui/button";import { BackendConfigDialog } from "./backend-config-dialog";+import {+ Dialog,+ DialogContent,+ DialogHeader,+ DialogTitle,+} from "@/components/ui/dialog";+import { useVersionCheck } from "@/hooks/use-version-check";+import packageJson from "../package.json";interface NavigationProps {activeTab: string;onTabChange: (tab: string) => void;}+const APP_VERSION = packageJson.version;+const GITHUB_URL = "https://github.com/foru17/clash-master";+const NAV_ITEMS = [{ id: "overview", icon: LayoutDashboard },{ id: "domains", icon: Globe },@@ -35,9 +50,13 @@ const NAV_ITEMS = [export function Navigation({ activeTab, onTabChange }: NavigationProps) {const [mobileMenuOpen, setMobileMenuOpen] = useState(false);const [settingsOpen, setSettingsOpen] = useState(false);+ const [aboutOpen, setAboutOpen] = useState(false);const t = useTranslations("nav");const headerT = useTranslations("header");const backendT = useTranslations("backend");+ const aboutT = useTranslations("about");+ const { latestVersion, hasUpdate, isChecking, stars, checkNow } =+ useVersionCheck(APP_VERSION);return (<>@@ -46,17 +65,19 @@ export function Navigation({ activeTab, onTabChange }: NavigationProps) {{/* Logo */}<div className="flex items-center gap-3 p-6 border-b border-border/40"><div className="w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center overflow-hidden">- <Image- src="/clash-master.png"- alt="Clash Master"- width={40}+ <Image+ src="/clash-master.png"+ alt="Clash Master"+ width={40}height={40}className="w-full h-full object-cover"/></div><div><h1 className="font-bold text-lg">{headerT("title")}</h1>- <p className="text-xs text-muted-foreground">{headerT("subtitle")}</p>+ <p className="text-xs text-muted-foreground">+ {headerT("subtitle")}+ </p></div></div>@@ -73,9 +94,8 @@ export function Navigation({ activeTab, onTabChange }: NavigationProps) {"w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium transition-all",isActive? "bg-primary text-primary-foreground shadow-sm"- : "text-muted-foreground hover:bg-secondary hover:text-foreground"- )}- >+ : "text-muted-foreground hover:bg-secondary hover:text-foreground",+ )}><Icon className="w-5 h-5" />{t(item.id)}</button>@@ -84,14 +104,31 @@ export function Navigation({ activeTab, onTabChange }: NavigationProps) {</nav>{/* Bottom Actions */}- <div className="p-4 border-t border-border/40">+ <div className="p-4 border-t border-border/40 space-y-1">+ <button+ onClick={() => setAboutOpen(true)}+ className={cn(+ "w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium transition-all relative",+ "text-muted-foreground hover:bg-secondary hover:text-foreground",+ )}>+ <Info className="w-5 h-5" />+ {aboutT("title")}+ {hasUpdate && (+ <span className="ml-auto flex items-center gap-1.5 text-xs text-emerald-500 font-medium">+ <span className="relative flex h-2 w-2">+ <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75" />+ <span className="relative inline-flex rounded-full h-2 w-2 bg-emerald-500" />+ </span>+ v{latestVersion}+ </span>+ )}+ </button><buttononClick={() => setSettingsOpen(true)}className={cn("w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium transition-all",- "text-muted-foreground hover:bg-secondary hover:text-foreground"- )}- >+ "text-muted-foreground hover:bg-secondary hover:text-foreground",+ )}><Settings className="w-5 h-5" />{backendT("title")}</button>@@ -103,10 +140,10 @@ export function Navigation({ activeTab, onTabChange }: NavigationProps) {<div className="flex items-center justify-between h-14 px-4"><div className="flex items-center gap-3"><div className="w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center overflow-hidden">- <Image- src="/clash-master.png"- alt="Clash Master"- width={32}+ <Image+ src="/clash-master.png"+ alt="Clash Master"+ width={32}height={32}className="w-full h-full object-cover"/>@@ -117,16 +154,18 @@ export function Navigation({ activeTab, onTabChange }: NavigationProps) {<Buttonvariant="ghost"size="icon"- onClick={() => setSettingsOpen(true)}- >+ onClick={() => setSettingsOpen(true)}><Settings className="w-5 h-5" /></Button><Buttonvariant="ghost"size="icon"- onClick={() => setMobileMenuOpen(!mobileMenuOpen)}- >- {mobileMenuOpen ? <X className="w-5 h-5" /> : <Menu className="w-5 h-5" />}+ onClick={() => setMobileMenuOpen(!mobileMenuOpen)}>+ {mobileMenuOpen ? (+ <X className="w-5 h-5" />+ ) : (+ <Menu className="w-5 h-5" />+ )}</Button></div></div>@@ -148,9 +187,8 @@ export function Navigation({ activeTab, onTabChange }: NavigationProps) {"w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium transition-all",isActive? "bg-primary text-primary-foreground"- : "text-muted-foreground hover:bg-secondary"- )}- >+ : "text-muted-foreground hover:bg-secondary",+ )}><Icon className="w-5 h-5" />{t(item.id)}</button>@@ -172,11 +210,8 @@ export function Navigation({ activeTab, onTabChange }: NavigationProps) {onClick={() => onTabChange(item.id)}className={cn("flex flex-col items-center gap-1 px-3 py-2 rounded-lg transition-all",- isActive- ? "text-primary"- : "text-muted-foreground"- )}- >+ isActive ? "text-primary" : "text-muted-foreground",+ )}><Icon className={cn("w-5 h-5", isActive && "scale-110")} /><span className="text-[10px]">{t(item.id)}</span></button>@@ -191,6 +226,169 @@ export function Navigation({ activeTab, onTabChange }: NavigationProps) {onOpenChange={setSettingsOpen}isFirstTime={false}/>++ {/* About Dialog */}+ <Dialog open={aboutOpen} onOpenChange={setAboutOpen}>+ <DialogContent className="sm:max-w-[420px]">+ <DialogHeader>+ <DialogTitle className="flex items-center gap-2">+ <Info className="w-5 h-5 text-primary" />+ {aboutT("title")}+ </DialogTitle>+ </DialogHeader>+ <div className="py-4">+ {/* App Info */}+ <div className="flex items-center gap-4 mb-4">+ <div className="w-16 h-16 rounded-2xl bg-primary/10 flex items-center justify-center overflow-hidden shrink-0">+ <Image+ src="/clash-master.png"+ alt="Clash Master"+ width={64}+ height={64}+ className="w-full h-full object-cover"+ />+ </div>+ <div>+ <h3 className="text-xl font-bold">{aboutT("projectName")}</h3>+ <p className="text-sm text-muted-foreground mt-1">+ {aboutT("description")}+ </p>+ </div>+ </div>++ {/* All card rows with consistent spacing */}+ <div className="space-y-2">+ {/* Current Version */}+ <div className="flex items-center justify-between p-3 rounded-xl bg-secondary/50 border border-border/50">+ <span className="text-sm font-medium">+ {aboutT("currentVersion")}+ </span>+ <span className="text-sm font-mono tabular-nums text-primary font-semibold">+ v{APP_VERSION}+ </span>+ </div>++ {/* Latest Version / Update Status */}+ <div+ className={cn(+ "flex items-center justify-between p-3 rounded-xl border min-h-[3rem]",+ hasUpdate+ ? "bg-emerald-500/5 border-emerald-500/20"+ : "bg-secondary/50 border-border/50",+ )}>+ <span className="text-sm font-medium">+ {aboutT("latestVersion")}+ </span>+ <div className="flex items-center gap-2 h-7 min-w-[5.5rem] justify-end">+ {isChecking ? (+ <span className="text-xs text-muted-foreground flex items-center gap-1.5">+ <RefreshCw className="w-3 h-3 animate-spin" />+ {aboutT("checkingUpdate")}+ </span>+ ) : hasUpdate && latestVersion ? (+ <span className="text-sm font-mono tabular-nums text-emerald-500 font-semibold flex items-center gap-1.5">+ <ArrowUpCircle className="w-4 h-4" />v{latestVersion}+ </span>+ ) : latestVersion ? (+ <span className="text-sm text-muted-foreground">+ ✓ {aboutT("upToDate")}+ </span>+ ) : (+ <Button+ variant="ghost"+ size="sm"+ className="h-7 px-2 text-xs"+ onClick={checkNow}>+ <RefreshCw className="w-3 h-3 mr-1" />+ {aboutT("checkNow")}+ </Button>+ )}+ </div>+ </div>++ {/* Update Available Banner */}+ <div+ className={cn(+ "grid transition-all duration-200 ease-in-out",+ hasUpdate && latestVersion+ ? "grid-rows-[1fr] opacity-100"+ : "grid-rows-[0fr] opacity-0",+ )}>+ <div className="overflow-hidden">+ <a+ href={`${GITHUB_URL}/releases`}+ target="_blank"+ rel="noopener noreferrer"+ className="flex items-center gap-3 p-3 rounded-xl bg-emerald-500/10 border border-emerald-500/20 hover:bg-emerald-500/15 transition-colors group">+ <ArrowUpCircle className="w-5 h-5 text-emerald-500 shrink-0" />+ <div className="flex-1 min-w-0">+ <p className="text-sm font-medium text-emerald-600 dark:text-emerald-400">+ {aboutT("updateAvailable")}+ </p>+ <p className="text-xs text-muted-foreground">+ v{APP_VERSION} → v{latestVersion}+ </p>+ </div>+ <ExternalLink className="w-4 h-4 text-emerald-500 group-hover:translate-x-0.5 transition-transform shrink-0" />+ </a>+ </div>+ </div>++ {/* License */}+ <div className="flex items-center justify-between p-3 rounded-xl bg-secondary/50 border border-border/50">+ <span className="text-sm font-medium">{aboutT("license")}</span>+ <span className="text-sm text-muted-foreground">MIT</span>+ </div>++ {/* GitHub Link */}+ <a+ href={GITHUB_URL}+ target="_blank"+ rel="noopener noreferrer"+ className="flex items-center justify-between p-3 rounded-xl bg-secondary/50 border border-border/50 hover:bg-secondary/80 hover:border-primary/30 transition-all group">+ <div className="flex items-center gap-3">+ <svg+ viewBox="0 0 24 24"+ className="w-5 h-5 fill-foreground shrink-0"+ aria-hidden="true">+ <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />+ </svg>+ <div className="min-w-0">+ <p className="text-sm font-medium">+ {aboutT("openSource")}+ </p>+ <p className="text-xs text-muted-foreground truncate">+ {GITHUB_URL}+ </p>+ </div>+ </div>+ <div className="flex items-center gap-2 shrink-0">+ <span className="flex items-center gap-1 text-xs font-medium px-2 py-1 rounded-full min-w-[3rem] justify-center h-6">+ {stars !== null ? (+ <>+ <svg+ viewBox="0 0 16 16"+ className="w-3.5 h-3.5 fill-amber-500 shrink-0"+ aria-hidden="true">+ <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25z" />+ </svg>+ <span className="text-amber-500 bg-amber-500/10 px-1.5 py-0.5 rounded-full">+ {stars >= 1000+ ? `${(stars / 1000).toFixed(1)}k`+ : stars}+ </span>+ </>+ ) : (+ <span className="w-8 h-4 bg-secondary/80 rounded animate-pulse" />+ )}+ </span>+ <ExternalLink className="w-4 h-4 text-muted-foreground group-hover:text-primary transition-colors" />+ </div>+ </a>+ </div>+ </div>+ </DialogContent>+ </Dialog></>);}diff --git a/apps/web/components/overview/top-countries-simple.tsx b/apps/web/components/overview/top-countries-simple.tsxindex 5d06d57..cf48d0a 100644--- a/apps/web/components/overview/top-countries-simple.tsx+++ b/apps/web/components/overview/top-countries-simple.tsx@@ -2,7 +2,7 @@import React, { useMemo } from "react";import { Globe, ArrowRight } from "lucide-react";-import { useTranslations } from "next-intl";+import { useTranslations, useLocale } from "next-intl";import { Button } from "@/components/ui/button";import { formatBytes, cn } from "@/lib/utils";import type { CountryStats } from "@clashstats/shared";@@ -33,7 +33,7 @@ const countryFlags: Record<string, string> = {"LOCAL": "🏠", "UNKNOWN": "🌐", "PRIVATE": "🔒",};-const countryNames: Record<string, string> = {+const countryNamesEn: Record<string, string> = {"CN": "China", "US": "United States", "JP": "Japan", "HK": "Hong Kong", "TW": "Taiwan","SG": "Singapore", "KR": "South Korea", "DE": "Germany", "GB": "United Kingdom", "FR": "France","NL": "Netherlands", "CA": "Canada", "AU": "Australia", "IN": "India", "RU": "Russia",@@ -44,18 +44,31 @@ const countryNames: Record<string, string> = {"LOCAL": "Local", "UNKNOWN": "Unknown", "PRIVATE": "Private",};+const countryNamesZh: Record<string, string> = {+ "CN": "中国", "US": "美国", "JP": "日本", "HK": "中国香港", "TW": "中国台湾",+ "SG": "新加坡", "KR": "韩国", "DE": "德国", "GB": "英国", "FR": "法国",+ "NL": "荷兰", "CA": "加拿大", "AU": "澳大利亚", "IN": "印度", "RU": "俄罗斯",+ "BR": "巴西", "TR": "土耳其", "VN": "越南", "TH": "泰国", "ID": "印度尼西亚",+ "MY": "马来西亚", "PH": "菲律宾", "SE": "瑞典", "CH": "瑞士", "IT": "意大利",+ "ES": "西班牙", "PT": "葡萄牙", "PL": "波兰", "UA": "乌克兰", "MX": "墨西哥",+ "AR": "阿根廷", "CL": "智利", "ZA": "南非", "AE": "阿联酋", "SA": "沙特阿拉伯",+ "LOCAL": "本地", "UNKNOWN": "未知", "PRIVATE": "私有",+};+function getCountryFlag(countryCode: string): string {return countryFlags[countryCode.toUpperCase()] || "🌐";}-function getCountryName(code: string): string {- return countryNames[code.toUpperCase()] || code;+function getCountryName(code: string, locale: string): string {+ const names = locale === "zh" ? countryNamesZh : countryNamesEn;+ return names[code.toUpperCase()] || code;}export const TopCountriesSimple = React.memo(function TopCountriesSimple({countries,}: TopCountriesSimpleProps) {const t = useTranslations("topCountries");+ const locale = useLocale();const sortedCountries = useMemo(() => {if (!countries?.length) return [];@@ -107,7 +120,7 @@ export const TopCountriesSimple = React.memo(function TopCountriesSimple({</span><span className="text-base shrink-0">{getCountryFlag(country.country)}</span><span className="flex-1 text-sm font-medium">- {getCountryName(country.country)}+ {getCountryName(country.country, locale)}</span><span className="text-sm font-bold tabular-nums shrink-0">{formatBytes(total)}diff --git a/apps/web/components/overview/top-domains-simple.tsx b/apps/web/components/overview/top-domains-simple.tsxindex 02a5d67..347a31b 100644--- a/apps/web/components/overview/top-domains-simple.tsx+++ b/apps/web/components/overview/top-domains-simple.tsx@@ -147,9 +147,7 @@ export const TopDomainsSimple = React.memo(function TopDomainsSimple({<span className="text-purple-500 dark:text-purple-400">↑ {formatBytes(domain.totalUpload)}</span></div><span className="flex items-center gap-1 tabular-nums">- <svg className="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1" />- </svg>+ <Link2 className="w-3 h-3" />{domain.totalConnections}</span></div>diff --git a/apps/web/components/overview/top-proxies-simple.tsx b/apps/web/components/overview/top-proxies-simple.tsxindex 5800497..0c48f95 100644--- a/apps/web/components/overview/top-proxies-simple.tsx+++ b/apps/web/components/overview/top-proxies-simple.tsx@@ -128,9 +128,7 @@ export const TopProxiesSimple = React.memo(function TopProxiesSimple({<span className="text-purple-500 dark:text-purple-400">↑ {formatBytes(proxyItem.totalUpload)}</span></div><span className="flex items-center gap-1 tabular-nums">- <svg className="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1" />- </svg>+ <Link2 className="w-3 h-3" />{proxyItem.totalConnections}</span></div>diff --git a/apps/web/components/proxy-stats-chart.tsx b/apps/web/components/proxy-stats-chart.tsxindex ba1ea3a..97efdab 100644--- a/apps/web/components/proxy-stats-chart.tsx+++ b/apps/web/components/proxy-stats-chart.tsx@@ -2,7 +2,8 @@import { useMemo } from "react";import { PieChart, Pie, Cell, ResponsiveContainer, Tooltip } from "recharts";-import { Server } from "lucide-react";+import { Server, Link2 } from "lucide-react";+import { useTranslations } from "next-intl";import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";import { formatBytes } from "@/lib/utils";import type { ProxyStats } from "@clashstats/shared";@@ -26,6 +27,8 @@ function formatProxyName(name: string): string {}export function ProxyStatsChart({ data }: ProxyStatsChartProps) {+ const t = useTranslations("proxies");+const chartData = useMemo(() => {if (!data) return [];return data.map((proxy, index) => ({@@ -51,19 +54,19 @@ export function ProxyStatsChart({ data }: ProxyStatsChartProps) {<p className="font-medium text-sm mb-2">{item.name}</p><div className="space-y-1 text-xs"><div className="flex justify-between gap-4">- <span className="text-muted-foreground">Total:</span>+ <span className="text-muted-foreground">{t("total")}:</span><span className="font-medium">{formatBytes(item.value)}</span></div><div className="flex justify-between gap-4">- <span className="text-blue-500">↓ Download:</span>+ <span className="text-blue-500">↓ {t("download")}:</span><span>{formatBytes(item.download)}</span></div><div className="flex justify-between gap-4">- <span className="text-purple-500">↑ Upload:</span>+ <span className="text-purple-500">↑ {t("upload")}:</span><span>{formatBytes(item.upload)}</span></div><div className="flex justify-between gap-4">- <span className="text-emerald-500">Connections:</span>+ <span className="text-emerald-500">{t("connections")}:</span><span>{item.connections.toLocaleString()}</span></div></div>@@ -78,7 +81,7 @@ export function ProxyStatsChart({ data }: ProxyStatsChartProps) {<CardHeader className="pb-2"><CardTitle className="text-lg font-semibold flex items-center gap-2"><Server className="h-5 w-5 text-primary" />- Proxy Traffic Distribution+ {t("distribution")}</CardTitle></CardHeader><CardContent className="space-y-6">@@ -105,17 +108,17 @@ export function ProxyStatsChart({ data }: ProxyStatsChartProps) {</div>{/* Proxy Cards Grid */}- <div className="grid grid-cols-2 gap-3">+ <div className="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3">{chartData.map((item) => {const percentage = totalTraffic > 0 ? (item.value / totalTraffic) * 100 : 0;return (<divkey={item.rawName}- className="p-4 rounded-xl border border-border/50 bg-card/50 hover:bg-card transition-colors"+ className="p-3 rounded-xl border border-border/50 bg-card/50 hover:bg-card transition-colors">{/* Header: Color dot + Name */}- <div className="flex items-center gap-2 mb-3">+ <div className="flex items-center gap-2 mb-2"><divclassName="w-3 h-3 rounded-full shrink-0"style={{ backgroundColor: item.color }}@@ -129,7 +132,7 @@ export function ProxyStatsChart({ data }: ProxyStatsChartProps) {<div className="space-y-2">{/* Total with percentage */}<div className="flex items-baseline justify-between">- <span className="text-2xl font-bold tabular-nums">+ <span className="text-lg font-bold tabular-nums">{formatBytes(item.value)}</span><span className="text-xs text-muted-foreground">@@ -156,9 +159,10 @@ export function ProxyStatsChart({ data }: ProxyStatsChartProps) {</div>{/* Connections */}- <p className="text-xs text-muted-foreground">- {item.connections.toLocaleString()} connections- </p>+ <div className="flex items-center gap-1 text-xs text-muted-foreground">+ <Link2 className="w-3 h-3" />+ <span>{item.connections.toLocaleString()} {t("connections")}</span>+ </div></div></div>);diff --git a/apps/web/components/proxy-top-grid.tsx b/apps/web/components/proxy-top-grid.tsxindex 1f0b117..628ff50 100644--- a/apps/web/components/proxy-top-grid.tsx+++ b/apps/web/components/proxy-top-grid.tsx@@ -1,7 +1,8 @@"use client";import { useMemo, useState } from "react";-import { Server, Users, ArrowUpDown, ArrowRight } from "lucide-react";+import { Server, Link2, ArrowUpDown, ArrowRight } from "lucide-react";+import { useTranslations } from "next-intl";import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";import { Button } from "@/components/ui/button";import { formatBytes } from "@/lib/utils";@@ -41,6 +42,8 @@ function getProxyEmoji(name: string): string {export function ProxyTopGrid({ data, limit = 5, onViewAll }: ProxyTopGridProps) {const [sortBy, setSortBy] = useState<SortBy>("traffic");+ const t = useTranslations("topProxies");+ const proxiesT = useTranslations("proxies");const proxies = useMemo(() => {if (!data) return [];@@ -69,7 +72,7 @@ export function ProxyTopGrid({ data, limit = 5, onViewAll }: ProxyTopGridProps)<div className="flex items-center justify-between"><CardTitle className="text-sm font-semibold text-muted-foreground uppercase tracking-wider flex items-center gap-2"><Server className="w-4 h-4" />- Top 代理+ {t("title")}</CardTitle><Buttonvariant="ghost"@@ -78,9 +81,9 @@ export function ProxyTopGrid({ data, limit = 5, onViewAll }: ProxyTopGridProps)onClick={toggleSort}>{sortBy === "traffic" ? (- <><ArrowUpDown className="w-3 h-3 mr-1" /> 流量</>+ <><ArrowUpDown className="w-3 h-3 mr-1" /> {proxiesT("sortByTraffic")}</>) : (- <><Users className="w-3 h-3 mr-1" /> 连接</>+ <><Link2 className="w-3 h-3 mr-1" /> {proxiesT("sortByConnections")}</>)}</Button></div>@@ -122,7 +125,7 @@ export function ProxyTopGrid({ data, limit = 5, onViewAll }: ProxyTopGridProps)↑ {formatBytes(proxy.totalUpload)}</span><span className="text-muted-foreground flex items-center gap-1">- <Users className="w-3 h-3" />+ <Link2 className="w-3 h-3" />{proxy.totalConnections}</span></div>@@ -141,7 +144,7 @@ export function ProxyTopGrid({ data, limit = 5, onViewAll }: ProxyTopGridProps){onViewAll && (<div className="mt-4 pt-3 border-t border-border/30"><Button variant="ghost" size="sm" className="w-full h-9 text-xs" onClick={onViewAll}>- 查看全部+ {proxiesT("viewAll")}<ArrowRight className="w-3 h-3 ml-1" /></Button></div>diff --git a/apps/web/components/proxy-top-list.tsx b/apps/web/components/proxy-top-list.tsxindex 7e272eb..f66a0bd 100644--- a/apps/web/components/proxy-top-list.tsx+++ b/apps/web/components/proxy-top-list.tsx@@ -1,7 +1,8 @@"use client";import { useMemo, useState } from "react";-import { Server, Users, ArrowUpDown } from "lucide-react";+import { Server, Link2, ArrowUpDown } from "lucide-react";+import { useTranslations } from "next-intl";import { OverviewCard } from "./overview-card";import { TopListItem } from "./top-list-item";import { Button } from "@/components/ui/button";@@ -43,6 +44,8 @@ function getProxyEmoji(name: string): string {export function ProxyTopList({ data, limit = 5, onViewAll }: ProxyTopListProps) {const [sortBy, setSortBy] = useState<SortBy>("traffic");+ const t = useTranslations("topProxies");+ const proxiesT = useTranslations("proxies");const { proxies, totalTraffic, totalConnections } = useMemo(() => {if (!data) return { proxies: [], totalTraffic: 0, totalConnections: 0 };@@ -76,9 +79,9 @@ export function ProxyTopList({ data, limit = 5, onViewAll }: ProxyTopListProps)if (proxies.length === 0) {return (- <OverviewCard title="Top 代理" icon={<Server className="w-4 h-4" />}>+ <OverviewCard title={t("title")} icon={<Server className="w-4 h-4" />}><div className="py-8 text-center text-sm text-muted-foreground">- 暂无数据+ {proxiesT("noData")}</div></OverviewCard>);@@ -86,7 +89,7 @@ export function ProxyTopList({ data, limit = 5, onViewAll }: ProxyTopListProps)return (<OverviewCard- title="Top 代理"+ title={t("title")}icon={<Server className="w-4 h-4" />}action={<Button@@ -96,16 +99,16 @@ export function ProxyTopList({ data, limit = 5, onViewAll }: ProxyTopListProps)onClick={toggleSort}>{sortBy === "traffic" ? (- <><ArrowUpDown className="w-3 h-3 mr-1" /> 按流量</>+ <><ArrowUpDown className="w-3 h-3 mr-1" /> {t("sortByTraffic")}</>) : (- <><Users className="w-3 h-3 mr-1" /> 按连接</>+ <><Link2 className="w-3 h-3 mr-1" /> {t("sortByConnections")}</>)}</Button>}footer={onViewAll && (<Button variant="ghost" size="sm" className="w-full h-9 text-xs" onClick={onViewAll}>- 查看全部+ {t("viewAll")}</Button>)}@@ -118,7 +121,7 @@ export function ProxyTopList({ data, limit = 5, onViewAll }: ProxyTopListProps)icon={<span className="text-lg">{proxy.emoji}</span>}title={proxy.displayName}subtitle={sortBy === "traffic"- ? `${proxy.totalConnections} 连接`+ ? `${proxy.totalConnections} ${proxiesT("connections")}`: `${formatBytes(proxy.total)}`}value={sortBy === "traffic" ? proxy.total : proxy.totalConnections}diff --git a/apps/web/components/rule-chain-chart.tsx b/apps/web/components/rule-chain-chart.tsxindex 2e12000..3e27008 100644--- a/apps/web/components/rule-chain-chart.tsx+++ b/apps/web/components/rule-chain-chart.tsx@@ -2,6 +2,7 @@import { useMemo } from "react";import { Network, ArrowRight } from "lucide-react";+import { useTranslations } from "next-intl";import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";import { formatBytes } from "@/lib/utils";import type { RuleStats } from "@clashstats/shared";@@ -60,6 +61,8 @@ function formatProxyName(proxy: string): string {}export function RuleChainChart({ data }: RuleChainChartProps) {+ const t = useTranslations("rules");+const rules = useMemo(() => {if (!data) return [];return data.map((rule, index) => ({@@ -81,10 +84,10 @@ export function RuleChainChart({ data }: RuleChainChartProps) {<CardHeader className="pb-3"><CardTitle className="text-lg font-semibold flex items-center gap-2"><Network className="h-5 w-5 text-primary" />- Rule Chain Distribution+ {t("distribution")}</CardTitle><p className="text-sm text-muted-foreground mt-1">- Traffic distribution by matching rules and their final proxy nodes+ {t("description")}</p></CardHeader><CardContent>@@ -98,34 +101,43 @@ export function RuleChainChart({ data }: RuleChainChartProps) {className="p-3 rounded-lg border border-border/50 hover:bg-secondary/20 transition-colors">{/* Top Row: Chain Flow + Traffic */}- <div className="flex items-center gap-3">+ <div className="flex items-center gap-2 sm:gap-3">{/* Rule Icon */}<div- className="w-9 h-9 rounded-lg flex items-center justify-center shrink-0"+ className="w-8 h-8 sm:w-9 sm:h-9 rounded-lg flex items-center justify-center shrink-0"style={{ backgroundColor: `${rule.color}15` }}>- <span className="text-base">{rule.emoji}</span>+ <span className="text-sm sm:text-base">{rule.emoji}</span>+ </div>++ {/* Rule Name + Proxy (stacked on mobile) */}+ <div className="flex-1 min-w-0 hidden sm:flex items-center gap-3">+ <div className="min-w-0 flex-1">+ <p className="font-medium text-sm truncate" title={rule.formattedRule}>+ {rule.formattedRule}+ </p>+ </div>+ <ArrowRight className="w-4 h-4 text-muted-foreground shrink-0" />+ <div className="min-w-0 flex-1">+ <p className="font-medium text-sm text-muted-foreground truncate" title={rule.formattedProxy}>+ {rule.formattedProxy}+ </p>+ </div></div>- {/* Rule Name */}- <div className="min-w-0 flex-1">+ {/* Mobile: stacked names */}+ <div className="flex-1 min-w-0 sm:hidden"><p className="font-medium text-sm truncate" title={rule.formattedRule}>{rule.formattedRule}</p>- </div>-- {/* Arrow */}- <ArrowRight className="w-4 h-4 text-muted-foreground shrink-0" />-- {/* Proxy */}- <div className="min-w-0 flex-1">- <p className="font-medium text-sm text-muted-foreground truncate" title={rule.formattedProxy}>+ <p className="text-xs text-muted-foreground truncate flex items-center gap-1" title={rule.formattedProxy}>+ <ArrowRight className="w-3 h-3 shrink-0" />{rule.formattedProxy}</p></div>{/* Traffic Stats */}- <div className="text-right shrink-0 min-w-[100px]">+ <div className="text-right shrink-0 min-w-[70px] sm:min-w-[100px]"><p className="font-semibold text-sm tabular-nums">{formatBytes(rule.total)}</p>@@ -136,7 +148,7 @@ export function RuleChainChart({ data }: RuleChainChartProps) {</div>{/* Second Row: Progress Bar + Detailed Stats */}- <div className="mt-3 flex items-center gap-4">+ <div className="mt-2 sm:mt-3 flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-4">{/* Progress Bar */}<div className="flex-1 h-1.5 bg-muted rounded-full overflow-hidden"><div@@ -146,8 +158,8 @@ export function RuleChainChart({ data }: RuleChainChartProps) {</div>{/* Detailed Stats */}- <div className="flex items-center gap-4 text-xs text-muted-foreground shrink-0">- <span className="tabular-nums">{rule.totalConnections.toLocaleString()} conn</span>+ <div className="flex items-center gap-3 sm:gap-4 text-xs text-muted-foreground shrink-0">+ <span className="tabular-nums">{rule.totalConnections.toLocaleString()} {t("connections")}</span><span className="tabular-nums text-blue-500">↓ {formatBytes(rule.totalDownload)}</span><span className="tabular-nums text-purple-500">↑ {formatBytes(rule.totalUpload)}</span></div>diff --git a/apps/web/components/top-domains-chart.tsx b/apps/web/components/top-domains-chart.tsxindex 8b62278..de684ee 100644--- a/apps/web/components/top-domains-chart.tsx+++ b/apps/web/components/top-domains-chart.tsx@@ -1,6 +1,6 @@"use client";-import { useState, useMemo } from "react";+import { useState, useMemo, useRef } from "react";import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Cell, LabelList } from "recharts";import { useTranslations } from "next-intl";import { BarChart3 } from "lucide-react";@@ -31,14 +31,34 @@ const COLORS = ["#F97316", // Orange];+// Custom label renderer to prevent text wrapping in SVG+function renderCustomBarLabel(props: any) {+ const { x, y, width, value, height } = props;+ return (+ <text+ x={x + width + 6}+ y={y + height / 2}+ fill="currentColor"+ fontSize={11}+ dominantBaseline="central"+ textAnchor="start"+ style={{ fontVariantNumeric: "tabular-nums" }}+ >+ {formatBytes(value, 0)}+ </text>+ );+}+export function TopDomainsChart({ data }: TopDomainsChartProps) {const t = useTranslations("domains");const commonT = useTranslations("stats");const [topN, setTopN] = useState<TopOption>(10);+ // Track whether this is the initial render to only animate on first load+ const hasRenderedRef = useRef(false);const chartData = useMemo(() => {if (!data) return [];- return data+ const result = data.slice(0, topN).map((domain, index) => ({name: domain.domain.length > 20 ? domain.domain.slice(0, 20) + "..." : domain.domain,@@ -48,6 +68,11 @@ export function TopDomainsChart({ data }: TopDomainsChartProps) {upload: domain.totalUpload,color: COLORS[index % COLORS.length],}));+ // After first data load, mark as rendered so subsequent updates skip animation+ if (result.length > 0) {+ setTimeout(() => { hasRenderedRef.current = true; }, 800);+ }+ return result;}, [data, topN]);const CustomTooltip = ({ active, payload }: any) => {@@ -136,16 +161,20 @@ export function TopDomainsChart({ data }: TopDomainsChartProps) {content={<CustomTooltip />}cursor={{ fill: "rgba(128, 128, 128, 0.1)" }}/>- <Bar dataKey="total" radius={[0, 4, 4, 0]} maxBarSize={32}>+ <Bar+ dataKey="total"+ radius={[0, 4, 4, 0]}+ maxBarSize={32}+ isAnimationActive={!hasRenderedRef.current}+ animationDuration={600}+ >{chartData.map((entry, index) => (<Cell key={`cell-${index}`} fill={entry.color} />))}<LabelListdataKey="total"position="right"- formatter={(value: number) => formatBytes(value, 0)}- className="fill-foreground"- style={{ fontSize: 10, whiteSpace: 'nowrap' }}+ content={renderCustomBarLabel}/></Bar></BarChart>diff --git a/apps/web/components/world-traffic-map.tsx b/apps/web/components/world-traffic-map.tsxindex e02e1be..beaa567 100644--- a/apps/web/components/world-traffic-map.tsx+++ b/apps/web/components/world-traffic-map.tsx@@ -9,6 +9,7 @@ import {} from "react-simple-maps";import { scaleLinear } from "d3-scale";import { Globe, Info } from "lucide-react";+import { useTranslations } from "next-intl";import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";import { formatBytes } from "@/lib/utils";import type { CountryStats } from "@clashstats/shared";@@ -46,6 +47,7 @@ const COUNTRY_NAME_MAPPING: Record<string, string> = {};export function WorldTrafficMap({ data }: WorldTrafficMapProps) {+ const t = useTranslations("map");const [hoveredCountry, setHoveredCountry] = useState<string | null>(null);const [tooltipData, setTooltipData] = useState<{country: string;@@ -157,7 +159,7 @@ export function WorldTrafficMap({ data }: WorldTrafficMapProps) {<CardHeader className="pb-2"><CardTitle className="text-lg font-semibold flex items-center gap-2"><Globe className="h-5 w-5 text-primary" />- Global Traffic Distribution+ {t("title")}</CardTitle></CardHeader><CardContent className="space-y-4">@@ -224,21 +226,21 @@ export function WorldTrafficMap({ data }: WorldTrafficMapProps) {</p><div className="space-y-1 text-xs"><div className="flex justify-between">- <span className="text-muted-foreground">Total:</span>+ <span className="text-muted-foreground">{t("total")}:</span><span className="font-medium">{formatBytes(tooltipData.traffic)}</span></div><div className="flex justify-between">- <span className="text-blue-500">↓ Download:</span>+ <span className="text-blue-500">↓ {t("download")}:</span><span>{formatBytes(tooltipData.download)}</span></div><div className="flex justify-between">- <span className="text-purple-500">↑ Upload:</span>+ <span className="text-purple-500">↑ {t("upload")}:</span><span>{formatBytes(tooltipData.upload)}</span></div><div className="flex justify-between">- <span className="text-emerald-500">Connections:</span>+ <span className="text-emerald-500">{t("connections")}:</span><span>{tooltipData.connections.toLocaleString()}</span></div></div>@@ -249,7 +251,7 @@ export function WorldTrafficMap({ data }: WorldTrafficMapProps) {{/* Info hint */}<div className="absolute bottom-2 left-2 flex items-center gap-1 text-xs text-muted-foreground bg-background/80 px-2 py-1 rounded"><Info className="w-3 h-3" />- <span>Hover over countries for details</span>+ <span>{t("hoverHint")}</span></div></div>@@ -257,9 +259,9 @@ export function WorldTrafficMap({ data }: WorldTrafficMapProps) {<div className="flex flex-wrap items-center justify-between gap-4">{/* Color scale legend */}<div className="flex items-center gap-2">- <span className="text-xs text-muted-foreground">Traffic:</span>+ <span className="text-xs text-muted-foreground">{t("traffic")}</span><div className="flex items-center gap-1">- <span className="text-xs">Low</span>+ <span className="text-xs">{t("low")}</span><div className="flex"><divclassName="w-6 h-3"@@ -278,7 +280,7 @@ export function WorldTrafficMap({ data }: WorldTrafficMapProps) {style={{ backgroundColor: "#4f46e5" }}/></div>- <span className="text-xs">High</span>+ <span className="text-xs">{t("high")}</span></div></div>diff --git a/apps/web/hooks/use-version-check.ts b/apps/web/hooks/use-version-check.tsnew file mode 100644index 0000000..15b9dd2--- /dev/null+++ b/apps/web/hooks/use-version-check.ts@@ -0,0 +1,102 @@+"use client";++import { useState, useEffect, useCallback } from "react";++const GITHUB_PACKAGE_URL =+ "https://raw.githubusercontent.com/foru17/clash-master/refs/heads/main/package.json";+const GITHUB_API_URL =+ "https://api.github.com/repos/foru17/clash-master";+const CHECK_INTERVAL = 30 * 60 * 1000; // Check every 30 minutes+const FETCH_TIMEOUT = 10000; // 10 seconds++/**+ * Compare two semver version strings.+ * Returns > 0 if remote is newer, 0 if equal, < 0 if current is newer.+ */+function compareVersions(current: string, remote: string): number {+ const a = current.replace(/^v/, "").split(".").map(Number);+ const b = remote.replace(/^v/, "").split(".").map(Number);+ for (let i = 0; i < Math.max(a.length, b.length); i++) {+ const diff = (b[i] || 0) - (a[i] || 0);+ if (diff !== 0) return diff;+ }+ return 0;+}++interface VersionCheckResult {+ /** The latest version from GitHub, null if not yet checked or failed */+ latestVersion: string | null;+ /** Whether a newer version is available */+ hasUpdate: boolean;+ /** Whether the check is currently in progress */+ isChecking: boolean;+ /** GitHub stars count, null if not yet fetched or failed */+ stars: number | null;+ /** Manually trigger a version check */+ checkNow: () => void;+}++export function useVersionCheck(currentVersion: string): VersionCheckResult {+ const [latestVersion, setLatestVersion] = useState<string | null>(null);+ const [hasUpdate, setHasUpdate] = useState(false);+ const [isChecking, setIsChecking] = useState(false);+ const [stars, setStars] = useState<number | null>(null);++ const check = useCallback(async () => {+ setIsChecking(true);+ try {+ const controller = new AbortController();+ const timeoutId = setTimeout(() => controller.abort(), FETCH_TIMEOUT);++ // Fetch version and stars in parallel+ const [pkgRes, repoRes] = await Promise.allSettled([+ fetch(GITHUB_PACKAGE_URL, {+ cache: "no-store",+ signal: controller.signal,+ }),+ fetch(GITHUB_API_URL, {+ cache: "no-store",+ signal: controller.signal,+ }),+ ]);++ clearTimeout(timeoutId);++ // Handle version check+ if (pkgRes.status === "fulfilled" && pkgRes.value.ok) {+ const pkg = await pkgRes.value.json();+ if (pkg.version) {+ setLatestVersion(pkg.version);+ setHasUpdate(compareVersions(currentVersion, pkg.version) > 0);+ }+ }++ // Handle stars count+ if (repoRes.status === "fulfilled" && repoRes.value.ok) {+ const repo = await repoRes.value.json();+ if (typeof repo.stargazers_count === "number") {+ setStars(repo.stargazers_count);+ }+ }+ } catch {+ // Silently fail — network errors, timeouts, CORS issues, etc.+ } finally {+ setIsChecking(false);+ }+ }, [currentVersion]);++ useEffect(() => {+ // Initial check with a short delay to avoid blocking page load+ const initialTimer = setTimeout(check, 3000);++ // Periodic checks+ const interval = setInterval(check, CHECK_INTERVAL);++ return () => {+ clearTimeout(initialTimer);+ clearInterval(interval);+ };+ }, [check]);++ return { latestVersion, hasUpdate, isChecking, stars, checkNow: check };+}diff --git a/apps/web/messages/en.json b/apps/web/messages/en.jsonindex 4201c71..b4b2594 100644--- a/apps/web/messages/en.json+++ b/apps/web/messages/en.json@@ -126,6 +126,7 @@"download": "Download","upload": "Upload","connections": "Connections",+ "conn": "Conn","ipsCount": "IPs","showing": "Showing","of": "of",@@ -134,18 +135,61 @@},"countries": {"title": "Countries",- "details": "Country Details"+ "details": "Country Details",+ "distribution": "Country Traffic Distribution",+ "continents": "Continents:",+ "noData": "No data",+ "connections": "connections"},"proxies": {- "title": "Proxies"+ "title": "Proxies",+ "distribution": "Proxy Traffic Distribution",+ "total": "Total",+ "download": "Download",+ "upload": "Upload",+ "connections": "connections",+ "sortByTraffic": "Traffic",+ "sortByConnections": "Connections",+ "noData": "No data",+ "viewAll": "View all"},"rules": {- "title": "Rules"+ "title": "Rules",+ "distribution": "Rule Chain Distribution",+ "description": "Traffic distribution by matching rules and their final proxy nodes",+ "connections": "conn"},"network": {"title": "Network","comingSoon": "Real-time connection monitoring coming soon..."},+ "map": {+ "title": "Global Traffic Distribution",+ "total": "Total",+ "download": "Download",+ "upload": "Upload",+ "connections": "Connections",+ "hoverHint": "Hover over countries for details",+ "traffic": "Traffic:",+ "low": "Low",+ "high": "High"+ },+ "about": {+ "title": "About",+ "version": "Version",+ "projectName": "Clash Master",+ "description": "Modern and beautiful traffic analysis dashboard for OpenClash",+ "github": "GitHub",+ "openSource": "Open Source Project",+ "license": "MIT License",+ "currentVersion": "Current Version",+ "latestVersion": "Latest Version",+ "updateAvailable": "Update Available",+ "upToDate": "Up to date",+ "checkingUpdate": "Checking...",+ "checkNow": "Check",+ "viewOnGitHub": "View on GitHub"+ },"common": {"search": "Search","cancel": "Cancel",diff --git a/apps/web/messages/zh.json b/apps/web/messages/zh.jsonindex 0999295..34d4af1 100644--- a/apps/web/messages/zh.json+++ b/apps/web/messages/zh.json@@ -126,6 +126,7 @@"download": "下载","upload": "上传","connections": "连接",+ "conn": "连接","ipsCount": "个 IP","showing": "显示","of": "共",@@ -134,18 +135,61 @@},"countries": {"title": "国家/地区",- "details": "国家/地区详情"+ "details": "国家/地区详情",+ "distribution": "国家/地区流量分布",+ "continents": "大洲:",+ "noData": "暂无数据",+ "connections": "连接"},"proxies": {- "title": "代理节点"+ "title": "代理节点",+ "distribution": "代理节点流量分布",+ "total": "总计",+ "download": "下载",+ "upload": "上传",+ "connections": "连接",+ "sortByTraffic": "流量",+ "sortByConnections": "连接",+ "noData": "暂无数据",+ "viewAll": "查看全部"},"rules": {- "title": "规则"+ "title": "规则",+ "distribution": "规则链路分布",+ "description": "按匹配规则和最终代理节点的流量分布",+ "connections": "连接"},"network": {"title": "网络","comingSoon": "实时连接监控功能开发中..."},+ "map": {+ "title": "全球流量分布",+ "total": "总计",+ "download": "下载",+ "upload": "上传",+ "connections": "连接数",+ "hoverHint": "悬停查看国家详情",+ "traffic": "流量:",+ "low": "低",+ "high": "高"+ },+ "about": {+ "title": "关于",+ "version": "版本",+ "projectName": "Clash Master",+ "description": "现代美观的 OpenClash 流量分析看板",+ "github": "GitHub",+ "openSource": "开源项目",+ "license": "MIT 许可证",+ "currentVersion": "当前版本",+ "latestVersion": "最新版本",+ "updateAvailable": "有新版本",+ "upToDate": "已是最新版本",+ "checkingUpdate": "检查中...",+ "checkNow": "检查",+ "viewOnGitHub": "在 GitHub 查看"+ },"common": {"search": "搜索","cancel": "取消",diff --git a/apps/web/package.json b/apps/web/package.jsonindex cf75a91..3648955 100644--- a/apps/web/package.json+++ b/apps/web/package.json@@ -1,6 +1,6 @@{"name": "@clashstats/web",- "version": "1.0.0",+ "version": "1.0.1","private": true,"scripts": {"dev": "next dev -p 3000",diff --git a/package.json b/package.jsonindex f951f6c..584f39e 100644--- a/package.json+++ b/package.json@@ -1 +1 @@-{"name":"openclash-stats","private":true,"workspaces":["apps/*","packages/*"],"packageManager":"[email protected]","scripts":{"build":"turbo build","dev":"turbo dev","lint":"turbo lint"},"devDependencies":{"turbo":"^2.3.0"}}+{"name":"openclash-stats","version":"1.0.1","private":true,"workspaces":["apps/*","packages/*"],"packageManager":"[email protected]","scripts":{"build":"turbo build","dev":"turbo dev","lint":"turbo lint"},"devDependencies":{"turbo":"^2.3.0"}}