dev-manager-tauri/src-tauri/src/lib.rs
lanrtop 0cdaa3678c feat: add Blueprint feature to ProjectCard and commands
- Introduced BlueprintModal in ProjectCard for project blueprint visualization.
- Added state management for displaying the BlueprintModal.
- Implemented Blueprint-related interfaces and functions in commands.ts for handling blueprint data.
2026-04-02 19:12:53 +09:00

160 lines
5.2 KiB
Rust
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mod commands;
mod db;
mod models;
use git2;
use commands::{activity::*, blueprint::*, canvas::*, cicd::*, devtools::*, git_ops::*, git_repos::*, github::*, groups::*, network::{get_wsl_ip, sync_wsl_proxy, get_wsl_proxy_status, clear_wsl_proxy, test_wsl_proxy_ip, test_win_proxy_ip}, project_scan::*, project_tools::*, projects::{batch_create_projects, create_project, delete_project, get_project, get_projects, scan_subfolders, update_project, update_project_tags}, proxy::*, publish::*, settings::{detect_editors, get_settings, search_editor_path, update_settings}, shell::*, spaces::*, tags::*, templates::*};
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_http::init())
.plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_updater::Builder::new().build())
.plugin(tauri_plugin_process::init())
.plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_shell::init())
.setup(|app| {
use tauri::Manager;
let data_dir = app.path().app_data_dir().expect("no app data dir");
db::init(data_dir);
// 禁用 libgit2 目录所有者验证,允许访问 WSL UNC 路径(\\wsl.localhost\...
unsafe {
let _ = git2::opts::set_verify_owner_validation(false);
}
// 种植内置模板(首次启动时执行)
commands::templates::seed_builtin_templates();
Ok(())
})
.invoke_handler(tauri::generate_handler![
// projects
get_projects,
get_project,
create_project,
update_project,
update_project_tags,
delete_project,
scan_subfolders,
batch_create_projects,
// activity
get_activity,
add_activity,
// groups
get_groups,
create_group,
update_group,
delete_group,
reorder_groups,
get_group_maps,
add_group_member,
remove_group_member,
// settings
get_settings,
update_settings,
detect_editors,
search_editor_path,
// project tools
get_project_tools,
add_project_tool,
update_project_tool,
remove_project_tool,
launch_tool,
// devtools
scan_dev_tools,
scan_wsl_dev_tools,
get_dev_tools,
save_dev_tools,
delete_dev_tool,
upsert_dev_tool,
// wsl proxy
get_wsl_ip,
sync_wsl_proxy,
get_wsl_proxy_status,
clear_wsl_proxy,
test_wsl_proxy_ip,
test_win_proxy_ip,
// v2rayn import
scan_v2rayn_nodes,
detect_v2rayn_db_path,
get_active_v2rayn_node,
// project env scan
scan_project_env,
get_project_env_tools,
save_project_env_tools,
// shell
open_editor,
open_terminal,
// git ops
git_clone,
git_status,
git_fetch,
git_pull,
git_push,
git_head_commit,
git_upstream_behind,
git_create_branch,
git_list_branches,
git_checkout_branch,
// github
github_save_account,
github_get_account,
github_get_token,
github_get_client_id,
github_logout,
github_start_oauth,
github_poll_oauth,
github_open_login_window,
// spaces
get_spaces,
create_space,
update_space,
delete_space,
set_current_space,
get_deploy_commands,
add_deploy_command,
remove_deploy_command,
execute_deploy,
// git repos registry
get_git_repos,
import_git_repos,
update_git_repo_deploy,
mount_repo,
delete_git_repo,
// publish to github
scan_local_git,
github_create_repo,
git_init_and_commit,
git_remote_set,
git_push_to_github,
register_and_link_repo,
write_gitignore,
resolve_wsl_path,
get_wsl_distros,
// project templates
list_templates,
get_template,
save_template,
delete_template,
create_project_from_template,
// tags
get_tags,
create_tag,
update_tag,
delete_tag,
get_project_tags,
set_project_tags,
get_all_project_tag_maps,
// cicd
get_cicd_config,
save_cicd_config,
generate_workflow,
// blueprint
get_blueprint,
// canvas state
get_canvas_state,
save_canvas_state,
])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}