docs: screenshot

This commit is contained in:
Jack Wills
2022-07-22 23:56:30 +00:00
parent b620f9c001
commit 3b69cc29fa
6 changed files with 8 additions and 41 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 KiB

After

Width:  |  Height:  |  Size: 426 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 KiB

+2 -2
View File
@@ -15,8 +15,8 @@
</p> </p>
<p align="center"> <p align="center">
<a href="https://raw.githubusercontent.com/mrjackwills/oxker/main/.github/screenshot_02.jpg" target='_blank' rel='noopener noreferrer'> <a href="https://raw.githubusercontent.com/mrjackwills/oxker/main/.github/screenshot_01.jpg" target='_blank' rel='noopener noreferrer'>
<img src='./.github/screenshot_02.jpg' width='100%'/> <img src='./.github/screenshot_01.jpg' width='100%'/>
</a> </a>
</p> </p>
-23
View File
@@ -123,26 +123,6 @@ impl DockerData {
} }
} }
// pub fn sort_containers(i: &mut [ContainerSummary], so: SortedOrder, header: Header) -> &[ContainerSummary] {
// match header {
// Header::State => {
// match so {
// SortedOrder::Asc => i.sort_by(|a,b|b.state.cmp(&a.state)),
// SortedOrder::Desc => i.sort_by(|a,b|a.state.cmp(&b.state)),
// }
// },
// Header::Image => {
// match so {
// SortedOrder::Asc => i.sort_by(|a,b|b.image.cmp(&a.image)),
// SortedOrder::Desc => i.sort_by(|a,b|a.image.cmp(&b.image)),
// }
// },
// _ => ()
// }
// i
// }
/// Get all current containers, handle into ContainerItem in the app_data struct rather than here /// Get all current containers, handle into ContainerItem in the app_data struct rather than here
/// Just make sure that items sent are guaranteed to have an id /// Just make sure that items sent are guaranteed to have an id
/// return Vec<(is_running, id)> /// return Vec<(is_running, id)>
@@ -163,9 +143,6 @@ impl DockerData {
.filter(|i| i.id.is_some()) .filter(|i| i.id.is_some())
.for_each(|c| output.push(c.to_owned())); .for_each(|c| output.push(c.to_owned()));
// containers.so
// let a = Self::sort_containers(&mut output, SortedOrder::Asc, Header::State);
self.app_data.lock().update_containers(&output); self.app_data.lock().update_containers(&output);
let current_sort = self.app_data.lock().get_sorted(); let current_sort = self.app_data.lock().get_sorted();
+4 -14
View File
@@ -123,7 +123,7 @@ impl InputHandler {
_ => locked_data.set_sorted(Some((header, SortedOrder::Asc))), _ => locked_data.set_sorted(Some((header, SortedOrder::Asc))),
} }
} else { } else {
locked_data.set_sorted(Some((header, SortedOrder::Asc))) locked_data.set_sorted(Some((header, SortedOrder::Desc)))
} }
} }
@@ -252,25 +252,15 @@ impl InputHandler {
MouseEventKind::ScrollUp => self.previous(), MouseEventKind::ScrollUp => self.previous(),
MouseEventKind::ScrollDown => self.next(), MouseEventKind::ScrollDown => self.next(),
MouseEventKind::Down(MouseButton::Left) => { MouseEventKind::Down(MouseButton::Left) => {
let header_int = self.gui_state.lock().header_intersect(Rect::new( let header_intersects = self.gui_state.lock().header_intersect(Rect::new(
mouse_event.column, mouse_event.column,
mouse_event.row, mouse_event.row,
1, 1,
1, 1,
)); ));
// Don't like this if let Some(header) = header_intersects {
let order = if let Some((_, or)) = self.app_data.lock().get_sorted() { self.sort(header);
match or {
SortedOrder::Asc => SortedOrder::Desc,
SortedOrder::Desc => SortedOrder::Asc,
}
} else {
SortedOrder::Asc
};
if let Some(header) = header_int {
self.app_data.lock().set_sorted(Some((header, order)))
} }
self.gui_state.lock().panel_intersect(Rect::new( self.gui_state.lock().panel_intersect(Rect::new(
+2 -2
View File
@@ -407,8 +407,8 @@ pub fn draw_heading_bar<B: Backend>(
if let Some((a, b)) = sorted_by.as_ref() { if let Some((a, b)) = sorted_by.as_ref() {
if x == a { if x == a {
match b { match b {
SortedOrder::Asc => suffix = " ", SortedOrder::Asc => suffix = " ",
SortedOrder::Desc => suffix = " ", SortedOrder::Desc => suffix = " ",
} }
suffix_margin = 2; suffix_margin = 2;
color = Color::White color = Color::White