Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@

# Logs
*.log
docs/agents/

# Local Claude notes (gitignored per-repo configuration)
CLAUDE.local.md
15 changes: 5 additions & 10 deletions src/commands/endpoint/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use quicknode_sdk::admin::{
};
use serde::Serialize;

use crate::output::{new_table, opt_cell, set_header_bold, write_table, Render};
use crate::output::{bool_cell, new_table, opt_cell, set_header_bold, write_table, Render};

#[derive(Serialize)]
pub struct EndpointsView(pub GetEndpointsResponse);
Expand Down Expand Up @@ -51,11 +51,10 @@ impl Render for EndpointsView {
"LABEL",
"STATUS",
"CHAIN/NETWORK",
"TYPE",
"MULTI",
"MULTICHAIN",
];
if ctx.wide {
headers.extend(["HTTP", "WSS"]);
headers.extend(["HTTP", "WSS", "DEDICATED"]);
}
set_header_bold(&mut t, ctx, headers);
for e in &self.0.data {
Expand All @@ -65,16 +64,12 @@ impl Render for EndpointsView {
opt_cell(&e.label),
Cell::new(&e.status),
Cell::new(format!("{}/{}", e.chain, e.network)),
Cell::new(if e.is_dedicated {
"dedicated"
} else {
"shared"
}),
Cell::new(if e.is_multichain { "yes" } else { "no" }),
bool_cell(Some(e.is_multichain)),
];
if ctx.wide {
row.push(Cell::new(&e.http_url));
row.push(opt_cell(&e.wss_url));
row.push(bool_cell(Some(e.is_dedicated)));
}
t.add_row(row);
}
Expand Down
11 changes: 3 additions & 8 deletions tests/output_snapshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,20 @@ struct EndpointsView(GetEndpointsResponse);
impl Render for EndpointsView {
fn render_table(&self, w: &mut dyn std::io::Write, ctx: &OutputCtx) -> std::io::Result<()> {
use comfy_table::Cell;
use qn::output::{new_table, opt_cell, set_header_bold, write_table};
use qn::output::{bool_cell, new_table, opt_cell, set_header_bold, write_table};
let mut t = new_table(ctx);
set_header_bold(
&mut t,
ctx,
vec!["ID", "LABEL", "STATUS", "CHAIN/NETWORK", "TYPE", "MULTI"],
vec!["ID", "LABEL", "STATUS", "CHAIN/NETWORK", "MULTICHAIN"],
);
for e in &self.0.data {
t.add_row(vec![
Cell::new(&e.id),
opt_cell(&e.label),
Cell::new(&e.status),
Cell::new(format!("{}/{}", e.chain, e.network)),
Cell::new(if e.is_dedicated {
"dedicated"
} else {
"shared"
}),
Cell::new(if e.is_multichain { "yes" } else { "no" }),
bool_cell(Some(e.is_multichain)),
]);
}
write_table(w, &t)?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
source: tests/output_snapshots.rs
expression: out
---
ID LABEL STATUS CHAIN/NETWORK TYPE MULTI
ID LABEL STATUS CHAIN/NETWORK MULTICHAIN
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
source: tests/output_snapshots.rs
expression: out
---
ID LABEL STATUS CHAIN/NETWORK TYPE MULTI
ep-1 production active ethereum/mainnet shared yes
ep-2 — paused solana/mainnet dedicated no
ID LABEL STATUS CHAIN/NETWORK MULTICHAIN
ep-1 production active ethereum/mainnet
ep-2 — paused solana/mainnet
showing 1–2 of 2
Loading