diff --git a/src/app_data/mod.rs b/src/app_data/mod.rs index 3821f99..cf7887a 100644 --- a/src/app_data/mod.rs +++ b/src/app_data/mod.rs @@ -253,11 +253,20 @@ impl AppData { } /// Get the title for log panel for selected container - /// will be "logs x/x" + /// will be either + /// 1) "logs x/x - container_name" where container_name is 32 chars max + /// 2) "logs - container_name" when no logs found, again 32 chars max pub fn get_log_title(&self) -> String { self.get_selected_log_index() .map_or("".to_owned(), |index| { - self.containers.items[index].logs.get_state_title() + let logs_len = self.containers.items[index].logs.get_state_title(); + let mut name = self.containers.items[index].name.clone(); + name.truncate(32); + if logs_len.is_empty() { + format!("- {} ", name) + } else { + format!("{} - {}", logs_len, name) + } }) }