Files
wails-epic/frontend/wailsjs/go/models.ts
hxt 7865b0da7f refactor(frontend): 重构数据解析逻辑
- 新增 StopAndParseCapture 函数,整合停止抓包和解析数据流程
-重构 ReadRawJsonFile 函数,返回解析后的 ParsedResult 对象
- 优化数据解析流程,提高代码可读性和性能
- 调整前端 CapturePage组件,使用新的解析接口
2025-07-02 22:42:43 +08:00

54 lines
1.3 KiB
TypeScript

export namespace model {
export class CaptureStatus {
is_capturing: boolean;
status: string;
error?: string;
static createFrom(source: any = {}) {
return new CaptureStatus(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.is_capturing = source["is_capturing"];
this.status = source["status"];
this.error = source["error"];
}
}
export class NetworkInterface {
name: string;
description: string;
addresses: string[];
is_loopback: boolean;
static createFrom(source: any = {}) {
return new NetworkInterface(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.name = source["name"];
this.description = source["description"];
this.addresses = source["addresses"];
this.is_loopback = source["is_loopback"];
}
}
export class ParsedResult {
items: any[];
heroes: any[];
static createFrom(source: any = {}) {
return new ParsedResult(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.items = source["items"];
this.heroes = source["heroes"];
}
}
}