From 148ca302a8c0a6eee8a505b37f331eb41cea899c Mon Sep 17 00:00:00 2001 From: RobWei Date: Thu, 3 Oct 2024 20:43:55 +0200 Subject: [PATCH] add nodes.json filters for domain and domain with site as fallback --- README.md | 2 ++ modules/receiver.js | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 3b1cb58..0333c9f 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,8 @@ Note: The default paths for configuration and state files might have changed. Ma ### Filternames - site +- domain +- domain_fallback_site - firmware_release - firstseen - lastseen diff --git a/modules/receiver.js b/modules/receiver.js index baf5e79..5d790d1 100644 --- a/modules/receiver.js +++ b/modules/receiver.js @@ -160,6 +160,14 @@ module.exports = function (observer, configData) { return _.pickBy(data, function(o) { return _.includes(_.split(query.value, ','), _.get(o, 'nodeinfo.system.site_code', 'unknown')) }) + case 'domain': + return _.pickBy(data, function(o) { + return _.includes(_.split(query.value, ','), _.get(o, 'nodeinfo.system.domain_code', 'unknown')) + }) + case 'domain_fallback_site': + return _.pickBy(data, function(o) { + return _.includes(_.split(query.value, ','), _.get(o, 'nodeinfo.system.domain_code', _.get(o, 'nodeinfo.system.site_code', 'unknown'))) + }) case 'firmware_release': return _.pickBy(data, function(o) { return _.includes(_.split(query.value, ','), _.get(o, 'nodeinfo.software.firmware.release', 'unknown'))