Squashed commit of the following:
commit84ac271bbbAuthor: lda <[email protected]> Date: Fri Nov 21 00:56:02 2025 +0700 six commit723b232123Author: lda <[email protected]> Date: Fri Nov 21 00:50:24 2025 +0700 expose the files, fmt now i can see what macs my computer is commitaab791eb5dAuthor: lda <[email protected]> Date: Fri Nov 21 00:38:37 2025 +0700 uh what commit1dc598b262Author: lda <[email protected]> Date: Tue Oct 21 01:10:19 2025 +0700 the commit of cherrypickingd7c34ee
This commit is contained in:
1 parent
4f7e7e1fdd
commit
b0d0bbf015
14 files changed
+144
-138
No files matched your search
@@ -6,6 +6,7 @@ pub mod status;
|
||||
pub mod wake;
|
||||
|
||||
use crate::assets;
|
||||
use crate::dhcpparse::load_mac_name_cache;
|
||||
use crate::route::api::ip;
|
||||
use crate::route::api::status_redirect;
|
||||
use crate::route::api::status_smart_redirect;
|
||||
@@ -14,6 +15,8 @@ use crate::route::dhcp::get_dhcp_leases;
|
||||
use crate::route::status::get_status_json;
|
||||
use crate::route::wake::wake_multi;
|
||||
|
||||
use axum::Json;
|
||||
use axum::response::IntoResponse;
|
||||
use axum::routing::post;
|
||||
use axum::{Router, http::header, response::Html, routing::get};
|
||||
|
||||
@@ -57,4 +60,13 @@ pub fn api_router() -> Router {
|
||||
.route("/devs", get(devs_router))
|
||||
.route("/wake", post(wake_multi))
|
||||
.route("/ips/{name}", get(ip))
|
||||
.route(
|
||||
"/mac-cache",
|
||||
get(|| async {
|
||||
match load_mac_name_cache().await {
|
||||
Ok(h) => Json(h).into_response(),
|
||||
Err(e) => e.to_string().into_response(),
|
||||
}
|
||||
}),
|
||||
)
|
||||
}
|
||||
@@ -47,14 +47,6 @@ pub struct Filters {
|
||||
pub macs: Vec<MacAddr>,
|
||||
}
|
||||
|
||||
#[deprecated = "use ApiError"]
|
||||
#[skip_serializing_none]
|
||||
#[derive(Debug, Serialize, Default)]
|
||||
pub struct StatusError {
|
||||
pub name: Option<String>,
|
||||
pub error: String,
|
||||
}
|
||||
|
||||
pub async fn get_status_json(
|
||||
Query(DeviceQuery {
|
||||
name,
|
||||
|
||||
Reference in new issue
Block a user