expose the files, fmt

now i can see what macs my computer is
This commit is contained in:
lda
2025-11-21 00:50:24 +07:00 Unverified
parent aab791eb5d
commit 723b232123
12 changed files with 138 additions and 144 deletions
+2
View File
@@ -1,8 +1,10 @@
you should use block code to refence code, like so: you should use block code to refence code, like so:
```rust ```rust
hello_world!(println); hello_world!(println);
// indented lines // indented lines
``` ```
in the chat. Else it fucks up formatting. in the chat. Else it fucks up formatting.
We work towards clean, maintainable design. im not the best at this thing. We work towards clean, maintainable design. im not the best at this thing.
+8 -2
View File
@@ -16,7 +16,12 @@ serde_json = "1.0.143"
serde_with = { version = "3.14.0", features = ["json"] } serde_with = { version = "3.14.0", features = ["json"] }
strum = { version = "0.27.2", features = ["derive", "strum_macros"] } strum = { version = "0.27.2", features = ["derive", "strum_macros"] }
thiserror = "2.0.16" thiserror = "2.0.16"
tokio = { version = "1.47.1", features = ["fs", "process", "rt-multi-thread", "io-util"] } tokio = { version = "1.47.1", features = [
"fs",
"process",
"rt-multi-thread",
"io-util",
] }
urlencoding = "2.1.3" urlencoding = "2.1.3"
[profile.release] [profile.release]
@@ -25,4 +30,5 @@ strip = true
[features] [features]
default = ["very-smart-parsing"] default = ["very-smart-parsing"]
very-smart-parsing = [] # this is the a-bit-redundant parse thing that copilot made very-smart-parsing = [
] # this is the a-bit-redundant parse thing that copilot made
+1 -7
View File
@@ -5,8 +5,6 @@ pub mod error;
pub mod status; pub mod status;
pub mod wake; pub mod wake;
use std::collections::HashMap;
use crate::assets; use crate::assets;
use crate::dhcpparse::load_mac_name_cache; use crate::dhcpparse::load_mac_name_cache;
use crate::route::api::ip; use crate::route::api::ip;
@@ -18,13 +16,9 @@ use crate::route::status::get_status_json;
use crate::route::wake::wake_multi; use crate::route::wake::wake_multi;
use axum::Json; use axum::Json;
use axum::http::Error;
use axum::http::header::ToStrError;
use axum::response::IntoResponse; use axum::response::IntoResponse;
use axum::routing::post; use axum::routing::post;
use axum::{Router, http::header, response::Html, routing::get}; use axum::{Router, http::header, response::Html, routing::get};
use futures::FutureExt;
use futures::TryFutureExt;
use crate::utils::route::serve_js; use crate::utils::route::serve_js;
@@ -67,7 +61,7 @@ pub fn api_router() -> Router {
.route("/wake", post(wake_multi)) .route("/wake", post(wake_multi))
.route("/ips/{name}", get(ip)) .route("/ips/{name}", get(ip))
.route( .route(
"mac-cache/", "/mac-cache",
get(|| async { get(|| async {
match load_mac_name_cache().await { match load_mac_name_cache().await {
Ok(h) => Json(h).into_response(), Ok(h) => Json(h).into_response(),
-8
View File
@@ -47,14 +47,6 @@ pub struct Filters {
pub macs: Vec<MacAddr>, 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( pub async fn get_status_json(
Query(DeviceQuery { Query(DeviceQuery {
name, name,