chore: Update to Bollard v0.19.1
This commit is contained in:
@@ -342,6 +342,54 @@ impl From<(&str, &ContainerStatus)> for State {
|
||||
}
|
||||
}
|
||||
|
||||
/// Need status, to check if container is unhealthy or not
|
||||
impl
|
||||
From<(
|
||||
&bollard::secret::ContainerSummaryStateEnum,
|
||||
&ContainerStatus,
|
||||
)> for State
|
||||
{
|
||||
fn from(
|
||||
(input, status): (
|
||||
&bollard::secret::ContainerSummaryStateEnum,
|
||||
&ContainerStatus,
|
||||
),
|
||||
) -> Self {
|
||||
match input {
|
||||
bollard::secret::ContainerSummaryStateEnum::DEAD => Self::Dead,
|
||||
bollard::secret::ContainerSummaryStateEnum::EXITED => Self::Exited,
|
||||
bollard::secret::ContainerSummaryStateEnum::PAUSED => Self::Paused,
|
||||
bollard::secret::ContainerSummaryStateEnum::REMOVING => Self::Removing,
|
||||
bollard::secret::ContainerSummaryStateEnum::RESTARTING => Self::Restarting,
|
||||
bollard::secret::ContainerSummaryStateEnum::RUNNING => {
|
||||
if status.unhealthy() {
|
||||
Self::Running(RunningState::Unhealthy)
|
||||
} else {
|
||||
Self::Running(RunningState::Healthy)
|
||||
}
|
||||
}
|
||||
_ => Self::Unknown,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Again, need status, to check if container is unhealthy or not
|
||||
impl
|
||||
From<(
|
||||
Option<&bollard::secret::ContainerSummaryStateEnum>,
|
||||
&ContainerStatus,
|
||||
)> for State
|
||||
{
|
||||
fn from(
|
||||
(input, status): (
|
||||
Option<&bollard::secret::ContainerSummaryStateEnum>,
|
||||
&ContainerStatus,
|
||||
),
|
||||
) -> Self {
|
||||
input.map_or(Self::Unknown, |input| Self::from((input, status)))
|
||||
}
|
||||
}
|
||||
|
||||
/// Again, need status, to check if container is unhealthy or not
|
||||
impl From<(Option<String>, &ContainerStatus)> for State {
|
||||
fn from((input, status): (Option<String>, &ContainerStatus)) -> Self {
|
||||
@@ -589,7 +637,6 @@ impl Logs {
|
||||
/// Get the logs vec, but instead of cloning to whole vec, only clone items with x of the currently selected index
|
||||
/// Where x is the abs different of the index plus the panel height & a padding
|
||||
/// The rest can be just empty list items
|
||||
/// TODO test me, pass in 1000 lines of "something", expect response to be different!
|
||||
pub fn to_vec(&self, height: usize, padding: usize) -> Vec<ListItem<'static>> {
|
||||
let current_index = self.logs.state.selected().unwrap_or_default();
|
||||
self.logs
|
||||
|
||||
+6
-1
@@ -882,7 +882,12 @@ impl AppData {
|
||||
.map_or(String::new(), std::clone::Clone::clone),
|
||||
);
|
||||
|
||||
let state = State::from((i.state.as_ref().map_or("dead", |z| z), &status));
|
||||
let state = State::from((
|
||||
i.state
|
||||
.as_ref()
|
||||
.map_or(&bollard::secret::ContainerSummaryStateEnum::DEAD, |z| z),
|
||||
&status,
|
||||
));
|
||||
let image = i
|
||||
.image
|
||||
.as_ref()
|
||||
|
||||
Reference in New Issue
Block a user