Compare commits

...

2 Commits

Author SHA1 Message Date
Adrian c5961acbb5 removed trailing characters 2025-01-28 19:57:21 -06:00
Adrian abd95ab161 added VirtualMediaEnabled config 2025-01-25 22:18:50 -06:00
2 changed files with 17 additions and 15 deletions

View File

@ -20,27 +20,29 @@ type UsbConfig struct {
} }
type Config struct { type Config struct {
CloudURL string `json:"cloud_url"` CloudURL string `json:"cloud_url"`
CloudToken string `json:"cloud_token"` CloudToken string `json:"cloud_token"`
GoogleIdentity string `json:"google_identity"` GoogleIdentity string `json:"google_identity"`
JigglerEnabled bool `json:"jiggler_enabled"` JigglerEnabled bool `json:"jiggler_enabled"`
AutoUpdateEnabled bool `json:"auto_update_enabled"` AutoUpdateEnabled bool `json:"auto_update_enabled"`
IncludePreRelease bool `json:"include_pre_release"` IncludePreRelease bool `json:"include_pre_release"`
HashedPassword string `json:"hashed_password"` HashedPassword string `json:"hashed_password"`
LocalAuthToken string `json:"local_auth_token"` LocalAuthToken string `json:"local_auth_token"`
LocalAuthMode string `json:"localAuthMode"` //TODO: fix it with migration LocalAuthMode string `json:"localAuthMode"` //TODO: fix it with migration
WakeOnLanDevices []WakeOnLanDevice `json:"wake_on_lan_devices"` WakeOnLanDevices []WakeOnLanDevice `json:"wake_on_lan_devices"`
UsbConfig UsbConfig `json:"usb_config"` UsbConfig UsbConfig `json:"usb_config"`
VirtualMediaEnabled bool `json:"virtual_media_enabled"`
} }
const configPath = "/userdata/kvm_config.json" const configPath = "/userdata/kvm_config.json"
var defaultConfig = &Config{ var defaultConfig = &Config{
CloudURL: "https://api.jetkvm.com", CloudURL: "https://api.jetkvm.com",
AutoUpdateEnabled: true, // Set a default value AutoUpdateEnabled: true, // Set a default value
VirtualMediaEnabled: true,
UsbConfig: UsbConfig{ UsbConfig: UsbConfig{
VendorId: "0x1d6b", //The Linux Foundation VendorId: "0x1d6b", //The Linux Foundation
ProductId: "0x0104", //Multifunction Composite Gadget¬ ProductId: "0x0104", //Multifunction Composite Gadget
SerialNumber: "", SerialNumber: "",
Manufacturer: "JetKVM", Manufacturer: "JetKVM",
Product: "JetKVM USB Emulation Device", Product: "JetKVM USB Emulation Device",

View File

@ -39,7 +39,7 @@ export function Dialog({ setOpen }: { setOpen: (open: boolean) => void }) {
const handleUsbConfigChange = useCallback((usbConfig: object) => { const handleUsbConfigChange = useCallback((usbConfig: object) => {
send("setUsbConfig", { usbConfig }, resp => { send("setUsbConfig", { usbConfig }, resp => {
if ("error" in resp) { if ("error" in resp) {
setError(`Failed to update USB Config: ${resp.error.data || "Unknown error"}`,); setError(`Failed to update USB Config: ${resp.error.data || "Unknown error"}`);
return; return;
} }
setModalView("updateUsbConfigSuccess"); setModalView("updateUsbConfigSuccess");