added autostart for windows and autostart for devices
This commit is contained in:
+13
-7
@@ -209,7 +209,7 @@ func cmdRun(mode string) {
|
||||
}()
|
||||
go sm.Run()
|
||||
} else {
|
||||
um := client.NewUseManager(c)
|
||||
um := client.NewUseManager(c, cfg, cfgPath)
|
||||
webHandler.GetDevices = func() interface{} {
|
||||
available := um.GetAvailableDevices()
|
||||
attached := um.GetAttachedDevices()
|
||||
@@ -231,11 +231,15 @@ func cmdRun(mode string) {
|
||||
var attachList []map[string]interface{}
|
||||
for _, d := range attached {
|
||||
attachList = append(attachList, map[string]interface{}{
|
||||
"bus_id": d.BusID,
|
||||
"client_id": d.ClientID,
|
||||
"client_name": d.ClientName,
|
||||
"tunnel_id": d.TunnelID,
|
||||
"vhci_port": d.VHCIPort,
|
||||
"bus_id": d.BusID,
|
||||
"vendor_id": d.VendorID,
|
||||
"product_id": d.ProductID,
|
||||
"name": d.Name,
|
||||
"client_id": d.ClientID,
|
||||
"client_name": d.ClientName,
|
||||
"tunnel_id": d.TunnelID,
|
||||
"vhci_port": d.VHCIPort,
|
||||
"auto_connect": um.IsAutoConnect(d.VendorID, d.ProductID),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -247,6 +251,8 @@ func cmdRun(mode string) {
|
||||
}
|
||||
webHandler.AttachDevice = um.AttachDevice
|
||||
webHandler.DetachDevice = um.DetachDevice
|
||||
webHandler.SetAutoConnect = um.SetAutoConnect
|
||||
webHandler.IsAutoConnect = um.IsAutoConnect
|
||||
webHandler.GetStatus = func() map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
"connected": true,
|
||||
@@ -278,7 +284,7 @@ func cmdRun(mode string) {
|
||||
sm := client.NewShareManager(c)
|
||||
go sm.Run()
|
||||
} else {
|
||||
client.NewUseManager(c)
|
||||
client.NewUseManager(c, cfg, cfgPath)
|
||||
}
|
||||
go func() {
|
||||
if err := c.Run(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user