|
@@ -1,258 +1,179 @@
|
|
use crate::{
|
|
use crate::{
|
|
- core::Core,
|
|
|
|
- data::{ClashInfo, Data, PrfItem, PrfOption, Profiles, Verge},
|
|
|
|
|
|
+ config::*,
|
|
|
|
+ core::*,
|
|
|
|
+ feat,
|
|
utils::{dirs, help},
|
|
utils::{dirs, help},
|
|
};
|
|
};
|
|
-use crate::{log_if_err, ret_err, wrap_err};
|
|
|
|
-use anyhow::Result;
|
|
|
|
|
|
+use crate::{ret_err, wrap_err};
|
|
|
|
+use anyhow::{Context, Result};
|
|
use serde_yaml::Mapping;
|
|
use serde_yaml::Mapping;
|
|
use std::collections::{HashMap, VecDeque};
|
|
use std::collections::{HashMap, VecDeque};
|
|
use sysproxy::Sysproxy;
|
|
use sysproxy::Sysproxy;
|
|
|
|
|
|
type CmdResult<T = ()> = Result<T, String>;
|
|
type CmdResult<T = ()> = Result<T, String>;
|
|
|
|
|
|
-/// get all profiles from `profiles.yaml`
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
-pub fn get_profiles() -> CmdResult<Profiles> {
|
|
|
|
- let global = Data::global();
|
|
|
|
- let profiles = global.profiles.lock();
|
|
|
|
- Ok(profiles.clone())
|
|
|
|
|
|
+pub fn get_profiles() -> CmdResult<IProfiles> {
|
|
|
|
+ Ok(Config::profiles().data().clone())
|
|
}
|
|
}
|
|
|
|
|
|
-/// manually exec enhanced profile
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
-pub fn enhance_profiles() -> CmdResult {
|
|
|
|
- let core = Core::global();
|
|
|
|
- wrap_err!(core.activate())
|
|
|
|
|
|
+pub async fn enhance_profiles() -> CmdResult {
|
|
|
|
+ wrap_err!(CoreManager::global().update_config().await)?;
|
|
|
|
+ handle::Handle::refresh_clash();
|
|
|
|
+ Ok(())
|
|
}
|
|
}
|
|
|
|
|
|
-/// import the profile from url
|
|
|
|
-/// and save to `profiles.yaml`
|
|
|
|
|
|
+#[deprecated]
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
pub async fn import_profile(url: String, option: Option<PrfOption>) -> CmdResult {
|
|
pub async fn import_profile(url: String, option: Option<PrfOption>) -> CmdResult {
|
|
let item = wrap_err!(PrfItem::from_url(&url, None, None, option).await)?;
|
|
let item = wrap_err!(PrfItem::from_url(&url, None, None, option).await)?;
|
|
-
|
|
|
|
- let global = Data::global();
|
|
|
|
- let mut profiles = global.profiles.lock();
|
|
|
|
- wrap_err!(profiles.append_item(item))
|
|
|
|
|
|
+ wrap_err!(Config::profiles().data().append_item(item))
|
|
}
|
|
}
|
|
|
|
|
|
-/// new a profile
|
|
|
|
-/// append a temp profile item file to the `profiles` dir
|
|
|
|
-/// view the temp profile file by using vscode or other editor
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
pub async fn create_profile(item: PrfItem, file_data: Option<String>) -> CmdResult {
|
|
pub async fn create_profile(item: PrfItem, file_data: Option<String>) -> CmdResult {
|
|
let item = wrap_err!(PrfItem::from(item, file_data).await)?;
|
|
let item = wrap_err!(PrfItem::from(item, file_data).await)?;
|
|
-
|
|
|
|
- let global = Data::global();
|
|
|
|
- let mut profiles = global.profiles.lock();
|
|
|
|
- wrap_err!(profiles.append_item(item))
|
|
|
|
|
|
+ wrap_err!(Config::profiles().data().append_item(item))
|
|
}
|
|
}
|
|
|
|
|
|
-/// Update the profile
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
pub async fn update_profile(index: String, option: Option<PrfOption>) -> CmdResult {
|
|
pub async fn update_profile(index: String, option: Option<PrfOption>) -> CmdResult {
|
|
- let core = Core::global();
|
|
|
|
- wrap_err!(core.update_profile_item(index, option).await)
|
|
|
|
|
|
+ wrap_err!(feat::update_profile(index, option).await)
|
|
}
|
|
}
|
|
|
|
|
|
-/// change the current profile
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
-pub fn select_profile(index: String) -> CmdResult {
|
|
|
|
- let global = Data::global();
|
|
|
|
- let mut profiles = global.profiles.lock();
|
|
|
|
- wrap_err!(profiles.put_current(index))?;
|
|
|
|
- drop(profiles);
|
|
|
|
-
|
|
|
|
- let core = Core::global();
|
|
|
|
- wrap_err!(core.activate())
|
|
|
|
-}
|
|
|
|
|
|
+pub async fn delete_profile(index: String) -> CmdResult {
|
|
|
|
+ let should_update = wrap_err!({ Config::profiles().data().delete_item(index) })?;
|
|
|
|
+ if should_update {
|
|
|
|
+ wrap_err!(CoreManager::global().update_config().await)?;
|
|
|
|
+ handle::Handle::refresh_clash();
|
|
|
|
+ }
|
|
|
|
|
|
-/// change the profile chain
|
|
|
|
-#[tauri::command]
|
|
|
|
-pub fn change_profile_chain(chain: Option<Vec<String>>) -> CmdResult {
|
|
|
|
- let global = Data::global();
|
|
|
|
- let mut profiles = global.profiles.lock();
|
|
|
|
- wrap_err!(profiles.put_chain(chain))?;
|
|
|
|
- drop(profiles);
|
|
|
|
-
|
|
|
|
- let core = Core::global();
|
|
|
|
- wrap_err!(core.activate())
|
|
|
|
|
|
+ Ok(())
|
|
}
|
|
}
|
|
|
|
|
|
-/// change the profile valid fields
|
|
|
|
|
|
+/// 修改profiles的
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
-pub fn change_profile_valid(valid: Option<Vec<String>>) -> CmdResult {
|
|
|
|
- let global = Data::global();
|
|
|
|
- let mut profiles = global.profiles.lock();
|
|
|
|
- wrap_err!(profiles.put_valid(valid))?;
|
|
|
|
- drop(profiles);
|
|
|
|
-
|
|
|
|
- let core = Core::global();
|
|
|
|
- wrap_err!(core.activate())
|
|
|
|
-}
|
|
|
|
|
|
+pub async fn patch_profiles_config(profiles: IProfiles) -> CmdResult {
|
|
|
|
+ wrap_err!({ Config::profiles().draft().patch_config(profiles) })?;
|
|
|
|
|
|
-/// delete profile item
|
|
|
|
-#[tauri::command]
|
|
|
|
-pub fn delete_profile(index: String) -> CmdResult {
|
|
|
|
- let global = Data::global();
|
|
|
|
- let mut profiles = global.profiles.lock();
|
|
|
|
- if wrap_err!(profiles.delete_item(index))? {
|
|
|
|
- drop(profiles);
|
|
|
|
-
|
|
|
|
- let core = Core::global();
|
|
|
|
- log_if_err!(core.activate());
|
|
|
|
|
|
+ match CoreManager::global().update_config().await {
|
|
|
|
+ Ok(_) => {
|
|
|
|
+ handle::Handle::refresh_clash();
|
|
|
|
+ Config::profiles().apply();
|
|
|
|
+ wrap_err!(Config::profiles().data().save_file())?;
|
|
|
|
+ Ok(())
|
|
|
|
+ }
|
|
|
|
+ Err(err) => {
|
|
|
|
+ Config::profiles().discard();
|
|
|
|
+ log::error!(target: "app", "{err}");
|
|
|
|
+ Err(format!("{err}"))
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- Ok(())
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-/// patch the profile config
|
|
|
|
|
|
+/// 修改某个profile item的
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
pub fn patch_profile(index: String, profile: PrfItem) -> CmdResult {
|
|
pub fn patch_profile(index: String, profile: PrfItem) -> CmdResult {
|
|
- let global = Data::global();
|
|
|
|
- let mut profiles = global.profiles.lock();
|
|
|
|
- wrap_err!(profiles.patch_item(index, profile))?;
|
|
|
|
- drop(profiles);
|
|
|
|
-
|
|
|
|
- // update cron task
|
|
|
|
- let core = Core::global();
|
|
|
|
- let mut timer = core.timer.lock();
|
|
|
|
- wrap_err!(timer.refresh())
|
|
|
|
|
|
+ wrap_err!(Config::profiles().data().patch_item(index, profile))?;
|
|
|
|
+ wrap_err!(timer::Timer::global().refresh())
|
|
}
|
|
}
|
|
|
|
|
|
-/// run vscode command to edit the profile
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
pub fn view_profile(index: String) -> CmdResult {
|
|
pub fn view_profile(index: String) -> CmdResult {
|
|
- let global = Data::global();
|
|
|
|
- let profiles = global.profiles.lock();
|
|
|
|
- let item = wrap_err!(profiles.get_item(&index))?;
|
|
|
|
-
|
|
|
|
- let file = item.file.clone();
|
|
|
|
- if file.is_none() {
|
|
|
|
- ret_err!("file is null");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- let path = dirs::app_profiles_dir().join(file.unwrap());
|
|
|
|
|
|
+ let file = {
|
|
|
|
+ wrap_err!(Config::profiles().latest().get_item(&index))?
|
|
|
|
+ .file
|
|
|
|
+ .clone()
|
|
|
|
+ .ok_or("the file field is null")
|
|
|
|
+ }?;
|
|
|
|
+
|
|
|
|
+ let path = wrap_err!(dirs::app_profiles_dir())?.join(file);
|
|
if !path.exists() {
|
|
if !path.exists() {
|
|
- ret_err!("file not found");
|
|
|
|
|
|
+ ret_err!("the file not found");
|
|
}
|
|
}
|
|
|
|
|
|
wrap_err!(help::open_file(path))
|
|
wrap_err!(help::open_file(path))
|
|
}
|
|
}
|
|
|
|
|
|
-/// read the profile item file data
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
pub fn read_profile_file(index: String) -> CmdResult<String> {
|
|
pub fn read_profile_file(index: String) -> CmdResult<String> {
|
|
- let global = Data::global();
|
|
|
|
- let profiles = global.profiles.lock();
|
|
|
|
|
|
+ let profiles = Config::profiles();
|
|
|
|
+ let profiles = profiles.latest();
|
|
let item = wrap_err!(profiles.get_item(&index))?;
|
|
let item = wrap_err!(profiles.get_item(&index))?;
|
|
let data = wrap_err!(item.read_file())?;
|
|
let data = wrap_err!(item.read_file())?;
|
|
Ok(data)
|
|
Ok(data)
|
|
}
|
|
}
|
|
|
|
|
|
-/// save the profile item file data
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
pub fn save_profile_file(index: String, file_data: Option<String>) -> CmdResult {
|
|
pub fn save_profile_file(index: String, file_data: Option<String>) -> CmdResult {
|
|
if file_data.is_none() {
|
|
if file_data.is_none() {
|
|
return Ok(());
|
|
return Ok(());
|
|
}
|
|
}
|
|
|
|
|
|
- let global = Data::global();
|
|
|
|
- let profiles = global.profiles.lock();
|
|
|
|
|
|
+ let profiles = Config::profiles();
|
|
|
|
+ let profiles = profiles.latest();
|
|
let item = wrap_err!(profiles.get_item(&index))?;
|
|
let item = wrap_err!(profiles.get_item(&index))?;
|
|
wrap_err!(item.save_file(file_data.unwrap()))
|
|
wrap_err!(item.save_file(file_data.unwrap()))
|
|
}
|
|
}
|
|
|
|
|
|
-/// get the clash core info from the state
|
|
|
|
-/// the caller can also get the infomation by clash's api
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
-pub fn get_clash_info() -> CmdResult<ClashInfo> {
|
|
|
|
- let global = Data::global();
|
|
|
|
- let clash = global.clash.lock();
|
|
|
|
- Ok(clash.info.clone())
|
|
|
|
|
|
+pub fn get_clash_info() -> CmdResult<ClashInfoN> {
|
|
|
|
+ wrap_err!(Config::clash().latest().get_info())
|
|
}
|
|
}
|
|
|
|
|
|
-/// get the runtime clash config mapping
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
pub fn get_runtime_config() -> CmdResult<Option<Mapping>> {
|
|
pub fn get_runtime_config() -> CmdResult<Option<Mapping>> {
|
|
- let core = Core::global();
|
|
|
|
- let rt = core.runtime.lock();
|
|
|
|
- Ok(rt.config.clone())
|
|
|
|
|
|
+ Ok(Config::runtime().latest().config.clone())
|
|
}
|
|
}
|
|
|
|
|
|
-/// get the runtime clash config yaml string
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
-pub fn get_runtime_yaml() -> CmdResult<Option<String>> {
|
|
|
|
- let core = Core::global();
|
|
|
|
- let rt = core.runtime.lock();
|
|
|
|
- Ok(rt.config_yaml.clone())
|
|
|
|
|
|
+pub fn get_runtime_yaml() -> CmdResult<String> {
|
|
|
|
+ let runtime = Config::runtime();
|
|
|
|
+ let runtime = runtime.latest();
|
|
|
|
+ let config = runtime.config.as_ref();
|
|
|
|
+ wrap_err!(config
|
|
|
|
+ .ok_or(anyhow::anyhow!("failed to parse config to yaml file"))
|
|
|
|
+ .and_then(
|
|
|
|
+ |config| serde_yaml::to_string(config).context("failed to convert config to yaml")
|
|
|
|
+ ))
|
|
}
|
|
}
|
|
|
|
|
|
-/// get the runtime config exists keys
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
pub fn get_runtime_exists() -> CmdResult<Vec<String>> {
|
|
pub fn get_runtime_exists() -> CmdResult<Vec<String>> {
|
|
- let core = Core::global();
|
|
|
|
- let rt = core.runtime.lock();
|
|
|
|
- Ok(rt.exists_keys.clone())
|
|
|
|
|
|
+ Ok(Config::runtime().latest().exists_keys.clone())
|
|
}
|
|
}
|
|
|
|
|
|
-/// get the runtime enhanced chain log
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
pub fn get_runtime_logs() -> CmdResult<HashMap<String, Vec<(String, String)>>> {
|
|
pub fn get_runtime_logs() -> CmdResult<HashMap<String, Vec<(String, String)>>> {
|
|
- let core = Core::global();
|
|
|
|
- let rt = core.runtime.lock();
|
|
|
|
- Ok(rt.chain_logs.clone())
|
|
|
|
|
|
+ Ok(Config::runtime().latest().chain_logs.clone())
|
|
}
|
|
}
|
|
|
|
|
|
-/// update the clash core config
|
|
|
|
-/// after putting the change to the clash core
|
|
|
|
-/// then we should save the latest config
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
-pub fn patch_clash_config(payload: Mapping) -> CmdResult {
|
|
|
|
- let core = Core::global();
|
|
|
|
- wrap_err!(core.patch_clash(payload))
|
|
|
|
|
|
+pub async fn patch_clash_config(payload: Mapping) -> CmdResult {
|
|
|
|
+ wrap_err!(feat::patch_clash(payload).await)
|
|
}
|
|
}
|
|
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
-pub fn get_verge_config() -> CmdResult<Verge> {
|
|
|
|
- let global = Data::global();
|
|
|
|
- let verge = global.verge.lock();
|
|
|
|
- Ok(verge.clone())
|
|
|
|
|
|
+pub fn get_verge_config() -> CmdResult<IVerge> {
|
|
|
|
+ Ok(Config::verge().data().clone())
|
|
}
|
|
}
|
|
|
|
|
|
-/// patch the verge config
|
|
|
|
-/// this command only save the config and not responsible for other things
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
-pub fn patch_verge_config(payload: Verge) -> CmdResult {
|
|
|
|
- let core = Core::global();
|
|
|
|
- wrap_err!(core.patch_verge(payload))
|
|
|
|
|
|
+pub async fn patch_verge_config(payload: IVerge) -> CmdResult {
|
|
|
|
+ wrap_err!(feat::patch_verge(payload).await)
|
|
}
|
|
}
|
|
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
-pub fn update_hotkeys(hotkeys: Vec<String>) -> CmdResult {
|
|
|
|
- let core = Core::global();
|
|
|
|
- let mut hotkey = core.hotkey.lock();
|
|
|
|
- wrap_err!(hotkey.update(hotkeys))
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-/// change clash core
|
|
|
|
-#[tauri::command]
|
|
|
|
-pub fn change_clash_core(clash_core: Option<String>) -> CmdResult {
|
|
|
|
- let core = Core::global();
|
|
|
|
- wrap_err!(core.change_core(clash_core))
|
|
|
|
|
|
+pub async fn change_clash_core(clash_core: Option<String>) -> CmdResult {
|
|
|
|
+ wrap_err!(CoreManager::global().change_core(clash_core).await)
|
|
}
|
|
}
|
|
|
|
|
|
/// restart the sidecar
|
|
/// restart the sidecar
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
-pub fn restart_sidecar() -> CmdResult {
|
|
|
|
- let core = Core::global();
|
|
|
|
- wrap_err!(core.restart_clash())
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-/// kill all sidecars when update app
|
|
|
|
-#[tauri::command]
|
|
|
|
-pub fn kill_sidecar() {
|
|
|
|
- tauri::api::process::kill_children();
|
|
|
|
|
|
+pub async fn restart_sidecar() -> CmdResult {
|
|
|
|
+ wrap_err!(CoreManager::global().run_core().await)
|
|
}
|
|
}
|
|
|
|
|
|
/// get the system proxy
|
|
/// get the system proxy
|
|
@@ -273,64 +194,44 @@ pub fn get_sys_proxy() -> CmdResult<Mapping> {
|
|
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
pub fn get_clash_logs() -> CmdResult<VecDeque<String>> {
|
|
pub fn get_clash_logs() -> CmdResult<VecDeque<String>> {
|
|
- let core = Core::global();
|
|
|
|
- let service = core.service.lock();
|
|
|
|
- Ok(service.get_logs())
|
|
|
|
|
|
+ Ok(logger::Logger::global().get_log())
|
|
}
|
|
}
|
|
|
|
|
|
-/// open app config dir
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
pub fn open_app_dir() -> CmdResult<()> {
|
|
pub fn open_app_dir() -> CmdResult<()> {
|
|
- let app_dir = dirs::app_home_dir();
|
|
|
|
|
|
+ let app_dir = wrap_err!(dirs::app_home_dir())?;
|
|
wrap_err!(open::that(app_dir))
|
|
wrap_err!(open::that(app_dir))
|
|
}
|
|
}
|
|
|
|
|
|
-/// open logs dir
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
pub fn open_logs_dir() -> CmdResult<()> {
|
|
pub fn open_logs_dir() -> CmdResult<()> {
|
|
- let log_dir = dirs::app_logs_dir();
|
|
|
|
|
|
+ let log_dir = wrap_err!(dirs::app_logs_dir())?;
|
|
wrap_err!(open::that(log_dir))
|
|
wrap_err!(open::that(log_dir))
|
|
}
|
|
}
|
|
|
|
|
|
-/// open url
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
pub fn open_web_url(url: String) -> CmdResult<()> {
|
|
pub fn open_web_url(url: String) -> CmdResult<()> {
|
|
wrap_err!(open::that(url))
|
|
wrap_err!(open::that(url))
|
|
}
|
|
}
|
|
|
|
|
|
-/// service mode
|
|
|
|
#[cfg(windows)]
|
|
#[cfg(windows)]
|
|
pub mod service {
|
|
pub mod service {
|
|
use super::*;
|
|
use super::*;
|
|
- use crate::core::win_service::JsonResponse;
|
|
|
|
|
|
+ use crate::core::win_service;
|
|
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
- pub async fn start_service() -> CmdResult<()> {
|
|
|
|
- wrap_err!(crate::core::Service::start_service().await)
|
|
|
|
|
|
+ pub async fn check_service() -> CmdResult<win_service::JsonResponse> {
|
|
|
|
+ wrap_err!(win_service::check_service().await)
|
|
}
|
|
}
|
|
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
- pub async fn stop_service() -> CmdResult<()> {
|
|
|
|
- wrap_err!(crate::core::Service::stop_service().await)
|
|
|
|
|
|
+ pub async fn install_service() -> CmdResult {
|
|
|
|
+ wrap_err!(win_service::install_service().await)
|
|
}
|
|
}
|
|
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
- pub async fn check_service() -> CmdResult<JsonResponse> {
|
|
|
|
- // no log
|
|
|
|
- match crate::core::Service::check_service().await {
|
|
|
|
- Ok(res) => Ok(res),
|
|
|
|
- Err(err) => Err(err.to_string()),
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- #[tauri::command]
|
|
|
|
- pub async fn install_service() -> CmdResult<()> {
|
|
|
|
- wrap_err!(crate::core::Service::install_service().await)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- #[tauri::command]
|
|
|
|
- pub async fn uninstall_service() -> CmdResult<()> {
|
|
|
|
- wrap_err!(crate::core::Service::uninstall_service().await)
|
|
|
|
|
|
+ pub async fn uninstall_service() -> CmdResult {
|
|
|
|
+ wrap_err!(win_service::uninstall_service().await)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -339,23 +240,15 @@ pub mod service {
|
|
use super::*;
|
|
use super::*;
|
|
|
|
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
- pub async fn start_service() -> CmdResult<()> {
|
|
|
|
- Ok(())
|
|
|
|
- }
|
|
|
|
- #[tauri::command]
|
|
|
|
- pub async fn stop_service() -> CmdResult<()> {
|
|
|
|
- Ok(())
|
|
|
|
- }
|
|
|
|
- #[tauri::command]
|
|
|
|
- pub async fn check_service() -> CmdResult<()> {
|
|
|
|
|
|
+ pub async fn check_service() -> CmdResult {
|
|
Ok(())
|
|
Ok(())
|
|
}
|
|
}
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
- pub async fn install_service() -> CmdResult<()> {
|
|
|
|
|
|
+ pub async fn install_service() -> CmdResult {
|
|
Ok(())
|
|
Ok(())
|
|
}
|
|
}
|
|
#[tauri::command]
|
|
#[tauri::command]
|
|
- pub async fn uninstall_service() -> CmdResult<()> {
|
|
|
|
|
|
+ pub async fn uninstall_service() -> CmdResult {
|
|
Ok(())
|
|
Ok(())
|
|
}
|
|
}
|
|
}
|
|
}
|