Compare commits
3
Commits
v0.1.5
...
84ac271bbb
No files matched your search
@@ -3,3 +3,8 @@ target = "armv7-unknown-linux-musleabihf"
|
|||||||
|
|
||||||
[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"
|
||||||
@@ -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.
|
||||||
Generated
+1
-1
@@ -1179,7 +1179,7 @@ checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wakey"
|
name = "wakey"
|
||||||
version = "0.1.5"
|
version = "0.1.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum",
|
"axum",
|
||||||
"axum-extra",
|
"axum-extra",
|
||||||
|
|||||||
+9
-3
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wakey"
|
name = "wakey"
|
||||||
version = "0.1.5"
|
version = "0.1.6"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
publish = ["gitea"]
|
publish = ["gitea"]
|
||||||
|
|
||||||
@@ -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
|
||||||
@@ -6,6 +6,7 @@ pub mod status;
|
|||||||
pub mod wake;
|
pub mod wake;
|
||||||
|
|
||||||
use crate::assets;
|
use crate::assets;
|
||||||
|
use crate::dhcpparse::load_mac_name_cache;
|
||||||
use crate::route::api::ip;
|
use crate::route::api::ip;
|
||||||
use crate::route::api::status_redirect;
|
use crate::route::api::status_redirect;
|
||||||
use crate::route::api::status_smart_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::status::get_status_json;
|
||||||
use crate::route::wake::wake_multi;
|
use crate::route::wake::wake_multi;
|
||||||
|
|
||||||
|
use axum::Json;
|
||||||
|
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};
|
||||||
|
|
||||||
@@ -57,4 +60,13 @@ pub fn api_router() -> Router {
|
|||||||
.route("/devs", get(devs_router))
|
.route("/devs", get(devs_router))
|
||||||
.route("/wake", post(wake_multi))
|
.route("/wake", post(wake_multi))
|
||||||
.route("/ips/{name}", get(ip))
|
.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>,
|
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,
|
||||||
|
|||||||
Reference in new issue
Block a user