feat: 新增 MJPEG/H.264 VNC 初步支持

This commit is contained in:
mofeng-git
2026-06-15 22:23:27 +08:00
parent 5c98aea7e3
commit c101ef1c80
34 changed files with 2270 additions and 354 deletions

View File

@@ -171,6 +171,7 @@ export const extensionsApi = {
export interface RustDeskConfigResponse {
enabled: boolean
codec: 'h264' | 'h265'
rendezvous_server: string
relay_server: string | null
device_id: string
@@ -187,6 +188,7 @@ export interface RustDeskStatusResponse {
export interface RustDeskConfigUpdate {
enabled?: boolean
codec?: 'h264' | 'h265'
rendezvous_server?: string
relay_server?: string
relay_key?: string
@@ -271,6 +273,50 @@ export const rtspConfigApi = {
stop: () => request<RtspStatusResponse>('/config/rtsp/stop', { method: 'POST' }),
}
export type VncEncoding = 'tight_jpeg' | 'h264'
export interface VncConfigResponse {
enabled: boolean
bind: string
port: number
encoding: VncEncoding
jpeg_quality: number
allow_one_client: boolean
has_password: boolean
}
export interface VncConfigUpdate {
enabled?: boolean
bind?: string
port?: number
encoding?: VncEncoding
jpeg_quality?: number
allow_one_client?: boolean
password?: string
}
export interface VncStatusResponse {
config: VncConfigResponse
service_status: string
connection_count: number
}
export const vncConfigApi = {
get: () => request<VncConfigResponse>('/config/vnc'),
update: (config: VncConfigUpdate) =>
request<VncConfigResponse>('/config/vnc', {
method: 'PATCH',
body: JSON.stringify(config),
}),
getStatus: () => request<VncStatusResponse>('/config/vnc/status'),
start: () => request<VncStatusResponse>('/config/vnc/start', { method: 'POST' }),
stop: () => request<VncStatusResponse>('/config/vnc/stop', { method: 'POST' }),
}
export type WebConfig = WebConfigResponse
export type { WebConfigUpdate }

View File

@@ -67,6 +67,7 @@ export interface PlatformCapabilities {
otg: FeatureCapability
audio: FeatureCapability
rustdesk: FeatureCapability
vnc: FeatureCapability
diagnostics: FeatureCapability
extensions: FeatureCapability
service_installation: FeatureCapability
@@ -86,6 +87,7 @@ export const systemApi = {
atx: { available: boolean; backend?: string; reason?: string }
audio: { available: boolean; backend?: string; reason?: string }
rustdesk: { available: boolean; backend?: string; reason?: string }
vnc: { available: boolean; backend?: string; reason?: string }
}
disk_space?: {
total: number
@@ -206,6 +208,7 @@ export interface StreamConstraintsResponse {
sources: {
rustdesk: boolean
rtsp: boolean
vnc: boolean
}
reason: string
current_mode: string
@@ -719,6 +722,7 @@ export {
redfishConfigApi,
rustdeskConfigApi,
rtspConfigApi,
vncConfigApi,
webConfigApi,
type RustDeskConfigResponse,
type RustDeskStatusResponse,
@@ -729,6 +733,10 @@ export {
type RedfishConfigUpdate,
type RtspConfigUpdate,
type RtspStatusResponse,
type VncConfigResponse,
type VncConfigUpdate,
type VncEncoding,
type VncStatusResponse,
type WebConfig,
type WebConfigUpdate,
} from './config'