Skip to content

Commit 2debc5f

Browse files
authored
Merge pull request #90 from fioletoven/feature/add-kind-views
Add Endpoints, NetworkPolicy and ServiceAccount columns
2 parents f13f957 + 722e165 commit 2debc5f

15 files changed

Lines changed: 170 additions & 30 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Change Log
22

3-
## WIP
3+
## 0.3.7 - 2025-12-31
44

55
### Features
66

77
- add footer messages history pane
8+
- add columns for Endpoints, NetworkPolicy and ServiceAccount kinds
89

910
### Bug fixes
1011

Cargo.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ members = [
1010
]
1111

1212
[workspace.package]
13-
version = "0.3.6"
13+
version = "0.3.7"
1414
edition = "2024"
1515
rust-version = "1.88"
1616
license = "MIT"

b4n-config/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ fn default_aliases() -> HashMap<String, String> {
7777
("clusterroles", "cr"),
7878
("daemonsets", "ds,dms"),
7979
("namespaces", "ns"),
80+
("networkpolicies", "np"),
8081
("persistentvolumeclaims", "pvc"),
8182
("persistentvolumes", "pv"),
8283
("pods", "pp"),

b4n-kube/observer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,10 +534,10 @@ impl EventsProcessor {
534534

535535
fn is_access_error(error: &watcher::Error) -> bool {
536536
match error {
537-
watcher::Error::InitialListFailed(kube::Error::Api(response))
538-
| watcher::Error::WatchStartFailed(kube::Error::Api(response))
539-
| watcher::Error::WatchError(response)
540-
| watcher::Error::WatchFailed(kube::Error::Api(response)) => response.code == 403,
537+
Error::InitialListFailed(kube::Error::Api(response))
538+
| Error::WatchStartFailed(kube::Error::Api(response))
539+
| Error::WatchError(response)
540+
| Error::WatchFailed(kube::Error::Api(response)) => response.code == 403,
541541
_ => false,
542542
}
543543
}

b4n-kube/stream_backoff.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use pin_project::pin_project;
55
use std::{marker::PhantomData, pin::Pin, task::Poll};
66
use tokio::time::{Instant, Sleep, sleep};
77

8-
/// Based on https://github.com/kube-rs/kube/blob/2.0.1/kube-runtime/src/utils/stream_backoff.rs
9-
/// If fixes the backoff reset on receiving Poll::Ready(Some(Ok(Event::Init))) which is sent also after errors.
8+
/// Based on <https://github.com/kube-rs/kube/blob/2.0.1/kube-runtime/src/utils/stream_backoff.rs>
9+
/// It fixes the backoff reset on receiving `Poll::Ready(Some(Ok(Event::Init)))` which is sent also after errors.
1010
///
1111
/// Applies a [`Backoff`] policy to a [`Stream`]
1212
///
@@ -58,7 +58,7 @@ where
5858
StreamBackoffStateProj::BackingOff(mut backoff_sleep) => match backoff_sleep.as_mut().poll(cx) {
5959
Poll::Ready(()) => {
6060
tracing::debug!(deadline = ?backoff_sleep.deadline(), "Backoff complete, waking up");
61-
this.state.set(State::Awake)
61+
this.state.set(State::Awake);
6262
},
6363
Poll::Pending => {
6464
let deadline = backoff_sleep.deadline();

b4n-tasks/highlighter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ pub enum HighlightResourceError {
147147

148148
/// Cannot send syntax highlight request to the highlighter thread.
149149
#[error("cannot send syntax highlight request")]
150-
CannotSendRequest(#[from] tokio::sync::mpsc::error::SendError<HighlightRequest>),
150+
CannotSendRequest(#[from] mpsc::error::SendError<HighlightRequest>),
151151

152152
/// Cannot receive syntax highlight request from the highlighter thread.
153153
#[error("cannot receive syntax highlight request")]

b4n-tui/widgets/footer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl Footer {
9090
/// Shows history pane.
9191
pub fn show_message_history(&mut self) {
9292
if self.history_pane.is_none() {
93-
self.history_pane = Some(BottomPane::new(self.get_history_messages().into()))
93+
self.history_pane = Some(BottomPane::new(self.get_history_messages().into()));
9494
}
9595
}
9696

@@ -122,7 +122,7 @@ impl Footer {
122122
pub fn draw_history(&mut self, frame: &mut Frame<'_>, area: Rect, theme: &Theme) {
123123
if let Some(pane) = &mut self.history_pane {
124124
pane.draw(frame, area, theme);
125-
};
125+
}
126126
}
127127

128128
fn draw_footer(&mut self, frame: &mut Frame<'_>, area: Rect, theme: &Theme) {

b4n-tui/widgets/history/bottom_pane.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub struct BottomPane {
2020
}
2121

2222
impl BottomPane {
23-
/// Creates new [`MessagesList`] instance.
23+
/// Creates new [`BottomPane`] instance.
2424
pub fn new(messages: MessagesList) -> Self {
2525
Self {
2626
history: List::new(messages),

b4n-tui/widgets/history/message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl MessageItem {
1717
/// Creates new [`MessageItem`] instance from the [`Notification`] and it's time.
1818
pub fn from(notification: &Notification, time: Instant, id: usize) -> Self {
1919
Self {
20-
uid: format!("_{}_", id),
20+
uid: format!("_{id}_"),
2121
group: "notification",
2222
message: notification.text.clone(),
2323
time,

0 commit comments

Comments
 (0)