Refactor: Rename NanoKVM to BatchuKVM and update server URL

This commit is contained in:
2025-12-09 20:35:38 +09:00
commit 8cf674c9e5
396 changed files with 54380 additions and 0 deletions

138
server/proto/vm.go Normal file
View File

@@ -0,0 +1,138 @@
package proto
type IP struct {
Name string `json:"name"`
Addr string `json:"addr"`
Version string `json:"version"`
Type string `json:"type"`
}
type GetInfoRsp struct {
IPs []IP `json:"ips"`
Mdns string `json:"mdns"`
Image string `json:"image"`
Application string `json:"application"`
DeviceKey string `json:"deviceKey"`
}
type GetHardwareRsp struct {
Version string `json:"version"`
}
type SetGpioReq struct {
Type string `validate:"required"` // reset / power
Duration uint `validate:"omitempty"` // press time (unit: milliseconds)
}
type GetGpioRsp struct {
PWR bool `json:"pwr"` // power led
HDD bool `json:"hdd"` // hdd led
}
type SetScreenReq struct {
Type string `validate:"required"` // resolution / fps / quality
Value int `validate:"number"` // value
}
type GetScriptsRsp struct {
Files []string `json:"files"`
}
type UploadScriptRsp struct {
File string `json:"file"`
}
type RunScriptReq struct {
Name string `validate:"required"`
Type string `validate:"required"` // foreground | background
}
type RunScriptRsp struct {
Log string `json:"log"`
}
type DeleteScriptReq struct {
Name string `validate:"required"`
}
type GetVirtualDeviceRsp struct {
Network bool `json:"network"`
Disk bool `json:"disk"`
}
type UpdateVirtualDeviceReq struct {
Device string `validate:"required"`
}
type UpdateVirtualDeviceRsp struct {
On bool `json:"on"`
}
type SetMemoryLimitReq struct {
Enabled bool `validate:"omitempty"`
Limit int64 `validate:"omitempty"`
}
type GetMemoryLimitRsp struct {
Enabled bool `json:"enabled"`
Limit int64 `json:"limit"`
}
type SetOledReq struct {
Sleep int `validate:"omitempty"`
}
type GetOLEDRsp struct {
Exist bool `json:"exist"`
Sleep int `json:"sleep"`
}
type GetGetHdmiStateRsp struct {
Enabled bool `json:"enabled"`
}
type GetSSHStateRsp struct {
Enabled bool `json:"enabled"`
}
type GetSwapRsp struct {
Size int64 `json:"size"` // unit: MB
}
type SetSwapReq struct {
Size int64 `validate:"omitempty"` // unit: MB
}
type GetMouseJigglerRsp struct {
Enabled bool `json:"enabled"`
Mode string `json:"mode"`
}
type SetMouseJigglerReq struct {
Enabled bool `validate:"omitempty"`
Mode string `validate:"omitempty"`
}
type GetMdnsStateRsp struct {
Enabled bool `json:"enabled"`
}
type SetHostnameReq struct {
Hostname string `validate:"required"`
}
type GetHostnameRsp struct {
Hostname string `json:"hostname"`
}
type SetWebTitleReq struct {
Title string `validate:"omitempty"`
}
type GetWebTitleRsp struct {
Title string `json:"title"`
}
type SetTlsReq struct {
Enabled bool `validate:"omitempty"`
}