Wails shell over the existing Go core (app.go, main.go, wails.json, build/), with a React frontend for the VM list, VM detail, host page, create wizard and settings, plus process helpers for the driver and runtime packages. UI redesign stage 0 (docs/ui-redesign.md): - VM actions live in the page header: one primary action per state, icon-only secondary actions with tooltips, the rest in a "..." menu - install guide is a single card with the only "eject installer" button - summary is an icon + value row; paths, ICD, CPU model and runtime hash moved to a collapsed "technical details" section - logs no longer auto-open; a status bar shows merged download progress and an error count; the log view sticks to the bottom - busy states on actions, toasts for results, custom delete dialog with "keep disk files" - design tokens, Windows font stack, integer type scale, no inline styles - keyboard: sidebar listbox navigation, focus rings, Ctrl+N / Ctrl+, / Ctrl+L - copy rewritten per the restraint rules in §4.5 - Radix primitives and lucide icons replace hand-rolled widgets Backend: OpenVMFolder binding to show a VM's directory in Explorer. Docs: shell-design.md revised for decisions D1 and D4. Vite dev server pinned to 127.0.0.1 so `wails dev` can reach it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
454 lines
13 KiB
TypeScript
454 lines
13 KiB
TypeScript
export namespace config {
|
|
|
|
export class Config {
|
|
data_root: string;
|
|
locale: string;
|
|
active_runtime?: string;
|
|
auto_pin_pcores: boolean;
|
|
default_gpu?: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new Config(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.data_root = source["data_root"];
|
|
this.locale = source["locale"];
|
|
this.active_runtime = source["active_runtime"];
|
|
this.auto_pin_pcores = source["auto_pin_pcores"];
|
|
this.default_gpu = source["default_gpu"];
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
export namespace host {
|
|
|
|
export class GPUInfo {
|
|
name: string;
|
|
vulkan_icd: string;
|
|
kind: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new GPUInfo(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.name = source["name"];
|
|
this.vulkan_icd = source["vulkan_icd"];
|
|
this.kind = source["kind"];
|
|
}
|
|
}
|
|
export class Report {
|
|
os: string;
|
|
arch: string;
|
|
logical_cpus: number;
|
|
physical_cores: number;
|
|
has_hybrid_cores: boolean;
|
|
p_core_count: number;
|
|
e_core_count: number;
|
|
p_core_mask: number;
|
|
p_core_mask_hex: string;
|
|
p_core_logical_cpus?: number[];
|
|
e_core_logical_cpus?: number[];
|
|
total_ram_gb: number;
|
|
avail_ram_gb: number;
|
|
data_root: string;
|
|
free_disk_gb: number;
|
|
whpx: string;
|
|
gpus: GPUInfo[];
|
|
recommended_gpu?: GPUInfo;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new Report(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.os = source["os"];
|
|
this.arch = source["arch"];
|
|
this.logical_cpus = source["logical_cpus"];
|
|
this.physical_cores = source["physical_cores"];
|
|
this.has_hybrid_cores = source["has_hybrid_cores"];
|
|
this.p_core_count = source["p_core_count"];
|
|
this.e_core_count = source["e_core_count"];
|
|
this.p_core_mask = source["p_core_mask"];
|
|
this.p_core_mask_hex = source["p_core_mask_hex"];
|
|
this.p_core_logical_cpus = source["p_core_logical_cpus"];
|
|
this.e_core_logical_cpus = source["e_core_logical_cpus"];
|
|
this.total_ram_gb = source["total_ram_gb"];
|
|
this.avail_ram_gb = source["avail_ram_gb"];
|
|
this.data_root = source["data_root"];
|
|
this.free_disk_gb = source["free_disk_gb"];
|
|
this.whpx = source["whpx"];
|
|
this.gpus = this.convertValues(source["gpus"], GPUInfo);
|
|
this.recommended_gpu = this.convertValues(source["recommended_gpu"], GPUInfo);
|
|
}
|
|
|
|
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
|
if (!a) {
|
|
return a;
|
|
}
|
|
if (a.slice && a.map) {
|
|
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
|
} else if ("object" === typeof a) {
|
|
if (asMap) {
|
|
for (const key of Object.keys(a)) {
|
|
a[key] = new classs(a[key]);
|
|
}
|
|
return a;
|
|
}
|
|
return new classs(a);
|
|
}
|
|
return a;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
export namespace main {
|
|
|
|
export class AppState {
|
|
config?: config.Config;
|
|
host: host.Report;
|
|
runtimes: runtime.Installed[];
|
|
active_runtime?: runtime.Installed;
|
|
vms: reims.VMListItem[];
|
|
transitions: Record<string, string>;
|
|
pending_changes: Record<string, Array<PendingChange>>;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new AppState(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.config = this.convertValues(source["config"], config.Config);
|
|
this.host = this.convertValues(source["host"], host.Report);
|
|
this.runtimes = this.convertValues(source["runtimes"], runtime.Installed);
|
|
this.active_runtime = this.convertValues(source["active_runtime"], runtime.Installed);
|
|
this.vms = this.convertValues(source["vms"], reims.VMListItem);
|
|
this.transitions = source["transitions"];
|
|
this.pending_changes = this.convertValues(source["pending_changes"], Array<PendingChange>, true);
|
|
}
|
|
|
|
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
|
if (!a) {
|
|
return a;
|
|
}
|
|
if (a.slice && a.map) {
|
|
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
|
} else if ("object" === typeof a) {
|
|
if (asMap) {
|
|
for (const key of Object.keys(a)) {
|
|
a[key] = new classs(a[key]);
|
|
}
|
|
return a;
|
|
}
|
|
return new classs(a);
|
|
}
|
|
return a;
|
|
}
|
|
}
|
|
export class PendingChange {
|
|
field: string;
|
|
from: string;
|
|
to: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new PendingChange(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.field = source["field"];
|
|
this.from = source["from"];
|
|
this.to = source["to"];
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
export namespace reims {
|
|
|
|
export class CreateOpts {
|
|
name: string;
|
|
dir?: string;
|
|
source_mode?: string;
|
|
macos?: string;
|
|
installer?: string;
|
|
cpus?: number;
|
|
memory?: string;
|
|
disk_size?: string;
|
|
disk?: string;
|
|
disk_mode?: string;
|
|
graphics?: string;
|
|
gpu?: string;
|
|
resolution?: string;
|
|
displays?: number;
|
|
borderless?: boolean;
|
|
audio?: boolean;
|
|
network?: boolean;
|
|
ssh_port?: number;
|
|
logs?: boolean;
|
|
start?: boolean;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new CreateOpts(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.name = source["name"];
|
|
this.dir = source["dir"];
|
|
this.source_mode = source["source_mode"];
|
|
this.macos = source["macos"];
|
|
this.installer = source["installer"];
|
|
this.cpus = source["cpus"];
|
|
this.memory = source["memory"];
|
|
this.disk_size = source["disk_size"];
|
|
this.disk = source["disk"];
|
|
this.disk_mode = source["disk_mode"];
|
|
this.graphics = source["graphics"];
|
|
this.gpu = source["gpu"];
|
|
this.resolution = source["resolution"];
|
|
this.displays = source["displays"];
|
|
this.borderless = source["borderless"];
|
|
this.audio = source["audio"];
|
|
this.network = source["network"];
|
|
this.ssh_port = source["ssh_port"];
|
|
this.logs = source["logs"];
|
|
this.start = source["start"];
|
|
}
|
|
}
|
|
export class SetOpts {
|
|
name: string;
|
|
cpus?: number;
|
|
memory?: string;
|
|
graphics?: string;
|
|
displays?: number;
|
|
disk_controller?: string;
|
|
resolution?: string;
|
|
borderless?: boolean;
|
|
capture?: boolean;
|
|
gpu?: string;
|
|
logs?: boolean;
|
|
log_level?: string;
|
|
audio?: boolean;
|
|
audio_backend?: string;
|
|
network?: boolean;
|
|
ssh_port?: number;
|
|
stop_timeout?: number;
|
|
extra_args?: string;
|
|
env?: string[];
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new SetOpts(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.name = source["name"];
|
|
this.cpus = source["cpus"];
|
|
this.memory = source["memory"];
|
|
this.graphics = source["graphics"];
|
|
this.displays = source["displays"];
|
|
this.disk_controller = source["disk_controller"];
|
|
this.resolution = source["resolution"];
|
|
this.borderless = source["borderless"];
|
|
this.capture = source["capture"];
|
|
this.gpu = source["gpu"];
|
|
this.logs = source["logs"];
|
|
this.log_level = source["log_level"];
|
|
this.audio = source["audio"];
|
|
this.audio_backend = source["audio_backend"];
|
|
this.network = source["network"];
|
|
this.ssh_port = source["ssh_port"];
|
|
this.stop_timeout = source["stop_timeout"];
|
|
this.extra_args = source["extra_args"];
|
|
this.env = source["env"];
|
|
}
|
|
}
|
|
export class VMDetail {
|
|
name: string;
|
|
state: string;
|
|
kind: string;
|
|
directory: string;
|
|
cpus: number;
|
|
memory: string;
|
|
disk: string;
|
|
disk_controller: string;
|
|
graphics: string;
|
|
display: string;
|
|
displays: number;
|
|
resolution: string;
|
|
gpu: string;
|
|
has_opencore: boolean;
|
|
has_installer: boolean;
|
|
installer_path?: string;
|
|
cpu_model: string;
|
|
audio: boolean;
|
|
audio_raw: string;
|
|
network: boolean;
|
|
network_summary: string;
|
|
ssh_port: number;
|
|
logs: boolean;
|
|
log_level: string;
|
|
stop_timeout: number;
|
|
capture: boolean;
|
|
borderless: boolean;
|
|
extra_args: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new VMDetail(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.name = source["name"];
|
|
this.state = source["state"];
|
|
this.kind = source["kind"];
|
|
this.directory = source["directory"];
|
|
this.cpus = source["cpus"];
|
|
this.memory = source["memory"];
|
|
this.disk = source["disk"];
|
|
this.disk_controller = source["disk_controller"];
|
|
this.graphics = source["graphics"];
|
|
this.display = source["display"];
|
|
this.displays = source["displays"];
|
|
this.resolution = source["resolution"];
|
|
this.gpu = source["gpu"];
|
|
this.has_opencore = source["has_opencore"];
|
|
this.has_installer = source["has_installer"];
|
|
this.installer_path = source["installer_path"];
|
|
this.cpu_model = source["cpu_model"];
|
|
this.audio = source["audio"];
|
|
this.audio_raw = source["audio_raw"];
|
|
this.network = source["network"];
|
|
this.network_summary = source["network_summary"];
|
|
this.ssh_port = source["ssh_port"];
|
|
this.logs = source["logs"];
|
|
this.log_level = source["log_level"];
|
|
this.stop_timeout = source["stop_timeout"];
|
|
this.capture = source["capture"];
|
|
this.borderless = source["borderless"];
|
|
this.extra_args = source["extra_args"];
|
|
}
|
|
}
|
|
export class VMListItem {
|
|
name: string;
|
|
dir: string;
|
|
pid?: number;
|
|
state: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new VMListItem(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.name = source["name"];
|
|
this.dir = source["dir"];
|
|
this.pid = source["pid"];
|
|
this.state = source["state"];
|
|
}
|
|
}
|
|
export class ValidationIssue {
|
|
field: string;
|
|
code: string;
|
|
message: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new ValidationIssue(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.field = source["field"];
|
|
this.code = source["code"];
|
|
this.message = source["message"];
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
export namespace runtime {
|
|
|
|
export class Manifest {
|
|
schema_version: number;
|
|
name: string;
|
|
platform: string;
|
|
upstream_repo: string;
|
|
commit: string;
|
|
full_commit: string;
|
|
qemu_version: string;
|
|
util_version: string;
|
|
built_at: string;
|
|
file_count: number;
|
|
dll_count: number;
|
|
raw_bytes: number;
|
|
sha256: Record<string, string>;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new Manifest(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.schema_version = source["schema_version"];
|
|
this.name = source["name"];
|
|
this.platform = source["platform"];
|
|
this.upstream_repo = source["upstream_repo"];
|
|
this.commit = source["commit"];
|
|
this.full_commit = source["full_commit"];
|
|
this.qemu_version = source["qemu_version"];
|
|
this.util_version = source["util_version"];
|
|
this.built_at = source["built_at"];
|
|
this.file_count = source["file_count"];
|
|
this.dll_count = source["dll_count"];
|
|
this.raw_bytes = source["raw_bytes"];
|
|
this.sha256 = source["sha256"];
|
|
}
|
|
}
|
|
export class Installed {
|
|
commit: string;
|
|
dir: string;
|
|
active: boolean;
|
|
manifest: Manifest;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new Installed(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.commit = source["commit"];
|
|
this.dir = source["dir"];
|
|
this.active = source["active"];
|
|
this.manifest = this.convertValues(source["manifest"], Manifest);
|
|
}
|
|
|
|
convertValues(a: any, classs: any, asMap: boolean = false): any {
|
|
if (!a) {
|
|
return a;
|
|
}
|
|
if (a.slice && a.map) {
|
|
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
|
} else if ("object" === typeof a) {
|
|
if (asMap) {
|
|
for (const key of Object.keys(a)) {
|
|
a[key] = new classs(a[key]);
|
|
}
|
|
return a;
|
|
}
|
|
return new classs(a);
|
|
}
|
|
return a;
|
|
}
|
|
}
|
|
|
|
}
|
|
|