feat: add export diagnostic info functionality (#2856)

This commit is contained in:
Tunglies
2025-03-03 05:58:12 +08:00
committed by GitHub
parent 277390e597
commit aff504bddc
10 changed files with 87 additions and 2 deletions

View File

@@ -0,0 +1 @@
pub mod sysinfo;

View File

@@ -0,0 +1,19 @@
use crate::model::sysinfo::PlatformSpecification;
use sysinfo::System;
impl PlatformSpecification {
pub fn new() -> Self {
let system_name = System::name().unwrap_or("Null".into());
let system_version = System::long_os_version().unwrap_or("Null".into());
let system_kernel_version = System::kernel_version().unwrap_or("Null".into());
let system_arch = std::env::consts::ARCH.to_string();
Self {
system_name,
system_version,
system_kernel_version,
system_arch
}
}
}