Formatting is done.

This commit is contained in:
Owaise committed 2025-08-15 11:37:38 +05:30
1 parent 1ecec115e4
commit 88c478c533
2 files changed
+25 -9

No files matched your search

@@ -71,7 +71,7 @@ const Network = ({ net, checks, isLoading, dateRange, setDateRange }) => {
onChange={(e) => setSelectedInterface(e.target.value)} onChange={(e) => setSelectedInterface(e.target.value)}
items={availableInterfaces.map((interfaceName) => ({ items={availableInterfaces.map((interfaceName) => ({
_id: interfaceName, _id: interfaceName,
name: interfaceName name: interfaceName,
}))} }))}
sx={{ minWidth: 200 }} sx={{ minWidth: 200 }}
/> />
@@ -409,7 +409,9 @@ const buildHardwareDetailsPipeline = (monitor, dates, dateString) => {
$arrayElemAt: [ $arrayElemAt: [
{ {
$map: { $map: {
input: { $arrayElemAt: [{ $ifNull: ["$net", []] }, { $subtract: [{ $size: { $ifNull: ["$net", []] } }, 1] }] }, input: {
$arrayElemAt: [{ $ifNull: ["$net", []] }, { $subtract: [{ $size: { $ifNull: ["$net", []] } }, 1] }],
},
as: "iface", as: "iface",
in: "$$iface.bytes_sent", in: "$$iface.bytes_sent",
}, },
@@ -418,7 +420,9 @@ const buildHardwareDetailsPipeline = (monitor, dates, dateString) => {
], ],
}, },
tFirst: { $arrayElemAt: ["$updatedAts", 0] }, tFirst: { $arrayElemAt: ["$updatedAts", 0] },
tLast: { $arrayElemAt: [{ $ifNull: ["$updatedAts", []] }, { $subtract: [{ $size: { $ifNull: ["$updatedAts", []] } }, 1] }] }, tLast: {
$arrayElemAt: [{ $ifNull: ["$updatedAts", []] }, { $subtract: [{ $size: { $ifNull: ["$updatedAts", []] } }, 1] }],
},
}, },
in: { in: {
$cond: [ $cond: [
@@ -444,7 +448,9 @@ const buildHardwareDetailsPipeline = (monitor, dates, dateString) => {
$arrayElemAt: [ $arrayElemAt: [
{ {
$map: { $map: {
input: { $arrayElemAt: [{ $ifNull: ["$net", []] }, { $subtract: [{ $size: { $ifNull: ["$net", []] } }, 1] }] }, input: {
$arrayElemAt: [{ $ifNull: ["$net", []] }, { $subtract: [{ $size: { $ifNull: ["$net", []] } }, 1] }],
},
as: "iface", as: "iface",
in: "$$iface.bytes_recv", in: "$$iface.bytes_recv",
}, },
@@ -453,7 +459,9 @@ const buildHardwareDetailsPipeline = (monitor, dates, dateString) => {
], ],
}, },
tFirst: { $arrayElemAt: ["$updatedAts", 0] }, tFirst: { $arrayElemAt: ["$updatedAts", 0] },
tLast: { $arrayElemAt: [{ $ifNull: ["$updatedAts", []] }, { $subtract: [{ $size: { $ifNull: ["$updatedAts", []] } }, 1] }] }, tLast: {
$arrayElemAt: [{ $ifNull: ["$updatedAts", []] }, { $subtract: [{ $size: { $ifNull: ["$updatedAts", []] } }, 1] }],
},
}, },
in: { in: {
$cond: [ $cond: [
@@ -479,7 +487,9 @@ const buildHardwareDetailsPipeline = (monitor, dates, dateString) => {
$arrayElemAt: [ $arrayElemAt: [
{ {
$map: { $map: {
input: { $arrayElemAt: [{ $ifNull: ["$net", []] }, { $subtract: [{ $size: { $ifNull: ["$net", []] } }, 1] }] }, input: {
$arrayElemAt: [{ $ifNull: ["$net", []] }, { $subtract: [{ $size: { $ifNull: ["$net", []] } }, 1] }],
},
as: "iface", as: "iface",
in: "$$iface.packets_sent", in: "$$iface.packets_sent",
}, },
@@ -488,7 +498,9 @@ const buildHardwareDetailsPipeline = (monitor, dates, dateString) => {
], ],
}, },
tFirst: { $arrayElemAt: ["$updatedAts", 0] }, tFirst: { $arrayElemAt: ["$updatedAts", 0] },
tLast: { $arrayElemAt: [{ $ifNull: ["$updatedAts", []] }, { $subtract: [{ $size: { $ifNull: ["$updatedAts", []] } }, 1] }] }, tLast: {
$arrayElemAt: [{ $ifNull: ["$updatedAts", []] }, { $subtract: [{ $size: { $ifNull: ["$updatedAts", []] } }, 1] }],
},
}, },
in: { in: {
$cond: [ $cond: [
@@ -566,7 +578,9 @@ const buildHardwareDetailsPipeline = (monitor, dates, dateString) => {
$arrayElemAt: [ $arrayElemAt: [
{ {
$map: { $map: {
input: { $arrayElemAt: [{ $ifNull: ["$net", []] }, { $subtract: [{ $size: { $ifNull: ["$net", []] } }, 1] }] }, input: {
$arrayElemAt: [{ $ifNull: ["$net", []] }, { $subtract: [{ $size: { $ifNull: ["$net", []] } }, 1] }],
},
as: "iface", as: "iface",
in: "$$iface.err_in", in: "$$iface.err_in",
}, },
@@ -575,7 +589,9 @@ const buildHardwareDetailsPipeline = (monitor, dates, dateString) => {
], ],
}, },
tFirst: { $arrayElemAt: ["$updatedAts", 0] }, tFirst: { $arrayElemAt: ["$updatedAts", 0] },
tLast: { $arrayElemAt: [{ $ifNull: ["$updatedAts", []] }, { $subtract: [{ $size: { $ifNull: ["$updatedAts", []] } }, 1] }] }, tLast: {
$arrayElemAt: [{ $ifNull: ["$updatedAts", []] }, { $subtract: [{ $size: { $ifNull: ["$updatedAts", []] } }, 1] }],
},
}, },
in: { in: {
$cond: [ $cond: [