mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-15 10:25:40 +00:00
4342be29d7
* 🐳 chore: dependencies * 🐞 fix: minor style issues fixed background white patches in dark mode fixed the line height of the status label, which resulted in a bloated appearance * 🌈 style: lint * ✨ feat: about
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { invoke } from '@tauri-apps/api/core'
|
|
|
|
import type { NetworkConfig, NetworkInstanceRunningInfo } from '~/types/network'
|
|
|
|
export async function parseNetworkConfig(cfg: NetworkConfig) {
|
|
return invoke<string>('parse_network_config', { cfg })
|
|
}
|
|
|
|
export async function runNetworkInstance(cfg: NetworkConfig) {
|
|
return invoke('run_network_instance', { cfg })
|
|
}
|
|
|
|
export async function retainNetworkInstance(instanceIds: string[]) {
|
|
return invoke('retain_network_instance', { instanceIds })
|
|
}
|
|
|
|
export async function collectNetworkInfos() {
|
|
return await invoke<Record<string, NetworkInstanceRunningInfo>>('collect_network_infos')
|
|
}
|
|
|
|
export async function getOsHostname() {
|
|
return await invoke<string>('get_os_hostname')
|
|
}
|
|
|
|
export async function isAutostart() {
|
|
return await invoke<boolean>('is_autostart')
|
|
}
|
|
|
|
export async function setLoggingLevel(level: string) {
|
|
return await invoke('set_logging_level', { level })
|
|
}
|
|
|
|
export async function setTunFd(instanceId: string, fd: number) {
|
|
return await invoke('set_tun_fd', { instanceId, fd })
|
|
}
|
|
|
|
export async function getEasytierVersion() {
|
|
return await invoke<string>('easytier_version')
|
|
}
|