mirror of https://github.com/jetkvm/kvm.git
				
				
				
			Compare commits
	
		
			2 Commits
		
	
	
		
			58c5875aa7
			...
			c5961acbb5
		
	
	| Author | SHA1 | Date | 
|---|---|---|
| 
							
							
								 | 
						c5961acbb5 | |
| 
							
							
								 | 
						abd95ab161 | 
							
								
								
									
										30
									
								
								config.go
								
								
								
								
							
							
						
						
									
										30
									
								
								config.go
								
								
								
								
							| 
						 | 
					@ -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",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue