2024-06-22 17:17:07 -06:00
|
|
|
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
|
|
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
|
|
|
|
2024-06-27 16:53:21 -06:00
|
|
|
use self_update::cargo_crate_version;
|
2024-06-22 20:30:23 -06:00
|
|
|
use serde::Deserialize;
|
2024-10-23 22:24:50 -06:00
|
|
|
use serde::Serialize;
|
|
|
|
use serde_json::{Map, Result, Value};
|
|
|
|
use std::collections::{HashMap, HashSet};
|
|
|
|
use std::io::Seek;
|
|
|
|
use std::{io::Cursor, path::PathBuf};
|
2024-06-22 17:52:25 -06:00
|
|
|
|
2024-07-13 09:37:19 -06:00
|
|
|
//mod ftp;
|
2024-10-23 22:24:50 -06:00
|
|
|
mod admin;
|
|
|
|
mod https;
|
2024-06-22 20:30:23 -06:00
|
|
|
mod java;
|
2024-10-23 22:24:50 -06:00
|
|
|
mod modpack;
|
2024-06-22 20:30:23 -06:00
|
|
|
mod prism;
|
2024-10-23 22:24:50 -06:00
|
|
|
mod sftp;
|
2024-06-22 20:30:23 -06:00
|
|
|
mod system_dirs;
|
|
|
|
mod util;
|
|
|
|
|
|
|
|
#[derive(Serialize, Deserialize)]
|
2024-10-23 22:24:50 -06:00
|
|
|
struct ModpackEntry {
|
2024-06-22 20:30:23 -06:00
|
|
|
name: String,
|
2024-10-23 22:24:50 -06:00
|
|
|
id: String,
|
2024-06-22 20:30:23 -06:00
|
|
|
}
|
2024-06-22 17:52:25 -06:00
|
|
|
|
2024-06-22 17:17:07 -06:00
|
|
|
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
|
|
|
|
#[tauri::command]
|
|
|
|
fn greet(name: &str) -> String {
|
|
|
|
format!("Hello, {}! You've been greeted from Rust!", name)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2024-07-13 09:37:19 -06:00
|
|
|
//modpack::get_modpacks();
|
2024-06-23 15:07:25 -06:00
|
|
|
//prism::install_prism();
|
2024-06-22 17:17:07 -06:00
|
|
|
tauri::Builder::default()
|
2024-10-23 22:24:50 -06:00
|
|
|
.plugin(tauri_plugin_updater::Builder::new().build())
|
|
|
|
.plugin(tauri_plugin_process::init())
|
|
|
|
.plugin(tauri_plugin_shell::init())
|
|
|
|
.plugin(tauri_plugin_dialog::init())
|
|
|
|
.invoke_handler(tauri::generate_handler![
|
|
|
|
greet,
|
|
|
|
modpack::get_modpacks,
|
|
|
|
modpack::launch_modpack,
|
|
|
|
modpack::get_versions,
|
|
|
|
modpack::get_latest_version,
|
|
|
|
prism::launch_prism,
|
|
|
|
prism::install_prism,
|
|
|
|
admin::login,
|
|
|
|
admin::drop_session,
|
|
|
|
admin::shift_up,
|
|
|
|
admin::shift_down,
|
|
|
|
admin::add_pack,
|
|
|
|
admin::remove_pack,
|
|
|
|
admin::update_pack
|
|
|
|
])
|
2024-06-22 17:17:07 -06:00
|
|
|
.run(tauri::generate_context!())
|
|
|
|
.expect("error while running tauri application");
|
|
|
|
}
|