Backend - Per-VM CPU affinity (vmstart/affinity.go, affinity_flow.go): modes auto / all / P-cores / non-LP-E / custom, saved in the VM folder, applied to the QEMU process on start (GUI and CLI) and live via SetVMAffinity; copied on clone. Start summary logs the resolved mapping. Host report gains CPU topology helpers (mask <-> CPU list). - Offline qcow2 restore points via qemu-img (driver/reims/snapshot.go, snapshot_flow.go): list / create / restore / delete. - SSH helpers (ssh_flow.go): remembered user, open a terminal, write an ~/.ssh/config entry, open VS Code Remote-SSH. - FocusVMWindow brings the QEMU window forward (restoring it if minimized); CopyVMScreenshot copies a full-resolution frame to the clipboard. - DeliverPathsToGuest copies dropped host files into the shared folder; main.go enables Wails file drop on elements marked --wails-drop-target. - VM note (.reims-go-note) and a storage breakdown (extras_flow.go). Frontend - VM page: running state's "Show Window" and the screen preview use FocusVMWindow; camera button and More-menu item copy a screenshot; editable note under the name; SSH row shows the saved user with Terminal / config / VS Code actions; restore-point list; install guide steps can be ticked off; drop files onto the page to send them. - Sidebar right-click menu per VM (start, show window, screenshot, stop, restart, settings, folders, clone, delete); double-click and Ctrl+Enter still run the main action. - AffinityDialog opened from the VM menu and VM settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
76 lines
1.9 KiB
Go
76 lines
1.9 KiB
Go
package main
|
|
|
|
import (
|
|
"embed"
|
|
"os"
|
|
|
|
"github.com/Nwflower/reims-go/internal/app"
|
|
"github.com/Nwflower/reims-go/internal/cli"
|
|
|
|
"github.com/wailsapp/wails/v2"
|
|
"github.com/wailsapp/wails/v2/pkg/options"
|
|
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
|
|
"github.com/wailsapp/wails/v2/pkg/options/windows"
|
|
)
|
|
|
|
//go:embed all:frontend/dist
|
|
var assets embed.FS
|
|
|
|
//go:embed assets/logo.png
|
|
var trayIconPNG []byte
|
|
|
|
func main() {
|
|
args := os.Args[1:]
|
|
if cli.IsCommand(args) {
|
|
attachConsole()
|
|
os.Exit(cli.Main(args))
|
|
}
|
|
launch, _ := cli.ParseWindowArgs(args)
|
|
|
|
desktopApp, hooks := app.New(trayIconPNG, launch)
|
|
err := wails.Run(&options.App{
|
|
Title: "Reims-Go",
|
|
StartHidden: launch.Background,
|
|
// One window per user. A second launch — double-click, or `reims-go vm
|
|
// start` handing a VM over — goes to the running one instead.
|
|
SingleInstanceLock: &options.SingleInstanceLock{
|
|
UniqueId: cli.InstanceID,
|
|
OnSecondInstanceLaunch: hooks.OnSecondInstanceLaunch,
|
|
},
|
|
Width: 1120,
|
|
Height: 740,
|
|
MinWidth: 920,
|
|
MinHeight: 600,
|
|
Frameless: true,
|
|
DragAndDrop: &options.DragAndDrop{
|
|
EnableFileDrop: true,
|
|
DisableWebViewDrop: true,
|
|
CSSDropProperty: "--wails-drop-target",
|
|
CSSDropValue: "drop",
|
|
},
|
|
AssetServer: &assetserver.Options{
|
|
Assets: assets,
|
|
},
|
|
BackgroundColour: &options.RGBA{R: 28, G: 28, B: 30, A: 255},
|
|
Windows: &windows.Options{
|
|
Theme: windows.Dark,
|
|
WebviewIsTransparent: false,
|
|
WindowIsTranslucent: false,
|
|
CustomTheme: &windows.ThemeSettings{
|
|
DarkModeTitleBar: windows.RGB(28, 28, 30),
|
|
DarkModeTitleText: windows.RGB(245, 245, 247),
|
|
DarkModeBorder: windows.RGB(58, 58, 62),
|
|
},
|
|
},
|
|
OnStartup: hooks.OnStartup,
|
|
OnBeforeClose: hooks.OnBeforeClose,
|
|
OnShutdown: hooks.OnShutdown,
|
|
Bind: []any{
|
|
desktopApp,
|
|
},
|
|
})
|
|
if err != nil {
|
|
println("Error:", err.Error())
|
|
}
|
|
}
|