Skip to content
Snippets Groups Projects
Commit bae65192 authored by Jan-Philipp Litza's avatar Jan-Philipp Litza Committed by Matthias Schiffer
Browse files

gluon-alfred/gluon-status-page: Query gluon-announced

By not executing all scripts from gluon.announce themselves, both should
be considerably faster and lighter on RAM usage.
parent d2ff7d5c
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/gluon-alfred
SECTION:=gluon
CATEGORY:=Gluon
DEPENDS:=+gluon-core +gluon-announce +gluon-cron +alfred
DEPENDS:=+gluon-core +gluon-announced +gluon-neighbour-info +gluon-cron +alfred
TITLE:=Configure alfred
endef
......
* * * * * /lib/gluon/announce/collect.lua nodeinfo | gzip | alfred -s 158; /lib/gluon/announce/collect.lua statistics | gzip | alfred -s 159; /lib/gluon/announce/collect.lua neighbours | gzip | alfred -s 160
* * * * * gluon-neighbour-info -d ::1 -p 1001 -t 1 -c 1 -r nodeinfo | gzip | alfred -s 158; gluon-neighbour-info -d ::1 -p 1001 -t 1 -c 1 -r statistics | gzip | alfred -s 159; gluon-neighbour-info -d ::1 -p 1001 -t 1 -c 1 -r neighbours | gzip | alfred -s 160
#!/usr/bin/lua
#!/bin/sh
local announce = require 'gluon.announce'
local json = require 'luci.jsonc'
local util = require 'luci.util'
local nixio = require 'nixio'
echo "Access-Control-Allow-Origin: *"
local announce_dir = '/lib/gluon/announce/statistics.d/'
io.write("Access-Control-Allow-Origin: *\n")
io.write("Content-type: text/event-stream\n\n")
while true do
local data = json.stringify(announce.collect_dir(announce_dir))
io.write("data: " .. data .. "\n\n")
io.flush()
nixio.nanosleep(1, 0)
end
exec gluon-neighbour-info -s "" -l -d ::1 -p 1001 -t 1 -r statistics
#!/usr/bin/lua
#!/bin/sh
local announce = require 'gluon.announce'
local json = require 'luci.jsonc'
local util = require 'luci.util'
local nixio = require 'nixio'
cat <<EOF
Access-Control-Allow-Origin: *
Content-type: application/json
local announce_dir = '/lib/gluon/announce/nodeinfo.d/'
io.write("Access-Control-Allow-Origin: *\n")
io.write("Content-type: application/json\n\n")
local data = json.stringify(announce.collect_dir(announce_dir))
io.write(data)
io.flush()
EOF
exec gluon-neighbour-info -d ::1 -p 1001 -t 1 -c 1 -r nodeinfo
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment