Skip to content

Commit

Permalink
Remove reflection from methods selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Reiter committed Sep 28, 2024
1 parent 2663e59 commit 547a9ef
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
10 changes: 1 addition & 9 deletions wireman/src/events/selection/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub enum MethodsSelectionEvents {
Unselect,
ClearSearch,
GoToServices,
Reflection,
}

impl fmt::Display for MethodsSelectionEvents {
Expand All @@ -28,7 +27,6 @@ impl fmt::Display for MethodsSelectionEvents {
MethodsSelectionEvents::Unselect => "Unselect",
MethodsSelectionEvents::ClearSearch => "Clear Search",
MethodsSelectionEvents::GoToServices => "Go to Services",
MethodsSelectionEvents::Reflection => "Switch to Reflection Mode",
};
write!(f, "{display_str}")
}
Expand Down Expand Up @@ -88,19 +86,13 @@ impl EventHandler for MethodsSelectionEventsHandler {
MethodsSelectionEvents::GoToServices => {
ctx.selection_tab = SelectionTab::Services;
}
MethodsSelectionEvents::Reflection => {
ctx.selection.borrow_mut().toggle_reflection_mode();
}
}
}

fn key_event_mappings(ctx: &Self::Context) -> Vec<(KeyEvent, MethodsSelectionEvents)> {
let method_selected = ctx.selection.borrow().selected_method().is_some();
let filter_active = ctx.selection.borrow_mut().methods_filter.is_some();
let mut map = vec![(
KeyEvent::ctrl(KeyCode::Char('r')),
MethodsSelectionEvents::Reflection,
)];
let mut map = vec![];
if method_selected {
map.extend([
(
Expand Down
10 changes: 0 additions & 10 deletions wireman/src/model/core_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,6 @@ impl CoreClient {
Ok(())
}

// pub async fn reflect(host: &str) -> Option<ProtoDescriptor> {
// match ProtoDescriptor::reflect(host).await {
// Ok(desc) => Some(desc),
// Err(err) => {
// Logger::critical(format!("server reflection failed: {err}"));
// None
// }
// }
// }

/// Return the proto Services
pub fn get_services(&self) -> Vec<ServiceDescriptor> {
self.desc.get_services()
Expand Down
2 changes: 1 addition & 1 deletion wireman/src/view/selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl Widget for SelectionPage<'_> {
}

// Show a dialog with address and authentication input fields
// which are required before server reflection
// which are required for server reflection
if self.model.selection_mode == SelectionMode::ReflectionDialog {
let popup_area = centered_rect(80, 80, area);
Clear.render(popup_area, buf);
Expand Down

0 comments on commit 547a9ef

Please sign in to comment.