(text: string)
| 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 { |
nothing calls this directly
no test coverage detected