Files
work-secretfile-selfcheck/src/main.rs
xiaji 7e256c426f feat(ui): 安全软件风格主题 + 三阶段进度/日志 + XLSX 支持
- 主面板:阶段1扫描全盘 → 阶段2抽样 → 阶段3抽检,每阶段独立进度条/已用时/分类型 chips

- 日志:按类型着色(命中红/未命中绿/警告黄/阶段青)

- 主题:暗绿底 + 鲜绿/青色强调,圆角胶囊按钮(material::security_dark)

- 抽检:SampleMode 枚举支持按份数/百分比/全部;设置页 C 组动态切换

- 抽检:XLSX 检查器(zip + quick-xml 解析 sharedStrings 与 sheet)

- 扫描:walker 进度回调(已访问、命中候选、当前目录)

- 兼容:quick-xml 0.36 使用 reader.config_mut().trim_text()

- 仓库:新增 .gitignore 忽略 venv/pyc/target/构建产物
2026-06-10 12:20:25 +08:00

45 lines
1.1 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.
// 隐藏控制台双保险build.rs 也有 /SUBSYSTEM:WINDOWS
#![windows_subsystem = "windows"]
mod app;
mod config;
mod inspect;
mod matcher;
mod privilege;
mod report;
mod scan;
mod ui;
mod utils;
use crate::app::App;
use crate::privilege::ensure_admin;
use crate::utils::logger::init_logger;
fn main() -> anyhow::Result<()> {
// 单次 UAC 提升:未以管理员运行时通过 runas 重启当前进程
if let Err(e) = ensure_admin() {
// 提示但不强制退出(用户可能在调试)
tracing::warn!("UAC 提升失败:{}", e);
}
init_logger();
let viewport = eframe::egui::ViewportBuilder::default()
.with_title("涉密文件自检工具")
.with_inner_size([1280.0, 800.0])
.with_min_inner_size([960.0, 640.0]);
let options = eframe::NativeOptions {
viewport,
vsync: true,
..Default::default()
};
eframe::run_native(
"涉密文件自检工具",
options,
Box::new(|cc| Box::new(App::new(cc))),
)
.map_err(|e| anyhow::anyhow!("eframe 启动失败:{}", e))
}