Some more fixes #10

Merged
dsutanto merged 2 commits from dsutanto/Deep-Package-Inspection:main into Proxy_Server_API_Netify 2026-07-20 14:11:36 +07:00
2 changed files with 8 additions and 7 deletions

No files matched your search

+7 -6
View File
@@ -1,6 +1,6 @@
const express = require('express');
const router = express.Router();
const { AppStat, ProtocolStat, AppCategoryStat, LookupApp } = require('../../models/Schemas');
const { AppStat, ProtocolStat, AppCategoryStat, LookupApp, Flow } = require('../../models/Schemas');
const { getTimeFilter, getBaseFilter } = require('./helpers');
// GET /api/dashboard/apps
@@ -44,17 +44,18 @@ router.get('/protocols', async (req, res) => {
const base = getBaseFilter(req, timeFilter);
const pipeline = [
{ $match: base },
{ $match: { ...base, protocol: { $ne: null, $ne: '' } } },
{ $group: {
_id: '$protocol_label',
_id: '$protocol',
download: { $sum: '$download' },
upload: { $sum: '$upload' },
flows: { $sum: '$flows' },
flows: { $sum: 1 },
}},
{ $sort: { download: -1 } }
{ $sort: { download: -1 } },
{ $limit: 20 }
];
const result = await ProtocolStat.aggregate(pipeline);
const result = await Flow.aggregate(pipeline);
const formatted = result.map(r => ({
protocol_label: r._id,
download: r.download || 0,
+1 -1
View File
@@ -22,7 +22,7 @@ export default function SummaryPage() {
let appsData = rawTopApps.data || [];
const standardProtocols = [
'QUIC', 'HTTPS', 'HTTP', 'STUN', 'TCP', 'UDP', 'TLS', 'DNS', 'ICMP',
'QUIC', 'HTTPS', 'HTTP', 'STUN', 'TCP', 'UDP', 'TLS', 'DNS', 'ICMP',
'SSH', 'FTP', 'SMTP', 'POP3', 'IMAP', 'NTP', 'DHCP', 'BGP', 'OSPF', 'IPSEC', 'OPENVPN'
];