fix: use destination ip as host if host is an empty string

This commit is contained in:
Haishan 2020-02-06 16:46:52 +08:00
parent 7a5cd76e1e
commit 804517c510

View file

@ -20,7 +20,9 @@ const paddingBottom = 30;
function formatConnectionDataItem(i) { function formatConnectionDataItem(i) {
const { id, metadata, upload, download, start, chains, rule } = i; const { id, metadata, upload, download, start, chains, rule } = i;
const { host, destinationPort } = metadata; let { host, destinationPort, destinationIP } = metadata;
// host could be an empty string if it's direct IP connection
if (host === '') host = destinationIP;
const metadataNext = { const metadataNext = {
...metadata, ...metadata,
// merge host and destinationPort into one column // merge host and destinationPort into one column