[Fix] UI patches
This commit is contained in:
parent
925fd4d1b4
commit
9d89fd310a
6 changed files with 867 additions and 228 deletions
|
|
@ -6,6 +6,7 @@ use ratatui::{
|
|||
};
|
||||
|
||||
use crate::gui::app_state::AppState;
|
||||
|
||||
pub fn draw(frame: &mut Frame, area: Rect, block: Block, password: String, _state: AppState) {
|
||||
frame.render_widget(block, area);
|
||||
|
||||
|
|
@ -14,16 +15,29 @@ pub fn draw(frame: &mut Frame, area: Rect, block: Block, password: String, _stat
|
|||
vertical: 1,
|
||||
});
|
||||
|
||||
let info = vec![
|
||||
"This is the technical end of your Iota",
|
||||
"Press Ctrl+Q to quit",
|
||||
"Press Ctrl+R to reload",
|
||||
"Select a password for the WebUI",
|
||||
];
|
||||
let mut constraints: Vec<Constraint> = Vec::new();
|
||||
|
||||
for _ in 0..info.len() {
|
||||
constraints.push(Constraint::Length(1));
|
||||
}
|
||||
|
||||
constraints.push(Constraint::Length(3));
|
||||
|
||||
let chunks = Layout::default()
|
||||
.direction(Direction::Vertical)
|
||||
.constraints([
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
])
|
||||
.constraints(constraints)
|
||||
.split(padded);
|
||||
|
||||
let prefix = Span::raw(format!("select password : {}", password));
|
||||
for i in 0..info.len() {
|
||||
frame.render_widget(Paragraph::new(info[i]), chunks[i]);
|
||||
}
|
||||
|
||||
frame.render_widget(Paragraph::new(prefix), chunks[0]);
|
||||
let prefix = Span::raw(format!("select password : {}", password));
|
||||
frame.render_widget(Paragraph::new(prefix), chunks[info.len()]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue