MCPcopy
hub / github.com/shiyi-0x7f/o-lib / handleImportHosts

Function handleImportHosts

src/pages/SettingsPage/index.tsx:81–92  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

79 };
80
81 const handleImportHosts = async (text: string) => {
82 if (!text) return;
83 try {
84 const count: number = await invoke("import_hosts", { text });
85 await loadConfig();
86 await loadHostsInfo();
87 pingHosts();
88 alert(`导入成功,共 ${count} 个节点`);
89 } catch (err: any) {
90 alert(`导入失败: ${err}`);
91 }
92 };
93
94 const handleResetHosts = async () => {
95 try {

Callers

nothing calls this directly

Calls 3

loadConfigFunction · 0.85
loadHostsInfoFunction · 0.85
pingHostsFunction · 0.85

Tested by

no test coverage detected