Skip to content

Commit 83bd355

Browse files
committed
feat(ui): Simplify dashboard to reflect root-only architecture
Update the dashboard UI to align with the new root-only application model. - The conditional logic for displaying "Install Mode" has been removed from `render_dashboard`. - The display is now hardcoded to always show "Chroot (Full Access)", as PRoot is no longer a supported mode. - Minor refactoring of the text layout for better clarity. This change simplifies the UI code and removes potentially confusing information for the user, providing a more accurate system diagnosis.
1 parent f54cf7a commit 83bd355

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

src/ui.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,26 @@ fn render_dashboard(f: &mut Frame, app: &App, area: ratatui::layout::Rect) {
6666
Span::styled("Non-Root", Style::default().fg(Color::Red))
6767
};
6868

69-
let mode_span = if device.is_root || device.can_su {
70-
Span::styled("Chroot (Full Access)", Style::default().fg(Color::Cyan))
71-
} else {
72-
Span::styled("PRoot (User Space)", Style::default().fg(Color::Yellow))
73-
};
69+
let mode_span = Span::styled("Chroot (Full Access)", Style::default().fg(Color::Cyan));
7470

7571
let info_text = vec![
7672
Line::from(vec![Span::raw("Device Architecture : "), Span::styled(&device.arch, Style::default().fg(Color::Magenta))]),
7773
Line::from(vec![Span::raw("Android Version : "), Span::styled(&device.android_ver, Style::default().fg(Color::Blue))]),
7874
Line::from(vec![Span::raw("Root Access : "), root_status_span]),
7975
Line::from(vec![Span::raw("Install Mode : "), mode_span]),
76+
];
77+
78+
let final_text = vec![
79+
info_text[0].clone(),
80+
info_text[1].clone(),
81+
info_text[2].clone(),
82+
info_text[3].clone(),
8083
Line::from(""),
81-
Line::from("Welcome to AutoLinux."),
82-
Line::from("Press 'i' to browse available Ubuntu versions."),
84+
Line::from("Welcome to AutoLinux. Select an installed distro or press 'i' to install a new one."),
8385
];
8486

85-
let info_block = Paragraph::new(info_text)
87+
88+
let info_block = Paragraph::new(final_text)
8689
.block(Block::default().title(" System Info ").borders(Borders::ALL));
8790
f.render_widget(info_block, chunks[0]);
8891

0 commit comments

Comments
 (0)