sk-matrix-project/app/wails/frontend/wailsjs/go/models.ts
2023-07-19 16:07:35 +08:00

363 lines
10 KiB
TypeScript

export namespace cpu {
export class InfoStat {
cpu: number;
vendorId: string;
family: string;
model: string;
stepping: number;
physicalId: string;
coreId: string;
cores: number;
modelName: string;
mhz: number;
cacheSize: number;
flags: string[];
microcode: string;
static createFrom(source: any = {}) {
return new InfoStat(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.cpu = source["cpu"];
this.vendorId = source["vendorId"];
this.family = source["family"];
this.model = source["model"];
this.stepping = source["stepping"];
this.physicalId = source["physicalId"];
this.coreId = source["coreId"];
this.cores = source["cores"];
this.modelName = source["modelName"];
this.mhz = source["mhz"];
this.cacheSize = source["cacheSize"];
this.flags = source["flags"];
this.microcode = source["microcode"];
}
}
export class TimesStat {
cpu: string;
user: number;
system: number;
idle: number;
nice: number;
iowait: number;
irq: number;
softirq: number;
steal: number;
guest: number;
guestNice: number;
static createFrom(source: any = {}) {
return new TimesStat(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.cpu = source["cpu"];
this.user = source["user"];
this.system = source["system"];
this.idle = source["idle"];
this.nice = source["nice"];
this.iowait = source["iowait"];
this.irq = source["irq"];
this.softirq = source["softirq"];
this.steal = source["steal"];
this.guest = source["guest"];
this.guestNice = source["guestNice"];
}
}
}
export namespace disk {
export class PartitionStat {
device: string;
mountpoint: string;
fstype: string;
opts: string;
static createFrom(source: any = {}) {
return new PartitionStat(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.device = source["device"];
this.mountpoint = source["mountpoint"];
this.fstype = source["fstype"];
this.opts = source["opts"];
}
}
export class UsageStat {
path: string;
fstype: string;
total: number;
free: number;
used: number;
usedPercent: number;
inodesTotal: number;
inodesUsed: number;
inodesFree: number;
inodesUsedPercent: number;
static createFrom(source: any = {}) {
return new UsageStat(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.path = source["path"];
this.fstype = source["fstype"];
this.total = source["total"];
this.free = source["free"];
this.used = source["used"];
this.usedPercent = source["usedPercent"];
this.inodesTotal = source["inodesTotal"];
this.inodesUsed = source["inodesUsed"];
this.inodesFree = source["inodesFree"];
this.inodesUsedPercent = source["inodesUsedPercent"];
}
}
}
export namespace mem {
export class SwapMemoryStat {
total: number;
used: number;
free: number;
usedPercent: number;
sin: number;
sout: number;
pgin: number;
pgout: number;
pgfault: number;
pgmajfault: number;
static createFrom(source: any = {}) {
return new SwapMemoryStat(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.total = source["total"];
this.used = source["used"];
this.free = source["free"];
this.usedPercent = source["usedPercent"];
this.sin = source["sin"];
this.sout = source["sout"];
this.pgin = source["pgin"];
this.pgout = source["pgout"];
this.pgfault = source["pgfault"];
this.pgmajfault = source["pgmajfault"];
}
}
export class VirtualMemoryStat {
total: number;
available: number;
used: number;
usedPercent: number;
free: number;
active: number;
inactive: number;
wired: number;
laundry: number;
buffers: number;
cached: number;
writeback: number;
dirty: number;
writebacktmp: number;
shared: number;
slab: number;
sreclaimable: number;
sunreclaim: number;
pagetables: number;
swapcached: number;
commitlimit: number;
committedas: number;
hightotal: number;
highfree: number;
lowtotal: number;
lowfree: number;
swaptotal: number;
swapfree: number;
mapped: number;
vmalloctotal: number;
vmallocused: number;
vmallocchunk: number;
hugepagestotal: number;
hugepagesfree: number;
hugepagesize: number;
static createFrom(source: any = {}) {
return new VirtualMemoryStat(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.total = source["total"];
this.available = source["available"];
this.used = source["used"];
this.usedPercent = source["usedPercent"];
this.free = source["free"];
this.active = source["active"];
this.inactive = source["inactive"];
this.wired = source["wired"];
this.laundry = source["laundry"];
this.buffers = source["buffers"];
this.cached = source["cached"];
this.writeback = source["writeback"];
this.dirty = source["dirty"];
this.writebacktmp = source["writebacktmp"];
this.shared = source["shared"];
this.slab = source["slab"];
this.sreclaimable = source["sreclaimable"];
this.sunreclaim = source["sunreclaim"];
this.pagetables = source["pagetables"];
this.swapcached = source["swapcached"];
this.commitlimit = source["commitlimit"];
this.committedas = source["committedas"];
this.hightotal = source["hightotal"];
this.highfree = source["highfree"];
this.lowtotal = source["lowtotal"];
this.lowfree = source["lowfree"];
this.swaptotal = source["swaptotal"];
this.swapfree = source["swapfree"];
this.mapped = source["mapped"];
this.vmalloctotal = source["vmalloctotal"];
this.vmallocused = source["vmallocused"];
this.vmallocchunk = source["vmallocchunk"];
this.hugepagestotal = source["hugepagestotal"];
this.hugepagesfree = source["hugepagesfree"];
this.hugepagesize = source["hugepagesize"];
}
}
}
export namespace net {
export class Addr {
ip: string;
port: number;
static createFrom(source: any = {}) {
return new Addr(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.ip = source["ip"];
this.port = source["port"];
}
}
export class ConnectionStat {
fd: number;
family: number;
type: number;
localaddr: Addr;
remoteaddr: Addr;
status: string;
uids: number[];
pid: number;
static createFrom(source: any = {}) {
return new ConnectionStat(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.fd = source["fd"];
this.family = source["family"];
this.type = source["type"];
this.localaddr = this.convertValues(source["localaddr"], Addr);
this.remoteaddr = this.convertValues(source["remoteaddr"], Addr);
this.status = source["status"];
this.uids = source["uids"];
this.pid = source["pid"];
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice) {
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 IOCountersStat {
name: string;
bytesSent: number;
bytesRecv: number;
packetsSent: number;
packetsRecv: number;
errin: number;
errout: number;
dropin: number;
dropout: number;
fifoin: number;
fifoout: number;
static createFrom(source: any = {}) {
return new IOCountersStat(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.name = source["name"];
this.bytesSent = source["bytesSent"];
this.bytesRecv = source["bytesRecv"];
this.packetsSent = source["packetsSent"];
this.packetsRecv = source["packetsRecv"];
this.errin = source["errin"];
this.errout = source["errout"];
this.dropin = source["dropin"];
this.dropout = source["dropout"];
this.fifoin = source["fifoin"];
this.fifoout = source["fifoout"];
}
}
}
export namespace system {
export class ProcessDTO {
pid: number;
name: string;
parent: number;
status: string;
createTime: number;
static createFrom(source: any = {}) {
return new ProcessDTO(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.pid = source["pid"];
this.name = source["name"];
this.parent = source["parent"];
this.status = source["status"];
this.createTime = source["createTime"];
}
}
}