Skip to content

Commit

Permalink
fix: add missing summary data
Browse files Browse the repository at this point in the history
  • Loading branch information
tautcony committed Oct 17, 2023
1 parent c6bccdf commit 42e5e02
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions setup/dashboard/ws/src/utils/vnstat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,15 @@ export async function getVnstatData(iface: string): Promise<ParsedVnstatData> {
ret.top.push(top);
}

// summary data from old dumpdb command
const created = ifaceData.created;
ret.summary = {
totalrx: trafficData.total.rx * dataCoefficient, // in bytes
totaltx: trafficData.total.tx * dataCoefficient, // in bytes
interface: ifaceData.name,
created: (+new Date(created.date.year, created.date.month as number - 1, created.date.day) / 1000),
};

return ret;
}

Expand Down

0 comments on commit 42e5e02

Please sign in to comment.