Removing unused code
This commit is contained in:
parent
bb57f3264e
commit
6af471ecca
3 changed files with 1 additions and 33 deletions
|
|
@ -47,10 +47,6 @@ pub struct StatusPageGroup {
|
||||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||||
pub struct StatusPageResponse {
|
pub struct StatusPageResponse {
|
||||||
pub config: StatusPageConfig,
|
pub config: StatusPageConfig,
|
||||||
#[serde(skip, default)]
|
|
||||||
pub incident: Option<String>,
|
|
||||||
#[serde(rename = "publicGroupList")]
|
#[serde(rename = "publicGroupList")]
|
||||||
pub public_group_list: Vec<StatusPageGroup>,
|
pub public_group_list: Vec<StatusPageGroup>,
|
||||||
#[serde(rename = "maintenanceList", skip)]
|
|
||||||
pub maintenance_list: Vec<String>,
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ fn layout_groups(area: Rect, groups: &[GroupViewState]) -> Vec<Rect> {
|
||||||
let mut areas = Vec::new();
|
let mut areas = Vec::new();
|
||||||
|
|
||||||
for group in groups {
|
for group in groups {
|
||||||
let group_lines = group.monitors.len() + 1;
|
let group_lines = group.monitors.len() + 2;
|
||||||
let group_height = (group_lines + line_height).max(1);
|
let group_height = (group_lines + line_height).max(1);
|
||||||
areas.push(Rect {
|
areas.push(Rect {
|
||||||
x: area.x,
|
x: area.x,
|
||||||
|
|
@ -53,32 +53,6 @@ fn layout_groups(area: Rect, groups: &[GroupViewState]) -> Vec<Rect> {
|
||||||
areas
|
areas
|
||||||
}
|
}
|
||||||
|
|
||||||
//fn layout_groups(area: Rect, group_count: usize) -> Vec<Rect> {
|
|
||||||
// if group_count == 0 {
|
|
||||||
// return vec![];
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// let height_per_group = (area.height as usize / group_count).max(3);
|
|
||||||
// let mut current_y = area.y;
|
|
||||||
// let mut areas = Vec::new();
|
|
||||||
//
|
|
||||||
// for _ in 0..group_count {
|
|
||||||
// if current_y + height_per_group as u16 > area.y + area.height {
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// areas.push(Rect {
|
|
||||||
// x: area.x,
|
|
||||||
// y: current_y,
|
|
||||||
// width: area.width,
|
|
||||||
// height: height_per_group as u16,
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// current_y += height_per_group as u16;
|
|
||||||
// }
|
|
||||||
// areas
|
|
||||||
//}
|
|
||||||
|
|
||||||
fn render_group(frame: &mut Frame, area: Rect, group: &GroupViewState, is_first: bool) {
|
fn render_group(frame: &mut Frame, area: Rect, group: &GroupViewState, is_first: bool) {
|
||||||
let chunks = Layout::default()
|
let chunks = Layout::default()
|
||||||
.direction(Direction::Vertical)
|
.direction(Direction::Vertical)
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ pub enum MonitorStatus {
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct MonitorViewState {
|
pub struct MonitorViewState {
|
||||||
pub id: u64,
|
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub status: MonitorStatus,
|
pub status: MonitorStatus,
|
||||||
pub response_time: String,
|
pub response_time: String,
|
||||||
|
|
@ -117,7 +116,6 @@ fn add_monitor_view_state(group: UnifiedGroupData) -> Vec<MonitorViewState> {
|
||||||
.unwrap_or_else(|| t("unknown").to_string());
|
.unwrap_or_else(|| t("unknown").to_string());
|
||||||
|
|
||||||
monitors.push(MonitorViewState {
|
monitors.push(MonitorViewState {
|
||||||
id: monitor.monitor_info.id,
|
|
||||||
name: monitor.monitor_info.name,
|
name: monitor.monitor_info.name,
|
||||||
status,
|
status,
|
||||||
response_time,
|
response_time,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue