This commit is contained in:
lda
2025-11-21 00:38:37 +07:00 Unverified
parent 1dc598b262
commit aab791eb5d
2 changed files with 24 additions and 1 deletions
+6 -1
View File
@@ -2,4 +2,9 @@
target = "armv7-unknown-linux-musleabihf"
[target.armv7-unknown-linux-musleabihf]
linker = "rust-lld"
linker = "rust-lld"
[alias]
ldabr = "b -r --target=target.armv7-unknown-linux-musleabihf"
t = "test -- --nocapture --test-threads=1"
tdebug = "test -- --nocapture --test-threads=1 --show-output"
+18
View File
@@ -5,7 +5,10 @@ pub mod error;
pub mod status;
pub mod wake;
use std::collections::HashMap;
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,8 +17,14 @@ 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::http::Error;
use axum::http::header::ToStrError;
use axum::response::IntoResponse;
use axum::routing::post;
use axum::{Router, http::header, response::Html, routing::get};
use futures::FutureExt;
use futures::TryFutureExt;
use crate::utils::route::serve_js;
@@ -57,4 +66,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(),
}
}),
)
}