feat: Enhance configuration validation and error handling

- Improve config validation process with detailed logging and error tracking
- Add more robust error handling in profile updates and config patches
- Implement comprehensive config validation using clash core subprocess
This commit is contained in:
wonfen
2025-02-23 10:53:09 +08:00
parent 16caccde51
commit 1291c38d58
9 changed files with 279 additions and 42 deletions

View File

@@ -81,6 +81,15 @@ const Layout = () => {
case "set_config::error":
Notice.error(msg);
break;
case "config_validate::error":
Notice.error(t("Config Validation Failed"));
break;
case "config_validate::process_terminated":
Notice.error(t("Config Validation Process Terminated"));
break;
case "config_validate::stderr_error":
Notice.error(msg);
break;
default:
break;
}

View File

@@ -27,7 +27,7 @@ import { useTranslation } from "react-i18next";
import {
importProfile,
enhanceProfiles,
restartCore,
//restartCore,
getRuntimeLogs,
deleteProfile,
updateProfile,
@@ -400,8 +400,8 @@ const ProfilePage = () => {
onSave={async (prev, curr) => {
if (prev !== curr && profiles.current === item.uid) {
await onEnhance(false);
await restartCore();
Notice.success(t("Clash Core Restarted"), 1000);
// await restartCore();
// Notice.success(t("Clash Core Restarted"), 1000);
}
}}
onDelete={() => onDelete(item.uid)}