mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 17:15:38 +08:00
20 lines
572 B
Rust
20 lines
572 B
Rust
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
|
|
}
|
|
}
|
|
}
|