added colours, select and delete ops, refac
Some checks failed
/ Quality Check (push) Failing after 1m41s
/ Build (push) Successful in 1m36s

This commit is contained in:
Phani Pavan K
2025-10-19 13:06:50 +05:30
parent d4d2c5e3eb
commit d713cc8fa3
6 changed files with 218 additions and 50 deletions

View File

@@ -63,6 +63,13 @@ fn runApp<B: Backend>(app: &mut AppState, terminal: &mut Terminal<B>) -> Result<
}
_ => {}
},
CurrentScreen::Delete => match key.code {
KeyCode::Up => app.nextRow(),
KeyCode::Down => app.prevRow(),
KeyCode::Enter => app.delCur(),
KeyCode::Esc => app.screen = CurrentScreen::Main,
_ => {}
},
CurrentScreen::Main => match key.code {
KeyCode::Char('a') => {
app.screen = CurrentScreen::Add;
@@ -72,6 +79,9 @@ fn runApp<B: Backend>(app: &mut AppState, terminal: &mut Terminal<B>) -> Result<
app.screen = CurrentScreen::Exit
}
KeyCode::Char('s') | KeyCode::F(2) => app.screen = CurrentScreen::Settings,
KeyCode::Char('d') => app.screen = CurrentScreen::Delete,
KeyCode::Up => app.nextRow(),
KeyCode::Down => app.prevRow(),
_ => {}
},
CurrentScreen::Add => match (key.modifiers, key.code) {
@@ -134,6 +144,12 @@ fn runApp<B: Backend>(app: &mut AppState, terminal: &mut Terminal<B>) -> Result<
opField.push_str("127.0.0.1");
}
}
'o' => {
if isIP {
opField.clear();
opField.push_str("0.0.0.0");
}
}
'c' => opField.clear(),
'C' => {
app.fromIP.clear();