Compare commits
No commits in common. "cc54502a124acf72e9c19bf9f168d246f8e14ba5" and "88138341ae63492561e0c062090e9449d117d10c" have entirely different histories.
cc54502a12
...
88138341ae
5 changed files with 6 additions and 6 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -2668,7 +2668,7 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uptime-kuma-dashboard"
|
name = "uptime-kuma-dashboard"
|
||||||
version = "0.38.2"
|
version = "0.38.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "uptime-kuma-dashboard"
|
name = "uptime-kuma-dashboard"
|
||||||
version = "0.38.2"
|
version = "0.38.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@ impl App {
|
||||||
}
|
}
|
||||||
|
|
||||||
let max_scroll = state
|
let max_scroll = state
|
||||||
.get_total_length()
|
.get_total_lenght()
|
||||||
.saturating_sub(area[0].height as usize)
|
.saturating_sub(area[0].height as usize)
|
||||||
.saturating_add(1);
|
.saturating_add(1);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ static STATUS_LINE_CACHE: OnceLock<RwLock<HashMap<u64, Line<'static>>>> = OnceLo
|
||||||
|
|
||||||
pub fn render_monitor_list(main_frame: &mut Frame, area: Rect, state: &mut DashboardViewState) {
|
pub fn render_monitor_list(main_frame: &mut Frame, area: Rect, state: &mut DashboardViewState) {
|
||||||
let available_height = area.height as usize;
|
let available_height = area.height as usize;
|
||||||
let max_scroll = state.get_total_length().saturating_sub(available_height);
|
let max_scroll = state.get_total_lenght().saturating_sub(available_height);
|
||||||
|
|
||||||
if state.scroll_state.get_position() > max_scroll {
|
if state.scroll_state.get_position() > max_scroll {
|
||||||
state.scroll_state = state.scroll_state.position(max_scroll);
|
state.scroll_state = state.scroll_state.position(max_scroll);
|
||||||
|
|
@ -48,7 +48,7 @@ pub fn render_monitor_list(main_frame: &mut Frame, area: Rect, state: &mut Dashb
|
||||||
let mut current_y = area.y as usize;
|
let mut current_y = area.y as usize;
|
||||||
let mut rendered_height = 0;
|
let mut rendered_height = 0;
|
||||||
let mut lines_skipped = 0;
|
let mut lines_skipped = 0;
|
||||||
let half = state.get_total_length().saturating_div(2);
|
let half = state.get_total_lenght().saturating_div(2);
|
||||||
|
|
||||||
for group in state.groups.iter() {
|
for group in state.groups.iter() {
|
||||||
let group_height = group.monitors.len() + BORDER_LINES_VIEW;
|
let group_height = group.monitors.len() + BORDER_LINES_VIEW;
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ impl DashboardViewState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_total_length(&self) -> usize {
|
pub fn get_total_lenght(&self) -> usize {
|
||||||
self.total_length
|
self.total_length
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue