mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-28 16:41:52 +08:00
feat: 完善架构优化性能
- 调整音视频架构,提升 RKMPP 编码 MJPEG-->H264 性能,同时解决丢帧马赛克问题; - 删除多用户逻辑,只保留单用户,支持设置 web 单会话; - 修复删除体验不好的的回退逻辑,前端页面菜单位置微调; - 增加 OTG USB 设备动态调整功能; - 修复 mdns 问题,webrtc 视频切换更顺畅。
This commit is contained in:
33
src/web/handlers/config/auth.rs
Normal file
33
src/web/handlers/config/auth.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
use axum::{extract::State, Json};
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::config::AuthConfig;
|
||||
use crate::error::Result;
|
||||
use crate::state::AppState;
|
||||
|
||||
use super::types::AuthConfigUpdate;
|
||||
|
||||
/// Get auth configuration (sensitive fields are cleared)
|
||||
pub async fn get_auth_config(State(state): State<Arc<AppState>>) -> Json<AuthConfig> {
|
||||
let mut auth = state.config.get().auth.clone();
|
||||
auth.totp_secret = None;
|
||||
Json(auth)
|
||||
}
|
||||
|
||||
/// Update auth configuration
|
||||
pub async fn update_auth_config(
|
||||
State(state): State<Arc<AppState>>,
|
||||
Json(update): Json<AuthConfigUpdate>,
|
||||
) -> Result<Json<AuthConfig>> {
|
||||
update.validate()?;
|
||||
state
|
||||
.config
|
||||
.update(|config| {
|
||||
update.apply_to(&mut config.auth);
|
||||
})
|
||||
.await?;
|
||||
|
||||
let mut auth = state.config.get().auth.clone();
|
||||
auth.totp_secret = None;
|
||||
Ok(Json(auth))
|
||||
}
|
||||
Reference in New Issue
Block a user