<commit_before>module("luci.controller.freifunk.freifunk", package.seeall)

function index()
	local page  = node()
	page.target = alias("freifunk")

	local page    = node("freifunk")
	page.title    = "Freifunk"
	page.target   = alias("freifunk", "index")
	page.order    = 5
	page.setuser  = "nobody"
	page.setgroup = "nogroup"
	
	local page  = node("freifunk", "index")
	page.target = template("freifunk/index")
	page.title  = "Übersicht"
	page.order  = 10
	
	local page  = node("freifunk", "index", "contact")
	page.target = template("freifunk/contact")
	page.title  = "Kontakt"
	
	
	local page  = node("freifunk", "status")
	page.target = call("action_status")
	page.title  = "Status"
	page.order  = 20
	page.setuser  = false
	page.setgroup = false
	
	assign({"freifunk", "status", "routes"}, node("admin", "status", "routes"), "Routingtabelle", 10)
	assign({"freifunk", "status", "iwscan"}, node("admin", "status", "iwscan"), "WLAN-Scan", 20)
	
	assign({"freifunk", "olsr"}, node("admin", "status", "olsr"), "OLSR", 30)
	
	local page  = node("admin", "index", "freifunk")
	page.target = cbi("freifunk/freifunk")
	page.title  = "Freifunk"
	page.order  = 30
	
	local page  = node("admin", "index", "contact")
	page.target = cbi("freifunk/contact")
	page.title  = "Kontakt"
	page.order  = 40
end

function action_status()
	local data = {}
	
	data.s, data.m, data.r = luci.sys.sysinfo()
	
	data.wifi = luci.sys.wifi.getiwconfig()
	
	data.routes = {}
	for i, r in pairs(luci.sys.net.routes()) do
		if r.Destination == "00000000" then
			table.insert(data.routes, r)
		end
	end

	
	luci.template.render("public_status/index", data)
end<commit_msg>* Linked statistic graphs to Freifunk module<commit_after>module("luci.controller.freifunk.freifunk", package.seeall)

function index()
	local i18n = luci.i18n.translate

	local page  = node()
	page.target = alias("freifunk")

	local page    = node("freifunk")
	page.title    = "Freifunk"
	page.target   = alias("freifunk", "index")
	page.order    = 5
	page.setuser  = "nobody"
	page.setgroup = "nogroup"
	
	local page  = node("freifunk", "index")
	page.target = template("freifunk/index")
	page.title  = "Übersicht"
	page.order  = 10
	
	local page  = node("freifunk", "index", "contact")
	page.target = template("freifunk/contact")
	page.title  = "Kontakt"
	
	
	local page  = node("freifunk", "status")
	page.target = call("action_status")
	page.title  = "Status"
	page.order  = 20
	page.setuser  = false
	page.setgroup = false
	
	assign({"freifunk", "status", "routes"}, node("admin", "status", "routes"), "Routingtabelle", 10)
	assign({"freifunk", "status", "iwscan"}, node("admin", "status", "iwscan"), "WLAN-Scan", 20)
	
	assign({"freifunk", "olsr"}, node("admin", "status", "olsr"), "OLSR", 30)
	
	if luci.fs.isfile("/etc/config/luci_statistics") then
		assign({"freifunk", "statistics"}, node("admin", "statistics", "graph"), i18n("stat_statistics", "Statistiken"), 40)
	end
	
	local page  = node("admin", "index", "freifunk")
	page.target = cbi("freifunk/freifunk")
	page.title  = "Freifunk"
	page.order  = 30
	
	local page  = node("admin", "index", "contact")
	page.target = cbi("freifunk/contact")
	page.title  = "Kontakt"
	page.order  = 40
end

function action_status()
	local data = {}
	
	data.s, data.m, data.r = luci.sys.sysinfo()
	
	data.wifi = luci.sys.wifi.getiwconfig()
	
	data.routes = {}
	for i, r in pairs(luci.sys.net.routes()) do
		if r.Destination == "00000000" then
			table.insert(data.routes, r)
		end
	end

	
	luci.template.render("public_status/index", data)
end
{'fraction_non_alphanumeric': 0.1799151343705799, 'fraction_numerical': 0.015275813295615276, 'mean_word_length': 4.261904761904762, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6885734', 'n_tokens_mistral': 1433, 'n_tokens_neox': 1336, 'n_words': 280}