feat: 添加闪屏

This commit is contained in:
2024-12-10 14:52:32 +08:00
parent a279a262b7
commit 31c23efa6c
9 changed files with 60 additions and 9 deletions

View File

@@ -1,9 +1,17 @@
use crate::{
app_error::AppError,
pe_parse::{header::ImageDosHeader, pe::PE},
services::{self, file::{get_nt_headers_data, ResponseDOSHeaderData, ResponseFileHeaderData, ResponseNTHeaderData}, GLOBAL_FILE_DATA},
services::{
self,
file::{
get_nt_headers_data, ResponseDOSHeaderData, ResponseFileHeaderData,
ResponseNTHeaderData,
},
GLOBAL_FILE_DATA,
},
};
use serde::Serialize;
use tauri::{async_runtime::Mutex, AppHandle, Manager, State};
#[derive(Serialize)]
pub struct PeNodeTreeData {
@@ -11,6 +19,15 @@ pub struct PeNodeTreeData {
key: String,
children: Vec<PeNodeTreeData>,
}
// set_complete
#[tauri::command]
pub fn set_complete(app: AppHandle) -> Result<(), AppError> {
let splash_window = app.get_webview_window("splashscreen").unwrap();
let main_window = app.get_webview_window("main").unwrap();
splash_window.close().unwrap();
main_window.show().unwrap();
Ok(())
}
// TODO: 获取PE节点树的JSON数据
#[tauri::command]
@@ -103,4 +120,4 @@ pub fn command_get_pe_data_nt_header() -> Result<ResponseNTHeaderData, AppError>
pub fn command_get_pe_data_file_header() -> Result<ResponseFileHeaderData, AppError> {
let result = services::file::get_file_header_data()?;
Ok(result)
}
}

View File

@@ -15,6 +15,7 @@ pub fn run() {
commands::command_get_pe_data_dos_header,
commands::command_get_pe_data_nt_header,
commands::command_get_pe_data_file_header,
commands::set_complete
])
.run(tauri::generate_context!())
.expect("error while running tauri application");

View File

@@ -12,9 +12,15 @@
"app": {
"windows": [
{
"title": "test-tauri",
"width": 800,
"height": 600
"label": "main",
"title": "My CFF",
"width": 1000,
"height": 800,
"visible": false
},
{
"label": "splashscreen",
"url": "/splashscreen"
}
],
"security": {