mirror of
https://github.com/EasyTier/EasyTier.git
synced 2024-11-16 03:32:43 +08:00
🎈 perf: 拆分composable
This commit is contained in:
parent
856cd33f26
commit
795b8ec1d0
22
easytier-gui/src/composables/network.ts
Normal file
22
easytier-gui/src/composables/network.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
import { NetworkConfig } from "~/types/network";
|
||||
import { invoke } from "@tauri-apps/api/tauri";
|
||||
|
||||
export async function parseNetworkConfig(cfg: NetworkConfig): Promise<string> {
|
||||
const ret: string = await invoke("parse_network_config", { cfg: JSON.stringify(cfg) });
|
||||
return ret;
|
||||
}
|
||||
|
||||
export async function runNetworkInstance(cfg: NetworkConfig) {
|
||||
const ret: string = await invoke("run_network_instance", { cfg: JSON.stringify(cfg) });
|
||||
return ret;
|
||||
}
|
||||
|
||||
export async function retainNetworkInstance(instanceIds: Array<string>) {
|
||||
const ret: string = await invoke("retain_network_instance", { instanceIds: JSON.stringify(instanceIds) });
|
||||
return ret;
|
||||
}
|
||||
|
||||
export async function collectNetworkInfos() {
|
||||
const ret: string = await invoke("collect_network_infos", {});
|
||||
return JSON.parse(ret);
|
||||
}
|
Loading…
Reference in New Issue
Block a user