diff --git a/src-tauri/src/enhance/builtin/meta_guard.js b/src-tauri/src/enhance/builtin/meta_guard.js index be4183b..e8ac897 100644 --- a/src-tauri/src/enhance/builtin/meta_guard.js +++ b/src-tauri/src/enhance/builtin/meta_guard.js @@ -1,6 +1,6 @@ -function main(params) { - if (params.mode === "script") { - params.mode = "rule"; +function main(config) { + if (config.mode === "script") { + config.mode = "rule"; } - return params; + return config; } diff --git a/src-tauri/src/enhance/builtin/meta_hy_alpn.js b/src-tauri/src/enhance/builtin/meta_hy_alpn.js index da1fac0..92c196e 100644 --- a/src-tauri/src/enhance/builtin/meta_hy_alpn.js +++ b/src-tauri/src/enhance/builtin/meta_hy_alpn.js @@ -1,10 +1,10 @@ -function main(params) { - if (Array.isArray(params.proxies)) { - params.proxies.forEach((p, i) => { +function main(config) { + if (Array.isArray(config.proxies)) { + config.proxies.forEach((p, i) => { if (p.type === "hysteria" && typeof p.alpn === "string") { - params.proxies[i].alpn = [p.alpn]; + config.proxies[i].alpn = [p.alpn]; } }); } - return params; + return config; } diff --git a/src-tauri/src/utils/tmpl.rs b/src-tauri/src/utils/tmpl.rs index 4d760ef..9b43e39 100644 --- a/src-tauri/src/utils/tmpl.rs +++ b/src-tauri/src/utils/tmpl.rs @@ -1,18 +1,17 @@ //! Some config file template /// template for new a profile item -pub const ITEM_LOCAL: &str = "# Profile Template for clash verge +pub const ITEM_LOCAL: &str = "# Profile Template for Clash Verge -proxies: +proxies: [] -proxy-groups: +proxy-groups: [] -rules: +rules: [] "; /// enhanced profile -pub const ITEM_MERGE: &str = "# Merge Template for clash verge -# The `Merge` format used to enhance profile +pub const ITEM_MERGE: &str = "# Profile Enhancement Merge Template for Clash Verge prepend-rules: [] @@ -36,9 +35,9 @@ append-proxy-groups: [] "; /// enhanced profile -pub const ITEM_SCRIPT: &str = "// Define the `main` function +pub const ITEM_SCRIPT: &str = "// Define main function (script entry) -function main(params) { - return params; +function main(config) { + return config; } ";