diff --git a/src/legacy/disks.rs b/src/legacy/disks.rs index 236123c..70eed3c 100644 --- a/src/legacy/disks.rs +++ b/src/legacy/disks.rs @@ -81,25 +81,25 @@ fn linux_disks(lib_path: &str) -> Vec> { return Vec::new(); } }; - let disks: Vec<&str> = output.lines().collect(); - let filtered_disks: Vec<&str> = disks.into_iter().filter(|&disk| !disk.contains("loop")).collect(); - let keys_raw = filtered_disks[0].to_lowercase() - .replace("name", "DeviceID") - .replace("model", "Name") - .replace("size", "Size"); - let keys: Vec<&str> = keys_raw.split_whitespace().collect(); - let mut disk_info = Vec::new(); - for line in &filtered_disks[1..] { - let values: Vec<&str> = line.split_whitespace().collect(); - let mut disk_map = HashMap::new(); - for (key, value) in keys.iter().zip(values.iter()) { - disk_map.insert(key.to_string(), value.to_string()); + // Skip the header line + let disks_skipped: Vec<&str> = output.lines().skip(1).collect(); + let filtered_disks: Vec<&str> = disks_skipped.into_iter().filter(|&disk| !disk.contains("loop")).collect(); + let mut disk_list = Vec::new(); + for disk in filtered_disks { + // Split the disk info by whitespace and collect each part + let parts: Vec<&str> = disk.split_whitespace().collect(); + // Ensure the disk info has at least 4 parts (NAME, SIZE, TYPE, MODEL) + if parts.len() >= 4 { + let disk_info = HashMap::from([ + ("Name".to_string(), parts[0].to_string()), + ("Size".to_string(), parse_size(parts[1])), + ("Type".to_string(), parts[2].to_string()), + ("Model".to_string(), parts[3..].join(" ")), + ]); + disk_list.push(disk_info); } - disk_map.insert("Size".to_string(), parse_size(disk_map.get("Size").unwrap())); - disk_map.remove("type"); - disk_info.push(disk_map); } - disk_info + disk_list } /// Function to get disk information on macOS. diff --git a/src/templates/error.rs b/src/templates/error.rs index 5182641..fe1d08a 100644 --- a/src/templates/error.rs +++ b/src/templates/error.rs @@ -51,9 +51,10 @@ pub fn get_content() -> String { footer { width: 100%; + color: #fff; text-align: center; - align-content: center - font-size: 10px; + align-content: center; + font-size: 14px; font-style: italic; } diff --git a/src/templates/index.rs b/src/templates/index.rs index 40608d6..1ce9fc1 100644 --- a/src/templates/index.rs +++ b/src/templates/index.rs @@ -96,9 +96,10 @@ pub fn get_content() -> String { footer { width: 100%; + color: #fff; text-align: center; - align-content: center - font-size: 10px; + align-content: center; + font-size: 14px; font-style: italic; } diff --git a/src/templates/logout.rs b/src/templates/logout.rs index bb5bc6b..b448f86 100644 --- a/src/templates/logout.rs +++ b/src/templates/logout.rs @@ -49,9 +49,10 @@ pub fn get_content() -> String { footer { width: 100%; + color: #fff; text-align: center; - align-content: center - font-size: 10px; + align-content: center; + font-size: 14px; font-style: italic; } diff --git a/src/templates/monitor.rs b/src/templates/monitor.rs index 7b7f931..1623bd7 100644 --- a/src/templates/monitor.rs +++ b/src/templates/monitor.rs @@ -162,8 +162,8 @@ pub fn get_content() -> String { footer { width: 100%; text-align: center; - align-content: center - font-size: 10px; + align-content: center; + font-size: 14px; font-style: italic; } @@ -222,7 +222,7 @@ pub fn get_content() -> String { {% if sys_info_disks %}
- Partitions + Disk Information {% for disk_info in sys_info_disks %}
{% for key, value in disk_info|items() %} diff --git a/src/templates/session.rs b/src/templates/session.rs index 5adfec3..5646d75 100644 --- a/src/templates/session.rs +++ b/src/templates/session.rs @@ -52,9 +52,10 @@ pub fn get_content() -> String { footer { width: 100%; + color: #fff; text-align: center; - align-content: center - font-size: 10px; + align-content: center; + font-size: 14px; font-style: italic; } diff --git a/src/templates/unauthorized.rs b/src/templates/unauthorized.rs index 222896c..605d3b2 100644 --- a/src/templates/unauthorized.rs +++ b/src/templates/unauthorized.rs @@ -45,9 +45,10 @@ pub fn get_content() -> String { footer { width: 100%; + color: #fff; text-align: center; - align-content: center - font-size: 10px; + align-content: center; + font-size: 14px; font-style: italic; }