mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-08 02:52:07 +08:00
refactor: debugLog for frontend (#5587)
This commit is contained in:
@@ -41,6 +41,7 @@ import {
|
||||
|
||||
import { useProxiesData } from "@/hooks/app-data";
|
||||
import { calcuProxies, updateProxyChainConfigInRuntime } from "@/services/cmds";
|
||||
import { debugLog } from "@/utils/debug";
|
||||
|
||||
interface ProxyChainItem {
|
||||
id: string;
|
||||
@@ -319,13 +320,13 @@ export const ProxyChain = ({
|
||||
try {
|
||||
// 第一步:保存链式代理配置
|
||||
const chainProxies = proxyChain.map((node) => node.name);
|
||||
console.log("Saving chain config:", chainProxies);
|
||||
debugLog("Saving chain config:", chainProxies);
|
||||
await updateProxyChainConfigInRuntime(chainProxies);
|
||||
console.log("Chain configuration saved successfully");
|
||||
debugLog("Chain configuration saved successfully");
|
||||
|
||||
// 第二步:连接到代理链的最后一个节点
|
||||
const lastNode = proxyChain[proxyChain.length - 1];
|
||||
console.log(`Connecting to proxy chain, last node: ${lastNode.name}`);
|
||||
debugLog(`Connecting to proxy chain, last node: ${lastNode.name}`);
|
||||
|
||||
// 根据模式确定使用的代理组名称
|
||||
if (mode !== "global" && !selectedGroup) {
|
||||
@@ -340,7 +341,7 @@ export const ProxyChain = ({
|
||||
|
||||
// 刷新代理信息以更新连接状态
|
||||
mutateProxies();
|
||||
console.log("Successfully connected to proxy chain");
|
||||
debugLog("Successfully connected to proxy chain");
|
||||
} catch (error) {
|
||||
console.error("Failed to connect to proxy chain:", error);
|
||||
alert(t("proxies.page.chain.connectFailed") || "连接链式代理失败");
|
||||
|
||||
Reference in New Issue
Block a user