Files
oott/backend/src/web_server/dhcp_scanner.rs
T
rzuastiandClaude Opus 4.8 8749ff33c1 Consolidate backend scanner status, paging, and query-param duplication
Add ActiveStatusCell/PassiveStatusCell wrappers in the scanners common
module so the five per-scanner status.rs files reduce to a single static;
replace parse_parameter_bool/int/string with one generic parse_parameter
over FromStr; extract the shared LIMIT/OFFSET paging clause into
db::apply_paging; and drop a no-op for-loop in the ARP sender.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 09:03:00 -04:00

18 lines
598 B
Rust

use axum::{Json, http::StatusCode};
use crate::web_server::scanner_status::{PassiveScannerStatusResponse, passive_response};
#[utoipa::path(
get,
path = "/api/dhcp_scanner/status",
tag = "dhcp_scanner",
responses(
(status = 200, description = "DHCP scanner status", body = PassiveScannerStatusResponse),
(status = 500, description = "Internal server error"),
),
security(("bearer_auth" = []))
)]
pub async fn status() -> Result<Json<PassiveScannerStatusResponse>, StatusCode> {
passive_response(crate::scanners::dhcp::status::STATUS.get()).map(Json)
}