mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-11-01 10:57:47 +00:00
ucentral-event: fix polled telemetry stream
Fixes: WIFI-12341 Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -43,7 +43,14 @@ function event(object, verb, payload) {
|
|||||||
let type = object;
|
let type = object;
|
||||||
if (verb)
|
if (verb)
|
||||||
type += '.' + verb;
|
type += '.' + verb;
|
||||||
if (match(object, type, config.bulk?.filter))
|
|
||||||
|
if (match(object, type, config.realtime?.filter))
|
||||||
|
ubus.call('ucentral', 'event', {
|
||||||
|
type,
|
||||||
|
payload
|
||||||
|
});
|
||||||
|
|
||||||
|
else if (!config.bulk?.interval || match(object, type, config.bulk?.filter))
|
||||||
ubus.call('ucentral', 'telemetry', {
|
ubus.call('ucentral', 'telemetry', {
|
||||||
event: 'event',
|
event: 'event',
|
||||||
payload: {
|
payload: {
|
||||||
@@ -51,11 +58,6 @@ function event(object, verb, payload) {
|
|||||||
payload
|
payload
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
else if (match(object, type, config.realtime?.filter))
|
|
||||||
ubus.call('ucentral', 'event', {
|
|
||||||
type,
|
|
||||||
payload
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let handlers = {
|
let handlers = {
|
||||||
@@ -114,7 +116,7 @@ let handlers = {
|
|||||||
|
|
||||||
|
|
||||||
function hapd_subscriber_notify_cb(notify) {
|
function hapd_subscriber_notify_cb(notify) {
|
||||||
if (config.wifi?.filter == '*' || index(config.wifi?.filter || [], notify.type) > 0) {
|
if (config.wifi?.filter == '*' || index(config.wifi?.filter || [], notify.type) >= 0) {
|
||||||
let payload = {};
|
let payload = {};
|
||||||
payload[notify.type] = notify.data;
|
payload[notify.type] = notify.data;
|
||||||
ubus.call('ucentral', 'telemetry', {
|
ubus.call('ucentral', 'telemetry', {
|
||||||
@@ -181,7 +183,7 @@ function hapd_subscriber_remove_cb(remove) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function dhcp_subscriber_notify_cb(notify) {
|
function dhcp_subscriber_notify_cb(notify) {
|
||||||
if (config.dhcp?.filter == '*' || index(config.dhcp?.filter || [], notify.type) > 0) {
|
if (config.dhcp?.filter == '*' || index(config.dhcp?.filter || [], notify.type) >= 0) {
|
||||||
notify.data.type = notify.type;
|
notify.data.type = notify.type;
|
||||||
ubus.call('ucentral', 'telemetry', {
|
ubus.call('ucentral', 'telemetry', {
|
||||||
event: 'dhcp-snooping',
|
event: 'dhcp-snooping',
|
||||||
|
|||||||
Reference in New Issue
Block a user