diff --git a/modules/luci-mod-freifunk/htdocs/luci-static/resources/freifunk-map/map.htm b/modules/luci-mod-freifunk/htdocs/luci-static/resources/freifunk-map/map.htm new file mode 100644 index 0000000000000000000000000000000000000000..43b248f1eab0ba6869e7d5895ff34f36fab5b6eb --- /dev/null +++ b/modules/luci-mod-freifunk/htdocs/luci-static/resources/freifunk-map/map.htm @@ -0,0 +1,149 @@ + + + + + + + Map + + + +
+ + + + \ No newline at end of file diff --git a/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/admin/index.js b/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/admin/index.js new file mode 100644 index 0000000000000000000000000000000000000000..43579fc3f89759c0389c4b435245fd0741c90404 --- /dev/null +++ b/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/admin/index.js @@ -0,0 +1,49 @@ +'use strict'; +'require uci'; +'require view'; + +return view.extend({ + handleReset: null, + handleSave: null, + handleSaveApply: null, + load: () => { + return Promise.all([ + uci.load('freifunk'), + uci.load('system') + ]) + }, + render: () => { + let nickname = uci.get('freifunk', 'contact', 'nickname'); + let name = uci.get('freifunk', 'contact', 'name'); + let mail = uci.get('freifunk', 'contact', 'mail'); + let contacturl = L.url('admin/freifunk/contact'); + let hostname = uci.get_first('system', 'system', 'hostname'); + let latitude = uci.get_first('system', 'system', 'latitude'); + let longitude = uci.get_first('system', 'system', 'longitude'); + let location = uci.get_first('system', 'system', 'location'); + let basicsurl = L.url('admin/freifunk/basics'); + let basicSettingsWarning = (hostname == null || latitude == null || longitude == null)? E('div', {'class': 'label warning'}, [ + _('Basic settings are incomplete. Please go to'), + ' ', + E('a', {'href': basicsurl}, _('Basic settings')), + ' ', + _('and fill out all required fields.'), + E('p') + ]): E([]); + let contactWarning = (nickname == null && name == null && email == null)? E('div', {'class': 'label warning'}, [ + _('Contact information is incomplete. Please go to'), + ' ', + E('a', {'href': contacturl}, _('Contact')), + ' ', + _('and fill out all required fields.'), + E('p') + ]): E([]); + return E([], {}, [ + E('h2', {}, _('Freifunk Overview')), + _('These pages will assist you in setting up your router for Freifunk or similar wireless community networks.'), + E('p'), + basicSettingsWarning, + + ]); + } +}) diff --git a/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/frontend/contact.js b/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/frontend/contact.js index fefd99c1e2032df9bba1d59bdc2551d71a23a7c2..8023c87b3a05f87e5a1992753b4f00245b55ffe2 100644 --- a/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/frontend/contact.js +++ b/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/frontend/contact.js @@ -28,7 +28,7 @@ return view.extend({ let lat = uci.get_first("system", "system", "latitude"); let latlon = E([], {}, [ lat + ' ' + lon + ' (', - E('a', {'href': L.url('freifunk/map')}, _('Show on map')), + E('a', {'href': L.url('freifunk/map/map')}, _('Show on map')), ')']); let location = uci.get_first("system", "system", "location") if (location == null) { diff --git a/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/frontend/index.js b/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/frontend/index.js index ef7639d06821961649005b08a12f73d465cf80d1..879ce6019e4ca6cf24d555ca58c655fb512dfe7a 100644 --- a/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/frontend/index.js +++ b/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/frontend/index.js @@ -1,22 +1,33 @@ 'use strict'; 'require fs'; +'require rpc'; 'require uci'; 'require view'; +var getSystemBoard = rpc.declare({ + object: 'system', + method: 'board', + expect: {} +}); + return view.extend({ handleReset: null, handleSave: null, handleSaveApply: null, - load: () => { + load: () => { return Promise.all([ uci.load('freifunk').then(() => { - fs.read + let community = uci.get('freifunk', 'community', 'name'); + uci.load('profile_' + community); + }).then(() => { + return fs.read('/www/luci-static/index_user.html'); + }).catch((error) => { + console.log(_('Error while reading file: ') + error); }), - fs.read('/www/luci-static/index_user.html') + getSystemBoard() ]) }, render: (data) => { - console.log(data); let redirectPage = uci.get('freifunk', 'luci', 'redirect_landingpage'); if (redirectPage != null) { window.location.replace(L.url(redirectPage)); @@ -26,11 +37,49 @@ return view.extend({ if (redirectUrl != null) { window.location.replace(redirectUrl); return; - + } let defaultText = uci.get('freifunk', 'community', 'DefaultText'); let nickName = uci.get('freifunk', 'contact', 'nickname'); let community = uci.get('freifunk', 'community', 'name') - return E('h2', 'yes'); + community = (community === undefined) ? 'Freifunk' : community; + let url = uci.get_first('profile_' + community, 'community', 'homepage'); + url = (url === undefined) ? 'https://freifunk.net' : url; + const hostname = data[1].hostname; + const userText = data[0]; + let defaultContent; + if (defaultText != 'disabled' || !defaultText) { + defaultContent = E([], {}, [ + E('h2', {}, _('Hello and welcome in the network of') + ' ' + community), + E('p', {}, [ + _('We are an initiative to establish a free, independent and open wireless mesh network.'), + E('br', {}, []), + _('This is the access point') + ' ', + hostname + '.', + _('It is operated by') + ' ', + E('a', { 'href': L.url('freifunk/contact') }, (nickName === undefined) ? _('Please set your contact information') : nickName) + ]), + E('p', {}, [ + _('You can find further information about the global Freifunk initiative at') + ' ', + E('a', { 'href': 'https://freifunk.net' }, 'Freifunk.net'), + '.', + E('br'), + _('If you are interested in our project then contact the local community') + ' ', + E('a', { 'href': url }, community), + '.' + ]), + E('p', {}, [ + E('strong', _('Notice')), + ': ', + _('Internet access depends on technical and organisational conditions and may or may not work for you.') + ]) + ]); + } else { + defaultContent = ''; + } + return E([], {}, [ + defaultContent, + E(userText) + ]); } }) \ No newline at end of file diff --git a/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/frontend/map/frame.js b/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/frontend/map/frame.js new file mode 100644 index 0000000000000000000000000000000000000000..55f39cd85a700e34ff33496bc43df393e132b4ef --- /dev/null +++ b/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/frontend/map/frame.js @@ -0,0 +1,51 @@ +'use strict'; +'require uci'; +'require view'; + +return view.extend({ + handleSave: null, + handleReset: null, + handleSaveApply: null, + load: () => { + return Promise.all([ + uci.load('olsrd').then(() => { + return uci.sections('olsrd', 'LoadPlugin'); + }) + ]) + }, + render: (data) => { + let hasLatLon = false; + data[0].forEach(section => { + if (section.library === 'olsrd_nameservice') { + let latlonFile = uci.get('olsrd', section['.name'], 'latlon_file'); + if (latlonFile != null) hasLatLon = true; + } + }); + if (hasLatLon) { + return E([], {}, [ + E('script', {}, ['function ffmapinit() {console.log("ach")}']), + E('iframe', {'id': 'mapframe', 'style': 'width:100%; height:640px; border:none', 'src': L.resource('freifunk-map/map.htm')}), + E('h2', _('Legend')), + E('ul', {}, [ + E('li', {}, [E('strong', {}, E('span', {'style': 'color:#00cc00'}, _('Green'))), ': ' + _('Very good (ETX < 2)')]), + E('li', {}, [E('strong', {}, E('span', {'style': 'color:#ffcb05'}, _('Yellow'))), ': ' + _('Good (2 < ETX < 4)')]), + E('li', {}, [E('strong', {}, E('span', {'style': 'color:#ff6600'}, _('Orange'))), ': ' + _('Still usable (4 < ETX < 10)')]), + E('li', {}, [E('strong', {}, E('span', {'style': 'color:#bb3333'}, _('Red'))), ': ' + _('Bad (ETX > 10)')]), + ]) + ]); + } else { + return E([], {}, [ + E('h2', _('Map Error')), + E('p', _('The OLSRd service is not configured to capture position data from the network.
\ + Please make sure that the nameservice plugin is properly configured and that the latlon_file option is enabled.')) + ]) + }; + } +}) + +/* + +<% if has_latlon then %> + + + */ diff --git a/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/frontend/public_status.js b/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/frontend/public_status.js index 617cc9b04d86ca9de826b2891b8986c6a3e0ed09..f56d8612ada1c08a68238127cc521b297f0c2394 100644 --- a/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/frontend/public_status.js +++ b/modules/luci-mod-freifunk/htdocs/luci-static/resources/view/freifunk/frontend/public_status.js @@ -131,7 +131,7 @@ return view.extend({ E('div', { 'class': 'cbi-map' }, [ E('h2', {}, _('Wireless Overview')), E('fieldset', {'class': 'cbi-section'}, [ - E('table', { 'id': 'wirelessTable' }, [ + E('table', { 'id': 'wirelessTable', 'width': '100%' }, [ E('tr', { 'class': 'tr table-titles' }, [ E('td', { 'class': 'th' }, _('Signal')), E('td', { 'class': 'th' }, _('Bitrate')), diff --git a/modules/luci-mod-freifunk/luasrc/controller/freifunk/freifunk.lua b/modules/luci-mod-freifunk/luasrc/controller/freifunk/freifunk.lua index 3cfbba984c3db1942b4f2b15463f908918d29f5b..8f498979767c85d205427f455d4d1caf114c003e 100644 --- a/modules/luci-mod-freifunk/luasrc/controller/freifunk/freifunk.lua +++ b/modules/luci-mod-freifunk/luasrc/controller/freifunk/freifunk.lua @@ -4,32 +4,8 @@ module("luci.controller.freifunk.freifunk", package.seeall) function index() - local uci = require "luci.model.uci".cursor() local page - -- Frontend - page = node() - page.lock = true - page.target = alias("freifunk") - page.subindex = true - page.index = false - - page = node("freifunk") - page.title = _("Freifunk") - page.target = alias("freifunk", "index") - page.order = 5 - page.setuser = "nobody" - page.setgroup = "nogroup" - page.i18n = "freifunk" - page.index = true - - page = node("freifunk", "index") - page.target = template("freifunk/index") - page.title = _("Overview") - page.order = 10 - page.indexignore = true - - if nixio.fs.access("/usr/sbin/luci-splash") then assign({"freifunk", "status", "splash"}, {"splash", "publicstatus"}, _("Splash"), 40) end @@ -44,11 +20,7 @@ function index() end -- backend - -- assign({"mini", "freifunk"}, {"admin", "freifunk"}, _("Freifunk"), 5) - -- entry({"admin", "freifunk"}, alias("admin", "freifunk", "index"), _("Freifunk"), 5) - - entry({"freifunk", "map"}, template("freifunk-map/frame"), _("Map"), 50) - entry({"freifunk", "map", "content"}, template("freifunk-map/map"), nil, 51) + assign({"mini", "freifunk"}, {"admin", "freifunk"}, _("Freifunk"), 5) end function zeroes() diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm deleted file mode 100644 index bd936ac705ae69d6bb614877a9a17b98eb6c5e2d..0000000000000000000000000000000000000000 --- a/modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm +++ /dev/null @@ -1,29 +0,0 @@ -<%+header%> - -<% - local has_latlon = false - local uci = require "luci.model.uci".cursor() - uci:foreach("olsrd", "LoadPlugin", function(s) - if s.library == "olsrd_nameservice" and s.latlon_file then - has_latlon = true - end - end) -%> - -<% if has_latlon then %> - -

<%:Legend%>:

- - -<% else %> -

<%:Map Error%>

-

<%_The OLSRd service is not configured to capture position data from the network.
- Please make sure that the nameservice plugin is properly configured and that the latlon_file option is enabled.%>

-<% end %> -<%+footer%> - diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk-map/map.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk-map/map.htm deleted file mode 100644 index f5e0595b9604174418e206d2d38f393ff9a62fe8..0000000000000000000000000000000000000000 --- a/modules/luci-mod-freifunk/luasrc/view/freifunk-map/map.htm +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - Map - - - -
- - - diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm deleted file mode 100644 index a3f079716cb9273ff3733e1c52a2d3272ed749fc..0000000000000000000000000000000000000000 --- a/modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm +++ /dev/null @@ -1,44 +0,0 @@ -<%+header%> -<% -local uci = require "luci.model.uci".cursor() -local nickname = uci:get("freifunk", "contact", "nickname") or "" -local name = uci:get("freifunk", "contact", "name") or "" -local mail = uci:get("freifunk", "contact", "mail") or "" -local contacturl = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "freifunk", "contact") -local hostname = uci:get_first ("system", "system", "hostname") -local latitude = uci:get_first ("system", "system", "latitude") -local longitude = uci:get_first ("system", "system", "longitude") -local location = uci:get_first ("system", "system", "location") -local basicsurl = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "freifunk", "basics") -%> - -

<%:Freifunk Overview%>

- -<%:These pages will assist you in setting up your router for Freifunk or similar wireless community networks.%> -

- -<% if not (hostname and latitude and longitude and location) then%> -

- <%:Basic settings are incomplete. Please go to%> <%:Basic settings%> <%:and fill out all required fields.%> -
-<%end%> -

- -<% if not (nickname and name and mail) then%> -

- <%:Contact information is incomplete. Please go to%> <%:Contact%> <%:and fill out all required fields.%> -

-

-<%end%> - -<% uci:foreach("wireless", "wifi-device", function(section) - local device = section[".name"] - local url = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "network", "wireless") - if section.diversity ~= "0" and section.disabled ~= "1" and section.type ~= "mac80211" then - print('
' .. translate("Diversity is enabled for device") .. ' ' .. section[".name"] .. '. ' - .. translate("Go to") .. ' ' .. translate("wireless settings") .. ' ' .. - translate("to disable it.") .. '

') - end -end) %> - -<%+footer%> diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm deleted file mode 100644 index ff9b7dd07195d4d792956377ae4218a4fe5b038e..0000000000000000000000000000000000000000 --- a/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm +++ /dev/null @@ -1,93 +0,0 @@ -<%# - Copyright 2008 Steven Barth - Copyright 2008 Jo-Philipp Wich - Licensed to the public under the Apache License 2.0. --%> - -<% -local uci = require "luci.model.uci".cursor() -local http = require "luci.http" - -local webAppRoot = http.getenv("PATH_INFO") == nil -local redirectPage = uci:get("freifunk", "luci", "redirect_landingpage") or "" -local redirectUrl = uci:get("freifunk", "luci", "redirect_landingurl") or "" - -if (webAppRoot and redirectPage ~= "") then - local url = luci.dispatcher.build_url(redirectPage) - http.redirect(url) -end -if (webAppRoot and redirectUrl ~= "") then - http.redirect(redirectUrl) -end -%> - -<%+header%> - -<% -local tpl = require "luci.template" -local fs = require "nixio.fs" - -local community = uci:get("freifunk", "community", "name") or "Freifunk" -local DefaultText = uci:get("freifunk", "community", "DefaultText") or "" -local nickname = uci:get("freifunk", "contact", "nickname") or "No Nickname set" - -local co = "profile_" .. community ---local community = uci:get_first(co, "community", "name") or "Freifunk" -local url = uci:get_first(co, "community", "homepage") or "http://www.freifunk.net" - - -local usertext = fs.readfile("/www/luci-static/index_user.html") - -if DefaultText ~= "disabled" then - - defaulttext = '

'.. - (translate("Hello and welcome in the network of")).. - ' '.. - (community or "Freifunk Deutschland").. - '!

'.. - translate("We are an initiative to establish a free, independent and open wireless mesh network.").. - '
'.. - translate("This is the access point").. - ' '.. - luci.sys.hostname().. - '. '.. - translate("It is operated by").. - ' '.. - (nickname or translate("Please set your contact information")).. - '.

'.. - translate("You can find further information about the global Freifunk initiative at").. - ' Freifunk.net.
'.. - translate("If you are interested in our project then contact the local community").. - ' '..community..'.

'.. - translate("Notice").. - ': '.. - translate("Internet access depends on technical and organisational conditions and may or may not work for you.").. - '

' -end -%> - -<%=defaulttext%> -<%=usertext%> - -<% --- add custom widgets from view/freifunk/widgets -local widgets = {} -local dir = "/usr/lib/lua/luci/view/freifunk/widgets" - -uci:foreach("freifunk-widgets", "widget", - function(s) - if s.enabled == "1" then - table.insert(widgets, s) - end - end) - -for k, v in ipairs(widgets) do - if v['template'] and fs.access(dir .. "/" .. v['template'] .. "/main.htm") then - tpl.render("freifunk/widgets/" .. v['template'] .. "/main", { data = v }) - end -end - -%> -<%+footer%> diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk/public_status.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk/public_status.htm deleted file mode 100644 index a7445ef6806dbf775bf62a851742ea52d553a18f..0000000000000000000000000000000000000000 --- a/modules/luci-mod-freifunk/luasrc/view/freifunk/public_status.htm +++ /dev/null @@ -1,221 +0,0 @@ -<% -local utl = require "luci.util" -local sys = require "luci.sys" -local twa = require "luci.tools.webadmin" -local ip = require "luci.ip" - --- System - -local sysinfo = utl.ubus("system", "info") or { } -local boardinfo = utl.ubus("system", "board") or { } - -local loads = sysinfo.load or { 0, 0, 0 } -local meminfo = sysinfo.memory or { - total = 0, - free = 0, - buffered = 0, - shared = 0 -} - -local uptime = twa.date_format(sysinfo.uptime or 0) -local time = os.date("%a, %d %b %Y, %H:%M:%S") -local load = string.format("%.2f, %.2f, %.2f", loads[1] / 65535.0, loads[2] / 65535.0, loads[3] / 65535.0) - -local mem = string.format( - "%.2f MB (%.2f %s, %.2f %s, %.2f %s)", - meminfo.total / 1024 / 1024, - (meminfo.total - meminfo.free) / 1024 / 1024, - tostring(i18n.translate("used")), - meminfo.free / 1024 / 1024, - tostring(i18n.translate("free")), - meminfo.buffered / 1024 / 1024, - tostring(i18n.translate("buffered")) -) - -local interval = 5 - --- wireless -local ntm = require "luci.model.network".init() -local devices = ntm:get_wifidevs() -local netlist = { } -local netdevs = { } -local dev -for _, dev in ipairs(devices) do - local net - for _, net in ipairs(dev:get_wifinets()) do - netlist[#netlist+1] = net:ifname() - netdevs[net:ifname()] = dev:name() - end -end -local has_iwinfo = pcall(require, "iwinfo") - - --- Find default routes - -local _, r, def4, def6 - -for _, r in ipairs(ip.routes({ type = 1, dest_exact = "0.0.0.0/0" })) do - def4 = { - gateway = r.gw:string(), - dest = r.dest:string(), - dev = r.dev, - metr = r.metric or 0 - } - break -end - -for _, r in ipairs(ip.routes({ type = 1, dest_exact = "::/0" })) do - def6 = { - gateway = r.gw:string(), - dest = r.dest:string(), - dev = r.dev, - metr = r.metric or 0 - } - break -end - - -if luci.http.formvalue("status") == "1" then - local rv = { } - for dev in pairs(netdevs) do - local j = { id = dev } - local iw = luci.sys.wifi.getiwinfo(dev) - if iw then - local f - for _, f in ipairs({ - "channel", "txpower", "bitrate", "signal", "noise", - "quality", "quality_max", "mode", "ssid", "bssid", "encryption", "ifname" - }) do - j[f] = iw[f] - end - end - rv[#rv+1] = j - end - - - rv[#rv+1] = { - time = time, - uptime = uptime, - load = load, - mem = mem, - defroutev4 = def4, - defroutev6 = def6 - } - - luci.http.prepare_content("application/json") - luci.http.write_json(rv) - return -end --%> - -<%+header%> - - - - -
-

<%:System%>

-
-
<%=boardinfo.system or "?"%>
-
<%=boardinfo.model or "?"%>
-
<%=load%>
-
<%=mem%>
-
<%=time%>
-
<%=uptime%>
-
-
- -
-

<%:Default routes%>

-
-
- -<% if not def4 and not def6 then %> - <%:No default routes known.%> -<%else%> -
-
-
<%:Network%>
-
<%:Interface%>
-
<%:Gateway%>
-
<%:Metric%>
-
- - <% if def4 then %> -
-
<%=def4.dest%>
-
<%=def4.dev%>
-
<%=def4.gateway%>
-
<%=def4.metr%>
-
- - <% end - if def6 then %> - -
-
<%=def6.dest%>
-
<%=def6.dev%>
-
<%=def6.gateway%>
-
<%=def6.metr%>
-
- - <% end %> - -
-<% end %> -
-
-
-<%+footer%> diff --git a/modules/luci-mod-freifunk/root/usr/libexec/rpcd/ffmap b/modules/luci-mod-freifunk/root/usr/libexec/rpcd/ffmap new file mode 100755 index 0000000000000000000000000000000000000000..3690161351dc33f5d42420c3cecfe620388f6353 --- /dev/null +++ b/modules/luci-mod-freifunk/root/usr/libexec/rpcd/ffmap @@ -0,0 +1,44 @@ +#!/bin/sh + +. /usr/share/libubox/jshn.sh +. /lib/functions.sh + +LATLONFILE="-1" + +find_service_config() { + local cfg="$1" + + config_get library "$cfg" library + if [ "$library" != "olsrd_nameservice" ]; then + return 1 + fi + config_get latlon_file "$cfg" latlon_file + LATLONFILE=$latlon_file +} + +load_services() { + config_load "olsrd" + config_foreach find_service_config LoadPlugin + local services_configured=0 + if [ "$LATLONFILE" != "-1" ]; then + json_init + json_add_string "data" "$(cat $LATLONFILE)" + json_dump + return + fi + return 1 +} + +case "$1" in +list) + # List method must return the list of methods and parameters that the daemon will accept. Only methods listed here will available to call. + echo '{ "getdata": { } }' + ;; +call) + case "$2" in + getdata) + load_services + ;; + esac + ;; +esac diff --git a/modules/luci-mod-freifunk/root/usr/share/luci/menu.d/luci-mod-freifunk-backend.json b/modules/luci-mod-freifunk/root/usr/share/luci/menu.d/luci-mod-freifunk-backend.json index 16f0f5b4f124519c820c84995b7ba9dbdc40cf14..a37c49bef6f4468bd85f68fe5039f03cf30433bf 100644 --- a/modules/luci-mod-freifunk/root/usr/share/luci/menu.d/luci-mod-freifunk-backend.json +++ b/modules/luci-mod-freifunk/root/usr/share/luci/menu.d/luci-mod-freifunk-backend.json @@ -10,6 +10,14 @@ "recurse": true } }, + "admin/freifunk/adminindex": { + "title": "Overview", + "order": 5, + "action": { + "type": "view", + "path": "freifunk/admin/index" + } + }, "admin/freifunk/basics": { "title": "Basic Settings", "order": 10, diff --git a/modules/luci-mod-freifunk/root/usr/share/luci/menu.d/luci-mod-freifunk-frontend.json b/modules/luci-mod-freifunk/root/usr/share/luci/menu.d/luci-mod-freifunk-frontend.json index 636b3835f29744165bbb149a1d786eea6614717e..fff41727ccac9d844b0ef77355d26bb22805d501 100644 --- a/modules/luci-mod-freifunk/root/usr/share/luci/menu.d/luci-mod-freifunk-frontend.json +++ b/modules/luci-mod-freifunk/root/usr/share/luci/menu.d/luci-mod-freifunk-frontend.json @@ -1,21 +1,21 @@ { - "freifunk1": { - "title": "Freifunk1", + "freifunk": { + "title": "Freifunk", "order": 5, "action": { "type": "firstchild", "recurse": true } }, - "freifunk1/index": { - "title": "Freifunk1", + "freifunk/index": { + "title": "Overview", "order": 10, "action": { "type": "view", "path": "freifunk/frontend/index" } }, - "freifunk1/contact": { + "freifunk/contact": { "title": "Contact", "order": 15, "action": { @@ -23,34 +23,49 @@ "path": "freifunk/frontend/contact" } }, - "freifunk1/status.json": { + "freifunk/status.json": { "action": { "type": "call", "module": "luci.controller.freifunk.freifunk", "function": "jsonstatus" } }, - "freifunk1/status": { + "freifunk/status": { "title": "Status", "order": 20, "action": { "type": "firstchild" } }, - "freifunk1/status/status": { + "freifunk/status/status": { "title": "Status", - "order": 20, + "order": 25, "action": { "type": "view", "path": "freifunk/frontend/public_status" } }, - "freifunk1/status/zeroes": { + "freifunk/status/zeroes": { "title": "Testdownload", "action": { "type": "call", "module": "luci.controller.freifunk.freifunk", "function": "zeroes" } + }, + "freifunk/map": { + "title": "Map", + "order": 50, + "action": { + "type": "firstchild" + } + }, + "freifunk/map/map": { + "title": "Map", + "order": 51, + "action": { + "type": "view", + "path": "freifunk/frontend/map/frame" + } } } \ No newline at end of file diff --git a/modules/luci-mod-freifunk/root/usr/share/rpcd/acl.d/luci-mod-freifunk-unauthenticated.json b/modules/luci-mod-freifunk/root/usr/share/rpcd/acl.d/luci-mod-freifunk-unauthenticated.json index c0d51ce937bcfd291a0c9593f43a012da9f45486..c6de245c705410d23fd068a25f8f52b29f5b5e89 100644 --- a/modules/luci-mod-freifunk/root/usr/share/rpcd/acl.d/luci-mod-freifunk-unauthenticated.json +++ b/modules/luci-mod-freifunk/root/usr/share/rpcd/acl.d/luci-mod-freifunk-unauthenticated.json @@ -11,14 +11,25 @@ ], "system": [ "info", "board" - ] + ], + "file": [ + "read" + ], + "ffmap": [ + "getdata" + ] }, "uci": [ "freifunk", "network", + "olsrd", + "profile_*", "system", "wireless" - ] + ], + "file" : { + "/www/luci-static/index_user.html": ["read"] + } } } } \ No newline at end of file diff --git a/modules/luci-mod-freifunk/root/usr/share/rpcd/acl.d/luci-mod-freifunk.json b/modules/luci-mod-freifunk/root/usr/share/rpcd/acl.d/luci-mod-freifunk.json index 25fe1a083054fbcad4eca09f4e675ac4f9f8703a..68000564aead2f0c6a997abd948814427e45a797 100644 --- a/modules/luci-mod-freifunk/root/usr/share/rpcd/acl.d/luci-mod-freifunk.json +++ b/modules/luci-mod-freifunk/root/usr/share/rpcd/acl.d/luci-mod-freifunk.json @@ -2,7 +2,7 @@ "luci-mod-freifunk": { "description": "Provdies access to freifunk", "read": { - "uci": [ "freifunk", "profile_*" ], + "uci": [ "freifunk", "profile_*", "system" ], "file" : { "/etc/config/profile_*": ["read"], "/www/luci-static/index_user.html": ["read"]