Virtual Printer: TLS proxy with real printer serial

Proxy mode changes:
  - Replace transparent TCP proxy with TLS-terminating proxy
  - Slicer connects to Bambuddy cert, Bambuddy connects to printer
  - Use real printer's serial number for SSDP and certificate
  - This ensures MQTT topic subscriptions match the real printer

  The proxy now:
  1. Accepts TLS from slicer using Bambuddy's certificate
  2. Opens TLS connection to real printer
  3. Forwards decrypted data bidirectionally

  Also: Complete i18n localization for VirtualPrinterSettings component
This commit is contained in:
maziggy
2026-02-02 15:55:55 +01:00
parent ef64687080
commit 38d99143c7
13 changed files with 1514 additions and 570 deletions
+19 -3
View File
@@ -3775,22 +3775,36 @@ export const discoveryApi = {
};
// Virtual Printer types
export type VirtualPrinterMode = 'immediate' | 'queue' | 'review' | 'print_queue' | 'proxy'; // 'queue' is legacy, normalized to 'review'
export interface VirtualPrinterProxyStatus {
running: boolean;
target_host: string;
ftp_port: number;
mqtt_port: number;
ftp_connections: number;
mqtt_connections: number;
}
export interface VirtualPrinterStatus {
enabled: boolean;
running: boolean;
mode: 'immediate' | 'queue' | 'review' | 'print_queue'; // 'queue' is legacy, normalized to 'review'
mode: VirtualPrinterMode;
name: string;
serial: string;
model: string;
model_name: string;
pending_files: number;
target_printer_ip?: string; // For proxy mode
proxy?: VirtualPrinterProxyStatus; // For proxy mode
}
export interface VirtualPrinterSettings {
enabled: boolean;
access_code_set: boolean;
mode: 'immediate' | 'queue' | 'review' | 'print_queue'; // 'queue' is legacy, normalized to 'review'
mode: VirtualPrinterMode;
model: string;
target_printer_id: number | null; // For proxy mode
status: VirtualPrinterStatus;
}
@@ -3820,14 +3834,16 @@ export const virtualPrinterApi = {
updateSettings: (data: {
enabled?: boolean;
access_code?: string;
mode?: 'immediate' | 'review' | 'print_queue';
mode?: 'immediate' | 'review' | 'print_queue' | 'proxy';
model?: string;
target_printer_id?: number;
}) => {
const params = new URLSearchParams();
if (data.enabled !== undefined) params.set('enabled', String(data.enabled));
if (data.access_code !== undefined) params.set('access_code', data.access_code);
if (data.mode !== undefined) params.set('mode', data.mode);
if (data.model !== undefined) params.set('model', data.model);
if (data.target_printer_id !== undefined) params.set('target_printer_id', String(data.target_printer_id));
return request<VirtualPrinterSettings>(`/settings/virtual-printer?${params.toString()}`, {
method: 'PUT',