M8 重構(8cd5751)加了很多新 Wails binding(ClearLogs / ExportLog / ForceKillServer / GetBootstrapStatus / GetPreferences / GetRecentLogs / GetServerStatusV2 / GetSystemInfo / InstallKneronDriver / OpenInBrowser / RestartServer / RestartStartupSequence / RevealLogsFolder / SavePreferences / 等)+ 新增 struct(Preferences / LogLine / ServerStatusV2 / SystemInfo)。 wails build 時會 regen wailsjs/go/ 下的 bindings,但上次 M8 commit 時沒 把 regen 結果一併提上去,所以磁碟上的 bindings 和 go source 不同步。 這次 M8-10a build 時自動 regen,順手把 diff 提上來。純產物,無邏輯變更。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
110 lines
2.9 KiB
TypeScript
Executable File
110 lines
2.9 KiB
TypeScript
Executable File
export namespace main {
|
|
|
|
export class LogLine {
|
|
ts: number;
|
|
stream: string;
|
|
line: string;
|
|
level?: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new LogLine(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.ts = source["ts"];
|
|
this.stream = source["stream"];
|
|
this.line = source["line"];
|
|
this.level = source["level"];
|
|
}
|
|
}
|
|
export class Preferences {
|
|
autoOpenBrowser: boolean;
|
|
locale?: string;
|
|
logRingSize?: number;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new Preferences(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.autoOpenBrowser = source["autoOpenBrowser"];
|
|
this.locale = source["locale"];
|
|
this.logRingSize = source["logRingSize"];
|
|
}
|
|
}
|
|
export class ServerStatus {
|
|
running: boolean;
|
|
port: number;
|
|
url: string;
|
|
pid: number;
|
|
pythonBin: string;
|
|
pythonMode: string;
|
|
lastError?: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new ServerStatus(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.running = source["running"];
|
|
this.port = source["port"];
|
|
this.url = source["url"];
|
|
this.pid = source["pid"];
|
|
this.pythonBin = source["pythonBin"];
|
|
this.pythonMode = source["pythonMode"];
|
|
this.lastError = source["lastError"];
|
|
}
|
|
}
|
|
export class ServerStatusV2 {
|
|
state: string;
|
|
port?: number;
|
|
url?: string;
|
|
pid?: number;
|
|
pythonBin?: string;
|
|
pythonMode?: string;
|
|
startedAt?: number;
|
|
lastError?: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new ServerStatusV2(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.state = source["state"];
|
|
this.port = source["port"];
|
|
this.url = source["url"];
|
|
this.pid = source["pid"];
|
|
this.pythonBin = source["pythonBin"];
|
|
this.pythonMode = source["pythonMode"];
|
|
this.startedAt = source["startedAt"];
|
|
this.lastError = source["lastError"];
|
|
}
|
|
}
|
|
export class SystemInfo {
|
|
appVersion: string;
|
|
buildTime: string;
|
|
dataDir: string;
|
|
logsDir: string;
|
|
platform: string;
|
|
|
|
static createFrom(source: any = {}) {
|
|
return new SystemInfo(source);
|
|
}
|
|
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this.appVersion = source["appVersion"];
|
|
this.buildTime = source["buildTime"];
|
|
this.dataDir = source["dataDir"];
|
|
this.logsDir = source["logsDir"];
|
|
this.platform = source["platform"];
|
|
}
|
|
}
|
|
|
|
}
|
|
|