diff --git a/UPDATELOG.md b/UPDATELOG.md index 379b968b..f0ceba65 100644 --- a/UPDATELOG.md +++ b/UPDATELOG.md @@ -14,6 +14,7 @@ #### 新增了: - ClashVergeRev 从现在开始不再强依赖系统服务和管理权限 + - 支持根据用户偏好选择Sidecar(用户空间)模式或安装服务 #### 优化了: - 重构了后端内核管理逻辑,更轻量化和有效的管理内核,提高了性能和稳定性 diff --git a/src/components/home/enhanced-traffic-graph.tsx b/src/components/home/enhanced-traffic-graph.tsx index b9aee07e..4b2a82aa 100644 --- a/src/components/home/enhanced-traffic-graph.tsx +++ b/src/components/home/enhanced-traffic-graph.tsx @@ -122,7 +122,7 @@ export const EnhancedTrafficGraph = memo(forwardRef( // 更新显示数据 const pointsToShow = getMaxPointsByTimeRange(timeRange); setDisplayData(initialBuffer.slice(-pointsToShow)); - }, [MAX_BUFFER_SIZE, getMaxPointsByTimeRange, timeRange]); + }, [MAX_BUFFER_SIZE, getMaxPointsByTimeRange]); // 添加数据点方法 const appendData = useCallback((data: ITrafficItem) => { @@ -205,7 +205,7 @@ export const EnhancedTrafficGraph = memo(forwardRef( // 共享图表配置 const chartConfig = useMemo(() => ({ data: displayData, - margin: { top: 10, right: 20, left: 0, bottom: 0 }, + margin: { top: 20, right: 10, left: 0, bottom: -10 }, }), [displayData]); // 共享的线条/区域配置 @@ -228,186 +228,138 @@ export const EnhancedTrafficGraph = memo(forwardRef( position: "relative", bgcolor: "action.hover", borderRadius: 1, - padding: 1, cursor: "pointer", }} onClick={toggleStyle} > - {chartStyle === "line" ? ( - - - - - `${t("Time")}: ${label}`} - contentStyle={{ - backgroundColor: colors.tooltip, - borderColor: colors.grid, - borderRadius: 4, - }} - itemStyle={{ color: colors.text }} - isAnimationActive={false} - /> - - - - {/* 可点击的时间范围标签 */} - - {getTimeRangeText()} - - - {/* 上传标签 - 右上角 */} - - {t("Upload")} - + {/* 根据chartStyle动态选择图表类型 */} + {(() => { + // 创建共享的图表组件 + const commonChartComponents = ( + <> + + + + `${t("Time")}: ${label}`} + contentStyle={{ + backgroundColor: colors.tooltip, + borderColor: colors.grid, + borderRadius: 4, + }} + itemStyle={{ color: colors.text }} + isAnimationActive={false} + /> + + {/* 可点击的时间范围标签 */} + + {getTimeRangeText()} + + + {/* 上传标签 - 右上角 */} + + {t("Upload")} + - {/* 下载标签 - 右上角下方 */} - - {t("Download")} - - - ) : ( - - - - - `${t("Time")}: ${label}`} - contentStyle={{ - backgroundColor: colors.tooltip, - borderColor: colors.grid, - borderRadius: 4, - }} - itemStyle={{ color: colors.text }} - isAnimationActive={false} - /> - - - - {/* 可点击的时间范围标签 */} - - {getTimeRangeText()} - - - {/* 上传标签 - 右上角 */} - - {t("Upload")} - + {/* 下载标签 - 右上角下方 */} + + {t("Download")} + + + ); - {/* 下载标签 - 右上角下方 */} - - {t("Download")} - - - )} + // 根据chartStyle返回相应的图表类型 + if (chartStyle === "line") { + return ( + + {commonChartComponents} + + + + ); + } else { + return ( + + {commonChartComponents} + + + + ); + } + })()} ); diff --git a/src/components/setting/mods/dns-viewer.tsx b/src/components/setting/mods/dns-viewer.tsx index e90397d7..e0e10b0c 100644 --- a/src/components/setting/mods/dns-viewer.tsx +++ b/src/components/setting/mods/dns-viewer.tsx @@ -576,7 +576,7 @@ export const DnsViewer = forwardRef((props, ref) => { open={open} title={ - {t("DNS Settings")} + {t("DNS Overwrite")}