Skip to content

Commit 5bb8d0d

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 2d2cafa commit 5bb8d0d

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

src/ui.rs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,28 +61,35 @@ fn render_dashboard(f: &mut Frame, app: &App, area: ratatui::layout::Rect) {
6161
let root_status_span = if device.is_root {
6262
Span::styled("Native Root (UID 0)", Style::default().fg(Color::Green).add_modifier(Modifier::BOLD))
6363
} else if device.can_su {
64+
// Kondisi ini secara teknis hanya akan terlihat sesaat sebelum elevasi
6465
Span::styled(format!("Granted (Type: {})", device.root_type), Style::default().fg(Color::LightGreen))
6566
} else {
67+
// Kondisi ini seharusnya tidak pernah tercapai karena aplikasi akan exit
6668
Span::styled("Non-Root", Style::default().fg(Color::Red))
6769
};
6870

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-
};
71+
// --- PERUBAHAN DI SINI ---
72+
// Hapus kondisional, karena mode instalasi sekarang selalu Chroot.
73+
let mode_span = Span::styled("Chroot (Full Access)", Style::default().fg(Color::Cyan));
7474

7575
let info_text = vec![
7676
Line::from(vec![Span::raw("Device Architecture : "), Span::styled(&device.arch, Style::default().fg(Color::Magenta))]),
7777
Line::from(vec![Span::raw("Android Version : "), Span::styled(&device.android_ver, Style::default().fg(Color::Blue))]),
7878
Line::from(vec![Span::raw("Root Access : "), root_status_span]),
7979
Line::from(vec![Span::raw("Install Mode : "), mode_span]),
80+
];
81+
82+
// Gabungkan info_text dengan welcome text yang sudah ada
83+
let final_text = vec![
84+
info_text[0].clone(),
85+
info_text[1].clone(),
86+
info_text[2].clone(),
87+
info_text[3].clone(),
8088
Line::from(""),
81-
Line::from("Welcome to AutoLinux."),
82-
Line::from("Press 'i' to browse available Ubuntu versions."),
89+
Line::from("Welcome to AutoLinux. Select an installed distro or press 'i' to install a new one."),
8390
];
8491

85-
let info_block = Paragraph::new(info_text)
92+
let info_block = Paragraph::new(final_text)
8693
.block(Block::default().title(" System Info ").borders(Borders::ALL));
8794
f.render_widget(info_block, chunks[0]);
8895

0 commit comments

Comments
 (0)