From 84ea30184cd091de01f474cc51dba2645573c59c Mon Sep 17 00:00:00 2001 From: "Brett T. Warden" <4c0e8e88@tm.wgz.org> Date: Fri, 29 Sep 2023 20:08:49 -0700 Subject: [PATCH] Implement nodes=1 in sysinfo.json to return number of mesh nodes (#951) * Implement nodes=1 in sysinfo.json to return number of mesh nodes Fixes #950 * Bump api_version in sysinfo.json Introduce new parameter nodes=1 --- files/www/cgi-bin/sysinfo.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/files/www/cgi-bin/sysinfo.json b/files/www/cgi-bin/sysinfo.json index 1a84e477..bd636335 100755 --- a/files/www/cgi-bin/sysinfo.json +++ b/files/www/cgi-bin/sysinfo.json @@ -55,7 +55,7 @@ end info={} -- API version -info['api_version']="1.11" +info['api_version']="1.12" -- NODE name @@ -194,6 +194,11 @@ if string.find(nixio.getenv("QUERY_STRING"):lower(),"lqm=1") then info['lqm']=lqm end +-- MESH NODES COUNT +if string.find(nixio.getenv("QUERY_STRING"):lower(),"nodes=1") then + info['nodes']=aredn_info.getOLSRInfo() +end + -- Output the HTTP header for JSON json_header()