mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-07-29 17:31:45 +08:00
feat: 新增 MJPEG/H.264 VNC 初步支持
This commit is contained in:
@@ -32,6 +32,7 @@ pub struct AppConfig {
|
||||
pub web: WebConfig,
|
||||
pub extensions: ExtensionsConfig,
|
||||
pub rustdesk: RustDeskConfig,
|
||||
pub vnc: VncConfig,
|
||||
pub rtsp: RtspConfig,
|
||||
pub redfish: RedfishConfig,
|
||||
}
|
||||
|
||||
@@ -23,6 +23,44 @@ pub enum RtspCodec {
|
||||
H265,
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[derive(Default)]
|
||||
pub enum VncEncoding {
|
||||
#[default]
|
||||
TightJpeg,
|
||||
H264,
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(default)]
|
||||
pub struct VncConfig {
|
||||
pub enabled: bool,
|
||||
pub bind: String,
|
||||
pub port: u16,
|
||||
pub encoding: VncEncoding,
|
||||
pub jpeg_quality: u8,
|
||||
pub allow_one_client: bool,
|
||||
#[typeshare(skip)]
|
||||
pub password: Option<String>,
|
||||
}
|
||||
|
||||
impl Default for VncConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
enabled: false,
|
||||
bind: "0.0.0.0".to_string(),
|
||||
port: 5900,
|
||||
encoding: VncEncoding::TightJpeg,
|
||||
jpeg_quality: 80,
|
||||
allow_one_client: true,
|
||||
password: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(default)]
|
||||
|
||||
Reference in New Issue
Block a user