mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 02:09:06 +00:00
fix android vpn permission grant (#2023)
* fix android vpn permission grant * fix url input behaviour
This commit is contained in:
@@ -10,6 +10,7 @@ export async function ping(value: string): Promise<string | null> {
|
||||
|
||||
export interface InvokeResponse {
|
||||
errorMsg?: string;
|
||||
granted?: boolean;
|
||||
}
|
||||
|
||||
export interface StartVpnRequest {
|
||||
@@ -20,6 +21,13 @@ export interface StartVpnRequest {
|
||||
mtu?: number;
|
||||
}
|
||||
|
||||
export interface VpnStatusResponse {
|
||||
running: boolean;
|
||||
ipv4Addr?: string;
|
||||
routes?: string[];
|
||||
dns?: string;
|
||||
}
|
||||
|
||||
export async function prepare_vpn(): Promise<InvokeResponse | null> {
|
||||
return await invoke<InvokeResponse>('plugin:vpnservice|prepare_vpn', {})
|
||||
}
|
||||
@@ -33,3 +41,7 @@ export async function start_vpn(request: StartVpnRequest): Promise<InvokeRespons
|
||||
export async function stop_vpn(): Promise<InvokeResponse | null> {
|
||||
return await invoke<InvokeResponse>('plugin:vpnservice|stop_vpn', {})
|
||||
}
|
||||
|
||||
export async function get_vpn_status(): Promise<VpnStatusResponse | null> {
|
||||
return await invoke<VpnStatusResponse>('plugin:vpnservice|get_vpn_status', {})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user