feat: add Wails runtime library and initial application setup

- Created package.json for Wails JavaScript runtime library.
- Added TypeScript definitions for runtime functions.
- Implemented runtime.js with event handling and logging functions.
- Initialized Go module with dependencies for Wails and other libraries.
- Added main.go for application entry point and asset embedding.
- Configured wails.json for application settings and build commands.
This commit is contained in:
Jonathan Atta
2026-03-11 17:06:52 +01:00
commit 17beab746e
34 changed files with 3608 additions and 0 deletions

10
frontend/wailsjs/go/main/App.d.ts vendored Executable file
View File

@@ -0,0 +1,10 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {backend} from '../models';
import {context} from '../models';
export function GetMetrics():Promise<backend.Metrics>;
export function Greet(arg1:string):Promise<string>;
export function InitBackend(arg1:context.Context):Promise<void>;

15
frontend/wailsjs/go/main/App.js Executable file
View File

@@ -0,0 +1,15 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function GetMetrics() {
return window['go']['main']['App']['GetMetrics']();
}
export function Greet(arg1) {
return window['go']['main']['App']['Greet'](arg1);
}
export function InitBackend(arg1) {
return window['go']['main']['App']['InitBackend'](arg1);
}

69
frontend/wailsjs/go/models.ts Executable file
View File

@@ -0,0 +1,69 @@
export namespace backend {
export class ProcessInfo {
pid: number;
name: string;
cpu: number;
mem: number;
static createFrom(source: any = {}) {
return new ProcessInfo(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.pid = source["pid"];
this.name = source["name"];
this.cpu = source["cpu"];
this.mem = source["mem"];
}
}
export class Metrics {
cpu_percent: number;
total_mem: number;
free_mem: number;
processes: ProcessInfo[];
timestamp: number;
gpu_name?: string;
gpu_total_mem?: number;
gpu_used_mem?: number;
gpu_util_percent?: number;
static createFrom(source: any = {}) {
return new Metrics(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.cpu_percent = source["cpu_percent"];
this.total_mem = source["total_mem"];
this.free_mem = source["free_mem"];
this.processes = this.convertValues(source["processes"], ProcessInfo);
this.timestamp = source["timestamp"];
this.gpu_name = source["gpu_name"];
this.gpu_total_mem = source["gpu_total_mem"];
this.gpu_used_mem = source["gpu_used_mem"];
this.gpu_util_percent = source["gpu_util_percent"];
}
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;
}
}
}