Browse Source

ffho-status-page: remove community specific stuff

The link to the map can now be specified within site.conf.
Karsten Böddeker 8 years ago
parent
commit
3ffb82c1cd

+ 8 - 1
ffho/ffho-status-page/ReadMe.md

@@ -1,4 +1,11 @@
 ffho-status-page
 ================
 
-This is a customized version of the *old* ``gluon-status-page``.
+This is a customized version of the *old* ``gluon-status-page``. Link to the map
+can be specified within the ``site.conf``.
+
+site.conf
+---------
+
+status_page.location_link : optional
+    - ``'https://map.hochstift.freifunk.net/#!v:m;n:'`` nodeid will be added at the end.

+ 8 - 3
ffho/ffho-status-page/files/lib/gluon/status-page/www/cgi-bin/status

@@ -41,14 +41,19 @@ for k, v in data:gmatch('([^\n:]+):%s*(%d+) kB') do
 end
 
 function location()
+  local text = 'none'
   local locationid = uci:get_first('gluon-node-info', 'location')
   if locationid then
     local location = uci:get_all('gluon-node-info', locationid)
     if uci:get_bool('gluon-node-info', locationid, 'share_location') and location.latitude and location.longitude then
-      return "<a href=https://map.hochstift.freifunk.net/#!v:m;n:" .. nodeid .. ">" .. location.latitude .. ", " .. location.longitude .. "</a>"
+      text = location.latitude .. ', ' .. location.longitude
     end
   end
-  return '<a href=https://map.hochstift.freifunk.net/#!v:m;n:' .. nodeid .. '>none</a>'
+
+  if (site.status_page or {}).location_link then
+    text = '<a href=' .. site.status_page.location_link .. nodeid .. '>' .. text .. '</a>'
+  end
+  return text
 end
 
 function escape_html(s)
@@ -99,7 +104,7 @@ io.write("<body>")
 io.write("<h1>" .. escape_html(hostname) .. "</h1>")
 io.write("<pre>")
 
-io.write("Region:      " .. escape_html(site.site_name) .. "\n")
+io.write("Community:   " .. escape_html(site.site_name) .. "\n")
 io.write("Model:       " .. escape_html(model) .. "\n")
 io.write("Firmware:    " .. escape_html(release) .. "\n")
 io.write("MAC:         " .. escape_html(primary_mac) .. "\n")