上传逻辑添加时间上传, label拦截mac地址, 添加下载延时5s, 下载结束后清除label

This commit is contained in:
JIe
2025-03-15 16:41:30 +08:00
parent eff2d8a7af
commit c5d17ba613
3 changed files with 45 additions and 10 deletions

View File

@@ -20,6 +20,7 @@ use std::any::Any;
use std::fs;
use std::io::Write;
use std::sync::{Arc, LazyLock, Mutex};
use std::thread::sleep;
pub fn main() -> iced::Result {
iced::application("WisunDownload V0.1", MainWindow::update, MainWindow::view)
@@ -208,6 +209,7 @@ impl MainWindow {
}else{
self.result_background = Color::from_rgb8(255, 0,0);
}
self.label = "".to_string();
Task::none()
}
Message::WindowEvent(event) => {
@@ -297,7 +299,13 @@ impl MainWindow {
add_log("请输入Label".to_string());
return;
}
if label.contains(":"){
add_log("Label不合法".to_string());
self.label = "".to_string();
return;
}
std::thread::spawn(move || {
sleep(std::time::Duration::from_secs(5));
let mut download_wrapper = download_wrapper::DownloadWrapper::new();
let mut mes_service: MesService;
sender.send(Message::ClearLog).unwrap();