Files
黑先森 b94d5de463 优化多个界面的数据同步问题,增加功能,修复bug
高级选项-增加默认协议配置
高级选项-增加自定义监听相关配置
修复创建子窗口多次触发监听的问题
config.json增加对自定义协议配置
优化高级选项文本说明
2024-12-03 18:07:42 +08:00

25 lines
717 B
TypeScript

import useMainStore from "@/stores/index";
export const getServerArgs = () => {
const mainStore = useMainStore();
const args = [];
if (!mainStore.serverConfig.port) {
mainStore.serverConfig.port = "11010";
}
args.push("-l", mainStore.serverConfig.port);
if (mainStore.serverConfig.relayAllPeerrpc) {
args.push("--relay-all-peer-rpc");
}
const whiteList = mainStore.serverConfig.serverWhiteList
.trim()
.split("\n")
.map(el => el.trim())
.filter(el => el)
if (whiteList && mainStore.serverConfig.enableWhiteList) {
args.push("--relay-network-whitelist", ...whiteList);
}
if (!whiteList && mainStore.serverConfig.enableWhiteList) {
args.push("--relay-network-whitelist");
}
return args;
};