feat(vnt-web): 新增 /api/version,顶栏版本号不再依赖组网状态

This commit is contained in:
lbl
2026-08-22 01:38:57 +08:00
parent 39a4e60d39
commit 0ccd045e78
6 changed files with 189 additions and 175 deletions
+6
View File
@@ -496,6 +496,7 @@ pub async fn run_http_server(
.allow_headers(Any);
let app = Router::new()
.route("/api/version", get(get_version))
.route("/api/info", get(get_info))
.route("/api/peers", get(get_peers))
.route("/api/routes", get(get_routes))
@@ -1021,6 +1022,11 @@ async fn restart_vnt_handler(
}
}
/// 客户端版本号,与组网状态无关,任何时刻都可获取
async fn get_version() -> Json<ApiResponse<String>> {
Json(ApiResponse::success(env!("CARGO_PKG_VERSION").to_string()))
}
async fn get_info(
State(state): State<HttpAppState>,
Query(req): Query<FileReq>,