Skip to content

Commit

Permalink
'show overview': display node and cluster tags
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Jan 6, 2025
1 parent fb186ec commit 78a6933
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
9 changes: 4 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ reqwest = { version = "0.12.12", features = [
"__rustls",
"rustls-tls-native-roots"
]}
rabbitmq_http_client = { version = "0.15.0", features = [
rabbitmq_http_client = { git = "https://github.com/michaelklishin/rabbitmq-http-api-rs.git", features = [
"core",
"blocking",
"tabled"
Expand Down
10 changes: 9 additions & 1 deletion src/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use rabbitmq_http_client::responses::{
ClusterAlarmCheckDetails, HealthCheckFailureDetails, NodeMemoryBreakdown, Overview,
QuorumCriticalityCheckDetails,
};
use rabbitmq_http_client::formatting::*;
use reqwest::StatusCode;
use tabled::settings::Panel;
use tabled::{Table, Tabled};
Expand Down Expand Up @@ -66,8 +67,15 @@ pub fn overview(ov: Overview) -> Table {
key: "Erlang details",
value: ov.erlang_full_version,
},
OverviewRow {
key: "Cluster tags",
value: display_tag_map_option(&ov.cluster_tags),
},
OverviewRow {
key: "Node tags",
value: display_tag_map_option(&ov.node_tags),
}
];
// TODO: if any tags are non-empty, add them to the table
let tb = Table::builder(data);
let mut t = tb.build();
t.with(Panel::header("Overview"));
Expand Down

0 comments on commit 78a6933

Please sign in to comment.