fix: handle hostname_short disabled state properly
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -206,12 +206,46 @@ fn build_meta_plugins_configured_table(settings: &config::Settings) -> Option<Ta
|
||||
.to_string()
|
||||
};
|
||||
|
||||
// Show the merged outputs
|
||||
let outputs_str = if actual_plugin.outputs().is_empty() {
|
||||
"{}".to_string()
|
||||
} else {
|
||||
let mut output_pairs = Vec::new();
|
||||
// Show the merged outputs, but filter based on plugin options
|
||||
// For hostname plugin, check if specific outputs are disabled
|
||||
let mut enabled_output_pairs = Vec::new();
|
||||
for (key, value) in actual_plugin.outputs() {
|
||||
// Check if this output should be enabled based on plugin-specific logic
|
||||
// For hostname plugin, check hostname_short, hostname_full options
|
||||
if plugin_config.name == "hostname" {
|
||||
match key.as_str() {
|
||||
"hostname_short" => {
|
||||
// Check if hostname_short is disabled
|
||||
if let Some(serde_yaml::Value::Bool(enabled)) = all_options.get("hostname_short") {
|
||||
if !enabled {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
"hostname_full" => {
|
||||
// Check if hostname_full is disabled
|
||||
if let Some(serde_yaml::Value::Bool(enabled)) = all_options.get("hostname_full") {
|
||||
if !enabled {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
"hostname" => {
|
||||
// Check if hostname is disabled
|
||||
if let Some(serde_yaml::Value::Bool(enabled)) = all_options.get("hostname") {
|
||||
if !enabled {
|
||||
continue;
|
||||
}
|
||||
} else if let Some(serde_yaml::Value::String(s)) = all_options.get("hostname") {
|
||||
if s == "false" {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
// Convert serde_yaml::Value to a string representation
|
||||
let value_str = match value {
|
||||
serde_yaml::Value::String(s) => s.clone(),
|
||||
@@ -231,16 +265,16 @@ fn build_meta_plugins_configured_table(settings: &config::Settings) -> Option<Ta
|
||||
// Trim any extra whitespace from the serialized values
|
||||
let value_str = value_str.trim().to_string();
|
||||
if key == &value_str {
|
||||
output_pairs.push(key.clone());
|
||||
enabled_output_pairs.push(key.clone());
|
||||
} else {
|
||||
output_pairs.push(format!("{}->{}", key, value_str));
|
||||
enabled_output_pairs.push(format!("{}->{}", key, value_str));
|
||||
}
|
||||
}
|
||||
if output_pairs.is_empty() {
|
||||
|
||||
let outputs_str = if enabled_output_pairs.is_empty() {
|
||||
"{}".to_string()
|
||||
} else {
|
||||
output_pairs.join(", ")
|
||||
}
|
||||
enabled_output_pairs.join(", ")
|
||||
};
|
||||
|
||||
table.add_row(Row::new(vec![
|
||||
|
||||
Reference in New Issue
Block a user