Track proxy traffic separately in device inventory
Build and Deploy Gateway / build-and-push (push) Successful in 15s
Build and Deploy Gateway / deploy (push) Successful in 13s

This commit is contained in:
2026-08-07 17:08:24 +03:00
parent 9f31eaf396
commit 53e6cf2146
13 changed files with 714 additions and 146 deletions
+12 -4
View File
@@ -40,7 +40,15 @@ test('Gateway device inventory uses the existing accessible responsive drawer',
assert.match(panel, /device\.confidence === 'ambiguous'/);
assert.match(panel, /sortDevicesByTraffic\(snapshot\?\.devices, sortDirection\)/);
assert.match(panel, /Трафик временно не обновляется/);
assert.match(panel, /Получено \$\{download\}, отдано \$\{upload\}/);
assert.match(panel, /Учитывается только трафик, который прошёл через Harbor/);
assert.match(panel, /Gateway: получено \$\{download\}, отдано \$\{upload\}/);
assert.match(panel, /Прокси: получено \$\{proxyDownload\}, отдано \$\{proxyUpload\}/);
assert.match(panel, /Gateway \{gatewayTraffic\}/);
assert.match(panel, /Прокси \{proxyTraffic\}/);
assert.match(panel, /\(gatewayTotal > 0n \|\| proxyTotal > 0n\)/);
assert.match(panel, /gatewayTotal > 0n && <span>Gateway/);
assert.match(panel, /proxyTotal > 0n && <span className="is-proxy">Прокси/);
assert.match(panel, /source\?\.traffic\?\.proxy\?\.error/);
assert.match(panel, /client-device-traffic-slot[\s\S]*client-device-pin-wrap/);
assert.doesNotMatch(panel, /client-device-details/);
assert.match(panel, /api\.devices\.setPolicy\(device\.id, mode, snapshot\.revision\)/);
@@ -85,10 +93,10 @@ test('device traffic formatting and sorting preserve uint64 precision and canoni
assert.equal(formatByteString('invalid'), '0 Б');
const devices = [
{ id: 'a', uploadBytes: '9007199254740993', downloadBytes: '0' },
{ id: 'a', uploadBytes: '9007199254740993', downloadBytes: '0', proxyUploadBytes: '0' },
{ id: 'b', uploadBytes: '9007199254740992', downloadBytes: '2' },
{ id: 'c', uploadBytes: '10', downloadBytes: '10' },
{ id: 'd', uploadBytes: '15', downloadBytes: '5' },
{ id: 'c', uploadBytes: '10', downloadBytes: '10', proxyDownloadBytes: '100' },
{ id: 'd', uploadBytes: '15', downloadBytes: '5', proxyUploadBytes: '100' },
];
assert.deepEqual(sortDevicesByTraffic(devices, 'desc').map(({ id }) => id), ['b', 'a', 'c', 'd']);
assert.deepEqual(sortDevicesByTraffic(devices, 'asc').map(({ id }) => id), ['c', 'd', 'a', 'b']);