tauri: Replace portmaster plugin with interface

This commit is contained in:
Vladimir Stoilov
2024-04-23 15:48:04 +03:00
parent 338abd6090
commit 7ee1faa68c
6 changed files with 1906 additions and 18857 deletions

View File

@@ -75,7 +75,7 @@ export class TauriIntegrationService implements IntegrationService {
}
getAppInfo(info: ProcessInfo): Promise<AppInfo> {
return asyncInvoke("plugin:portmaster|get_app_info", {
return asyncInvoke("get_app_info", {
...info,
})
}
@@ -112,7 +112,7 @@ export class TauriIntegrationService implements IntegrationService {
async shouldShow(): Promise<boolean> {
try {
const response = await invoke<string>("plugin:portmaster|should_show");
const response = await invoke<string>("should_show");
return response === "show";
} catch (err) {
console.error(err);
@@ -122,7 +122,7 @@ export class TauriIntegrationService implements IntegrationService {
async shouldHandlePrompts(): Promise<boolean> {
try {
const response = await invoke<string>("plugin:portmaster|should_handle_prompts")
const response = await invoke<string>("should_handle_prompts")
return response === "true"
} catch (err) {
console.error(err);
@@ -131,22 +131,22 @@ export class TauriIntegrationService implements IntegrationService {
}
get_state(key: string): Promise<string> {
return invoke<string>("plugin:portmaster|get_state");
return invoke<string>("get_state");
}
set_state(key: string, value: string): Promise<void> {
return invoke<void>("plugin:portmaster|set_state", {
return invoke<void>("set_state", {
key,
value
})
}
getServiceManagerStatus(): Promise<ServiceManagerStatus> {
return asyncInvoke("plugin:portmaster|get_service_manager_status", {})
return asyncInvoke("get_service_manager_status", {})
}
startService(): Promise<any> {
return asyncInvoke("plugin:portmaster|start_service", {});
return asyncInvoke("start_service", {});
}
onExitRequest(cb: () => void): () => void {