feat(database): add CRUD operations for parsed sessions and update session name functionality

This commit is contained in:
kever
2026-02-16 00:39:24 +08:00
parent 41814a2bc8
commit f0a26e31f9
18 changed files with 1119 additions and 1573 deletions

View File

@@ -48,6 +48,22 @@ export namespace model {
this.heroes = source["heroes"];
}
}
export class ParsedSession {
id: number;
session_name: string;
created_at: number;
static createFrom(source: any = {}) {
return new ParsedSession(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.session_name = source["session_name"];
this.created_at = source["created_at"];
}
}
}

View File

@@ -2,6 +2,8 @@
// This file is automatically generated. DO NOT EDIT
import {model} from '../models';
export function DeleteParsedSession(arg1:number):Promise<void>;
export function ExportCurrentData(arg1:string):Promise<void>;
export function ExportData(arg1:Array<string>,arg2:string):Promise<void>;
@@ -20,6 +22,10 @@ export function GetLatestParsedDataFromDatabase():Promise<model.ParsedResult>;
export function GetNetworkInterfaces():Promise<Array<model.NetworkInterface>>;
export function GetParsedDataByID(arg1:number):Promise<model.ParsedResult>;
export function GetParsedSessions():Promise<Array<model.ParsedSession>>;
export function ParseData(arg1:Array<string>):Promise<string>;
export function ReadRawJsonFile():Promise<model.ParsedResult>;
@@ -30,6 +36,10 @@ export function SaveParsedDataToDatabase(arg1:string,arg2:string,arg3:string):Pr
export function StartCapture(arg1:string):Promise<void>;
export function StartCaptureWithFilter(arg1:string,arg2:string):Promise<void>;
export function StopAndParseCapture():Promise<model.ParsedResult>;
export function StopCapture():Promise<void>;
export function UpdateParsedSessionName(arg1:number,arg2:string):Promise<void>;

View File

@@ -2,6 +2,10 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function DeleteParsedSession(arg1) {
return window['go']['service']['App']['DeleteParsedSession'](arg1);
}
export function ExportCurrentData(arg1) {
return window['go']['service']['App']['ExportCurrentData'](arg1);
}
@@ -38,6 +42,14 @@ export function GetNetworkInterfaces() {
return window['go']['service']['App']['GetNetworkInterfaces']();
}
export function GetParsedDataByID(arg1) {
return window['go']['service']['App']['GetParsedDataByID'](arg1);
}
export function GetParsedSessions() {
return window['go']['service']['App']['GetParsedSessions']();
}
export function ParseData(arg1) {
return window['go']['service']['App']['ParseData'](arg1);
}
@@ -58,6 +70,10 @@ export function StartCapture(arg1) {
return window['go']['service']['App']['StartCapture'](arg1);
}
export function StartCaptureWithFilter(arg1, arg2) {
return window['go']['service']['App']['StartCaptureWithFilter'](arg1, arg2);
}
export function StopAndParseCapture() {
return window['go']['service']['App']['StopAndParseCapture']();
}
@@ -65,3 +81,7 @@ export function StopAndParseCapture() {
export function StopCapture() {
return window['go']['service']['App']['StopCapture']();
}
export function UpdateParsedSessionName(arg1, arg2) {
return window['go']['service']['App']['UpdateParsedSessionName'](arg1, arg2);
}

View File

@@ -48,6 +48,10 @@ export function EventsOff(eventName, ...additionalEventNames) {
return window.runtime.EventsOff(eventName, ...additionalEventNames);
}
export function EventsOffAll() {
return window.runtime.EventsOffAll();
}
export function EventsOnce(eventName, callback) {
return EventsOnMultiple(eventName, callback, 1);
}