Reorganazing files
This commit is contained in:
parent
4ff103454e
commit
7270249ef6
10 changed files with 8 additions and 7 deletions
|
|
@ -1,2 +1,4 @@
|
||||||
pub mod unified;
|
pub mod unified;
|
||||||
pub use unified::unify_data;
|
pub use unified::model::unify_data;
|
||||||
|
pub mod heartbeat;
|
||||||
|
pub mod status_page;
|
||||||
|
|
|
||||||
1
src/data/unified/mod.rs
Normal file
1
src/data/unified/mod.rs
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
pub mod model;
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::heartbeat::model::{HeartbeatResponse, UptimeData};
|
use crate::data::heartbeat::model::{HeartbeatResponse, UptimeData};
|
||||||
use crate::status_page::model::{MonitorInfo, StatusPageResponse};
|
use crate::data::status_page::model::{MonitorInfo, StatusPageResponse};
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct UnifiedMonitorData {
|
pub struct UnifiedMonitorData {
|
||||||
|
|
@ -7,8 +7,6 @@ use i18n::init_locales;
|
||||||
|
|
||||||
use crate::data::unify_data;
|
use crate::data::unify_data;
|
||||||
mod data;
|
mod data;
|
||||||
mod heartbeat;
|
|
||||||
mod status_page;
|
|
||||||
|
|
||||||
#[derive(Debug, Parser)]
|
#[derive(Debug, Parser)]
|
||||||
#[command(author, version, about)]
|
#[command(author, version, about)]
|
||||||
|
|
@ -36,7 +34,7 @@ fn main() -> Result<()> {
|
||||||
|
|
||||||
let heartbeat_data = if heartbeat_response.status().is_success() {
|
let heartbeat_data = if heartbeat_response.status().is_success() {
|
||||||
let json_text = heartbeat_response.text()?;
|
let json_text = heartbeat_response.text()?;
|
||||||
heartbeat::parse_response(&json_text)?
|
data::heartbeat::parse_response(&json_text)?
|
||||||
} else {
|
} else {
|
||||||
return Err(anyhow::anyhow!(heartbeat_response.status()));
|
return Err(anyhow::anyhow!(heartbeat_response.status()));
|
||||||
};
|
};
|
||||||
|
|
@ -46,7 +44,7 @@ fn main() -> Result<()> {
|
||||||
let status_page_response = client.get(status_page_url).send()?;
|
let status_page_response = client.get(status_page_url).send()?;
|
||||||
let status_page_data = if status_page_response.status().is_success() {
|
let status_page_data = if status_page_response.status().is_success() {
|
||||||
let json_text = status_page_response.text()?;
|
let json_text = status_page_response.text()?;
|
||||||
status_page::parse_response(&json_text)?
|
data::status_page::parse_response(&json_text)?
|
||||||
} else {
|
} else {
|
||||||
return Err(anyhow::anyhow!(status_page_response.status()));
|
return Err(anyhow::anyhow!(status_page_response.status()));
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue