chore: dependencies updated
This commit is contained in:
Generated
+896
-248
File diff suppressed because it is too large
Load Diff
+3
-5
@@ -16,8 +16,6 @@ categories = ["command-line-utilities"]
|
|||||||
unsafe_code = "forbid"
|
unsafe_code = "forbid"
|
||||||
|
|
||||||
[lints.clippy]
|
[lints.clippy]
|
||||||
nursery = { level = "warn", priority = -1 }
|
|
||||||
pedantic = { level = "warn", priority = -1 }
|
|
||||||
expect_used = "warn"
|
expect_used = "warn"
|
||||||
todo = "warn"
|
todo = "warn"
|
||||||
unused_async = "warn"
|
unused_async = "warn"
|
||||||
@@ -28,7 +26,7 @@ similar_names = "allow"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
bollard = "0.19"
|
bollard = "0.20"
|
||||||
cansi = "2.2"
|
cansi = "2.2"
|
||||||
clap = { version = "4.5", features = ["color", "derive", "unicode"] }
|
clap = { version = "4.5", features = ["color", "derive", "unicode"] }
|
||||||
crossterm = "0.29"
|
crossterm = "0.29"
|
||||||
@@ -36,11 +34,11 @@ directories = "6.0"
|
|||||||
futures-util = "0.3"
|
futures-util = "0.3"
|
||||||
jiff = { version = "0.2", features = ["tzdb-bundle-always"] }
|
jiff = { version = "0.2", features = ["tzdb-bundle-always"] }
|
||||||
parking_lot = { version = "0.12" }
|
parking_lot = { version = "0.12" }
|
||||||
ratatui = "0.29"
|
ratatui = "0.30"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
serde_jsonc = "1.0"
|
serde_jsonc = "1.0"
|
||||||
tokio = { version = "1.48", features = ["full"] }
|
tokio = { version = "1.49", features = ["full"] }
|
||||||
tokio-util = "0.7"
|
tokio-util = "0.7"
|
||||||
toml = { version = "0.9", default-features = false, features = ["parse", "serde"] }
|
toml = { version = "0.9", default-features = false, features = ["parse", "serde"] }
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use std::{
|
|||||||
net::IpAddr,
|
net::IpAddr,
|
||||||
};
|
};
|
||||||
|
|
||||||
use bollard::service::Port;
|
use bollard::secret::{ContainerSummaryHealthStatusEnum, PortSummary};
|
||||||
use jiff::{Timestamp, tz::TimeZone};
|
use jiff::{Timestamp, tz::TimeZone};
|
||||||
use ratatui::{
|
use ratatui::{
|
||||||
layout::Size,
|
layout::Size,
|
||||||
@@ -121,8 +121,8 @@ pub struct ContainerPorts {
|
|||||||
pub public: Option<u16>,
|
pub public: Option<u16>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<Port> for ContainerPorts {
|
impl From<PortSummary> for ContainerPorts {
|
||||||
fn from(value: Port) -> Self {
|
fn from(value: PortSummary) -> Self {
|
||||||
Self {
|
Self {
|
||||||
ip: value.ip.and_then(|i| i.parse::<IpAddr>().ok()),
|
ip: value.ip.and_then(|i| i.parse::<IpAddr>().ok()),
|
||||||
private: value.private_port,
|
private: value.private_port,
|
||||||
@@ -242,6 +242,7 @@ impl From<String> for ContainerStatus {
|
|||||||
|
|
||||||
impl ContainerStatus {
|
impl ContainerStatus {
|
||||||
/// Check if a container is unhealthy
|
/// Check if a container is unhealthy
|
||||||
|
/// TODO should have a healthy Option<X> part now, so no need to parse
|
||||||
pub fn unhealthy(&self) -> bool {
|
pub fn unhealthy(&self) -> bool {
|
||||||
self.contains("(unhealthy)")
|
self.contains("(unhealthy)")
|
||||||
}
|
}
|
||||||
@@ -689,8 +690,8 @@ impl Logs {
|
|||||||
if let Some(new_index) = match sd {
|
if let Some(new_index) = match sd {
|
||||||
ScrollDirection::Next => current_position.checked_add(1),
|
ScrollDirection::Next => current_position.checked_add(1),
|
||||||
ScrollDirection::Previous => current_position.checked_sub(1),
|
ScrollDirection::Previous => current_position.checked_sub(1),
|
||||||
}
|
} && let Some(f) = self.search_results.get(new_index)
|
||||||
&& let Some(f) = self.search_results.get(new_index) {
|
{
|
||||||
self.lines.state.select(Some(*f));
|
self.lines.state.select(Some(*f));
|
||||||
return Some(());
|
return Some(());
|
||||||
}
|
}
|
||||||
@@ -922,7 +923,9 @@ impl Logs {
|
|||||||
pub fn forward(&mut self, width: u16) {
|
pub fn forward(&mut self, width: u16) {
|
||||||
let offset = usize::from(self.offset);
|
let offset = usize::from(self.offset);
|
||||||
if self.horizontal_scroll_able(width)
|
if self.horizontal_scroll_able(width)
|
||||||
&& self.adjusted_max_width > 0 && offset < self.adjusted_max_width {
|
&& self.adjusted_max_width > 0
|
||||||
|
&& offset < self.adjusted_max_width
|
||||||
|
{
|
||||||
self.offset = self.offset.saturating_add(1);
|
self.offset = self.offset.saturating_add(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -968,6 +971,7 @@ pub struct ContainerItem {
|
|||||||
pub cpu_stats: VecDeque<CpuStats>,
|
pub cpu_stats: VecDeque<CpuStats>,
|
||||||
pub created: u64,
|
pub created: u64,
|
||||||
pub docker_controls: StatefulList<DockerCommand>,
|
pub docker_controls: StatefulList<DockerCommand>,
|
||||||
|
pub health: Option<ContainerSummaryHealthStatusEnum>,
|
||||||
pub id: ContainerId,
|
pub id: ContainerId,
|
||||||
pub image: ContainerImage,
|
pub image: ContainerImage,
|
||||||
pub is_oxker: bool,
|
pub is_oxker: bool,
|
||||||
@@ -1017,6 +1021,7 @@ impl ContainerItem {
|
|||||||
cpu_stats: VecDeque::with_capacity(60),
|
cpu_stats: VecDeque::with_capacity(60),
|
||||||
created,
|
created,
|
||||||
docker_controls,
|
docker_controls,
|
||||||
|
health: None,
|
||||||
id,
|
id,
|
||||||
image: image.into(),
|
image: image.into(),
|
||||||
is_oxker,
|
is_oxker,
|
||||||
|
|||||||
@@ -203,6 +203,7 @@ impl DockerData {
|
|||||||
if let std::collections::hash_map::Entry::Vacant(spawns) =
|
if let std::collections::hash_map::Entry::Vacant(spawns) =
|
||||||
self.spawns.lock().entry(spawn_id.clone())
|
self.spawns.lock().entry(spawn_id.clone())
|
||||||
{
|
{
|
||||||
|
// TODO Replace this with toktio tokens
|
||||||
spawns.insert(tokio::spawn(Self::update_container_stat(
|
spawns.insert(tokio::spawn(Self::update_container_stat(
|
||||||
Arc::clone(&self.app_data),
|
Arc::clone(&self.app_data),
|
||||||
Arc::clone(&self.docker),
|
Arc::clone(&self.docker),
|
||||||
@@ -478,6 +479,7 @@ mod tests {
|
|||||||
fn gen_stats() -> ContainerStatsResponse {
|
fn gen_stats() -> ContainerStatsResponse {
|
||||||
ContainerStatsResponse {
|
ContainerStatsResponse {
|
||||||
read: None,
|
read: None,
|
||||||
|
os_type: None,
|
||||||
preread: None,
|
preread: None,
|
||||||
num_procs: Some(1),
|
num_procs: Some(1),
|
||||||
pids_stats: None,
|
pids_stats: None,
|
||||||
|
|||||||
+5
-3
@@ -64,7 +64,8 @@ async fn docker_init(
|
|||||||
});
|
});
|
||||||
|
|
||||||
if let Ok(docker) = connection
|
if let Ok(docker) = connection
|
||||||
&& docker.ping().await.is_ok() {
|
&& docker.ping().await.is_ok()
|
||||||
|
{
|
||||||
tokio::spawn(DockerData::start(
|
tokio::spawn(DockerData::start(
|
||||||
Arc::clone(app_data),
|
Arc::clone(app_data),
|
||||||
docker,
|
docker,
|
||||||
@@ -153,7 +154,7 @@ mod tests {
|
|||||||
|
|
||||||
use std::{str::FromStr, sync::Arc};
|
use std::{str::FromStr, sync::Arc};
|
||||||
|
|
||||||
use bollard::service::{ContainerSummary, Port};
|
use bollard::service::{ContainerSummary, PortSummary};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
app_data::{
|
app_data::{
|
||||||
@@ -232,13 +233,14 @@ mod tests {
|
|||||||
pub fn gen_container_summary(index: usize, state: &str) -> ContainerSummary {
|
pub fn gen_container_summary(index: usize, state: &str) -> ContainerSummary {
|
||||||
ContainerSummary {
|
ContainerSummary {
|
||||||
image_manifest_descriptor: None,
|
image_manifest_descriptor: None,
|
||||||
|
health: None,
|
||||||
id: Some(format!("{index}")),
|
id: Some(format!("{index}")),
|
||||||
names: Some(vec![format!("container_{}", index)]),
|
names: Some(vec![format!("container_{}", index)]),
|
||||||
image: Some(format!("image_{index}")),
|
image: Some(format!("image_{index}")),
|
||||||
image_id: Some(format!("{index}")),
|
image_id: Some(format!("{index}")),
|
||||||
command: None,
|
command: None,
|
||||||
created: Some(i64::try_from(index).unwrap()),
|
created: Some(i64::try_from(index).unwrap()),
|
||||||
ports: Some(vec![Port {
|
ports: Some(vec![PortSummary {
|
||||||
ip: None,
|
ip: None,
|
||||||
private_port: u16::try_from(index).unwrap_or(1) + 8000,
|
private_port: u16::try_from(index).unwrap_or(1) + 8000,
|
||||||
public_port: None,
|
public_port: None,
|
||||||
|
|||||||
Reference in New Issue
Block a user