@@ -22,8 +22,8 @@ use std::{io, io::stdout, time::Duration};
2222
2323use dprs:: shared:: config:: Config ;
2424use dprs:: shared:: display:: log_tabs:: { render_log_tabs, LogTabs } ;
25- use dprs:: shared:: docker:: docker_log_watcher:: DockerLogManager ;
2625use dprs:: shared:: display:: log_view:: { render_log_view, LogLevel , LogView } ;
26+ use dprs:: shared:: docker:: docker_log_watcher:: DockerLogManager ;
2727
2828fn main ( ) -> Result < ( ) , io:: Error > {
2929 // Load configuration
@@ -37,7 +37,7 @@ fn main() -> Result<(), io::Error> {
3737
3838 let mut log_manager = DockerLogManager :: new ( ) ;
3939 log_manager. start_watching_all_containers ( ) ?;
40-
40+
4141 // Ensure cleanup happens even if there's a panic
4242 let result = std:: panic:: catch_unwind ( std:: panic:: AssertUnwindSafe ( || {
4343 run_app ( & mut terminal, & mut log_manager, & config)
@@ -72,7 +72,7 @@ fn run_app<B: Backend>(
7272
7373 // Create log views for each container (one per container)
7474 let mut log_views: Vec < LogView > = Vec :: new ( ) ;
75-
75+
7676 // Create tabs for container selection
7777 let container_names: Vec < String > = ( 0 ..log_manager. watcher_count ( ) )
7878 . filter_map ( |i| {
@@ -120,17 +120,17 @@ fn run_app<B: Backend>(
120120 // Update logs for current container if needed
121121 let current_log_view = & mut log_views[ active_tab] ;
122122 let current_logs = watcher. get_logs ( ) ;
123-
123+
124124 // Only update if we have a different number of logs
125125 if current_log_view. get_log_count ( ) != current_logs. len ( ) {
126126 // Preserve scroll position
127127 let scroll_pos = current_log_view. get_scroll_position ( ) ;
128128 * current_log_view = LogView :: new ( 1000 ) ;
129-
129+
130130 for log_line in current_logs {
131131 current_log_view. add_log ( log_line, LogLevel :: Info ) ;
132132 }
133-
133+
134134 // Restore scroll position if it's still valid
135135 if scroll_pos < current_log_view. get_log_count ( ) {
136136 current_log_view. set_scroll_position ( scroll_pos) ;
@@ -196,42 +196,42 @@ fn run_app<B: Backend>(
196196 log_views[ active_tab] . scroll_up ( ) ;
197197 }
198198 }
199- } ,
199+ }
200200 KeyCode :: Down => {
201201 if let Some ( active_tab) = log_tabs. index . checked_sub ( 0 ) {
202202 if active_tab < log_views. len ( ) {
203203 log_views[ active_tab] . scroll_down ( ) ;
204204 }
205205 }
206- } ,
206+ }
207207 KeyCode :: Home => {
208208 if let Some ( active_tab) = log_tabs. index . checked_sub ( 0 ) {
209209 if active_tab < log_views. len ( ) {
210210 log_views[ active_tab] . scroll_to_top ( ) ;
211211 }
212212 }
213- } ,
213+ }
214214 KeyCode :: End => {
215215 if let Some ( active_tab) = log_tabs. index . checked_sub ( 0 ) {
216216 if active_tab < log_views. len ( ) {
217217 log_views[ active_tab] . scroll_to_bottom ( ) ;
218218 }
219219 }
220- } ,
220+ }
221221 KeyCode :: PageUp => {
222222 if let Some ( active_tab) = log_tabs. index . checked_sub ( 0 ) {
223223 if active_tab < log_views. len ( ) {
224224 log_views[ active_tab] . page_up ( visible_height) ;
225225 }
226226 }
227- } ,
227+ }
228228 KeyCode :: PageDown => {
229229 if let Some ( active_tab) = log_tabs. index . checked_sub ( 0 ) {
230230 if active_tab < log_views. len ( ) {
231231 log_views[ active_tab] . page_down ( visible_height) ;
232232 }
233233 }
234- } ,
234+ }
235235 KeyCode :: Char ( 'r' ) => {
236236 log_manager. refresh ( ) ?;
237237 // Update tabs with new container names
@@ -243,7 +243,7 @@ fn run_app<B: Backend>(
243243 } )
244244 . collect ( ) ;
245245 log_tabs = LogTabs :: new ( container_names. clone ( ) ) ;
246-
246+
247247 // Recreate log views for the new containers
248248 log_views. clear ( ) ;
249249 for _ in 0 ..container_names. len ( ) {
0 commit comments