Skip to content

Commit

Permalink
feat(cdk): use release date in hub list
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoBorai committed Oct 2, 2024
1 parent 17d19a3 commit 95a57ef
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions crates/fluvio-hub-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dirs = { workspace = true }
ed25519-dalek = { version = "2.1", features = ["serde", "rand_core"] }
flate2 = { workspace = true }
hex = { workspace = true }
humantime = { workspace = true }
http = { workspace = true }
mime = { workspace = true }
pem = "3.0"
Expand Down
15 changes: 13 additions & 2 deletions crates/fluvio-hub-util/src/cmd/list.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use std::sync::Arc;
use std::fmt::Debug;

use chrono::DateTime;
use chrono::Utc;
use clap::Parser;
use anyhow::Result;

Expand Down Expand Up @@ -35,6 +37,7 @@ mod output {
//! # Fluvio hub list - output processing
//!
//! Format SmartModules response based on output type
use chrono::{DateTime, Utc};
use comfy_table::{Cell, Row};
use comfy_table::CellAlignment;
use tracing::debug;
Expand All @@ -45,7 +48,8 @@ mod output {
use fluvio_extension_common::Terminal;
use fluvio_extension_common::output::TableOutputHandler;
use fluvio_extension_common::t_println;
use crate::PackageMeta;

use crate::{PackageMeta, PackageMetaExt};

#[derive(Serialize)]
struct ListConnectors(Vec<PackageMeta>);
Expand Down Expand Up @@ -78,7 +82,7 @@ mod output {
impl TableOutputHandler for ListConnectors {
/// table header implementation
fn header(&self) -> Row {
Row::from(["CONNECTOR", "Visibility"])
Row::from(["CONNECTOR", "Visibility", "Released"])
}

/// return errors in string format
Expand All @@ -94,6 +98,13 @@ mod output {
Row::from([
Cell::new(e.pkg_name()).set_alignment(CellAlignment::Left),
Cell::new(&e.visibility).set_alignment(CellAlignment::Left),
Cell::new(
e.published_at()
.map(|date| {
date.format("%Y-%m-%d %H:%M:%S").to_string()
})
.unwrap_or(String::from("N/A")),
),
])
})
.collect()
Expand Down

0 comments on commit 95a57ef

Please sign in to comment.