mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-15 16:44:43 +01:00
fix merge conflicts
This commit is contained in:
@@ -1,30 +1,57 @@
|
||||
#![cfg_attr(
|
||||
all(not(debug_assertions), target_os = "windows"),
|
||||
windows_subsystem = "windows"
|
||||
all(not(debug_assertions), target_os = "windows"),
|
||||
windows_subsystem = "windows"
|
||||
)]
|
||||
|
||||
use tracing::log::error;
|
||||
use opener;
|
||||
|
||||
mod downloader;
|
||||
mod proxy;
|
||||
|
||||
use tauri::{
|
||||
command
|
||||
};
|
||||
use opener;
|
||||
/**
|
||||
* Application shutdown handler.
|
||||
*/
|
||||
async fn shutdown_signal() {
|
||||
|
||||
}
|
||||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.invoke_handler(tauri::generate_handler![run_program])
|
||||
.invoke_handler(tauri::generate_handler![downloader::download_file])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
.invoke_handler(tauri::generate_handler![run_program])
|
||||
.invoke_handler(tauri::generate_handler![downloader::download_file])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
async fn connect() {
|
||||
// Create a proxy instance.
|
||||
let proxy_server = proxy::create_proxy().await;
|
||||
|
||||
// Create the proxy & listen for errors.
|
||||
let result = proxy_server.start(shutdown_signal()).await;
|
||||
if result {
|
||||
error!("Unable to start proxy");
|
||||
}
|
||||
|
||||
// Change proxy settings.
|
||||
proxy::connect_to_proxy();
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn disconnect() {
|
||||
// Change proxy settings.
|
||||
proxy::disconnect_from_proxy();
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn test() {
|
||||
println!("test");
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn run_program(path: String) {
|
||||
// Open the program from the specified path.
|
||||
opener::open(path.clone());
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn connect() {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user