Sorted applications list on dashboard

refactoring/split-modules
German Lashevich 6 years ago
parent 69acf2dc44
commit 0c1fd7087c
No known key found for this signature in database
GPG Key ID: 3446FAE369C9A8B4

@ -132,6 +132,9 @@ impl Cli {
println!("I won't tell anyone about this 🤫");
std::process::exit(0);
}).expect("Error setting Ctrl-C handler");
// Prepare sorted keys for displaying apps in order
let mut keys: Vec<String> = apps.keys().map(|key| key.clone()).collect();
keys.sort();
loop {
if is_first_iteration {
is_first_iteration = false;
@ -139,7 +142,8 @@ impl Cli {
print!("\x1B[{}A", lines_count);
}
Self::print_progress_bar();
for (_, app) in apps {
for key in keys.iter() {
let app = &apps[key];
println!{"{:06} {}", app.get_code(), app.get_name()};
}
thread::sleep(Duration::from_millis(100));

Loading…
Cancel
Save