diff options
author | Sven Roederer <freifunk@it-solutions.geroedel.de> | 2019-02-03 14:13:35 +0100 |
---|---|---|
committer | Sven Roederer <freifunk@it-solutions.geroedel.de> | 2019-02-13 21:23:34 +0100 |
commit | 4654ba92c3999d84b08211f05d2ccb5ea9da731b (patch) | |
tree | 06cedf8e8badc0ce584d8bd5e97fab7476c81549 /modules/luci-mod-freifunk/luasrc/model | |
parent | eda8f02dac3caa4d0f52cd1e860d7a392c295df3 (diff) |
treewide: move freifunk-related packages to separate repo
Even Freifunk was one of the major factory to create the LuCI-system, it's
now only a very small part of LuCI. LuCI has become a much bigger thing
and it seems that it's time to move the packages only relating to Freifunk
into it's own feed.
On the mailinglist it was discussed [1] and a repo below the general
Freifunk team on github was created.
This commit removes all packages that will be hosted in the new repo [2]
1 - http://lists.freifunk.net/pipermail/wlannews-freifunk.net/2019-February/004818.html
2 - https://github.com/freifunk/openwrt-packages
Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
Diffstat (limited to 'modules/luci-mod-freifunk/luasrc/model')
5 files changed, 0 insertions, 244 deletions
diff --git a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua deleted file mode 100644 index eb0b49b11c..0000000000 --- a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua +++ /dev/null @@ -1,92 +0,0 @@ --- Copyright 2008 Steven Barth <steven@midlink.org> --- Copyright 2011 Manuel Munz <freifunk at somakoma de> --- Licensed to the public under the Apache License 2.0. - -local fs = require "nixio.fs" -local util = require "luci.util" -local uci = require "luci.model.uci".cursor() -local profiles = "/etc/config/profile_*" - -m = Map("freifunk", translate ("Community")) -c = m:section(NamedSection, "community", "public", nil, translate("These are the basic settings for your local wireless community. These settings define the default values for the wizard and DO NOT affect the actual configuration of the router.")) - -community = c:option(ListValue, "name", translate ("Community")) -community.rmempty = false - -local profile -for profile in fs.glob(profiles) do - local name = uci:get_first(string.gsub(profile, "/etc/config/", ""), "community", "name") or "?" - community:value(string.gsub(profile, "/etc/config/profile_", ""), name) -end - - -n = Map("system", translate("Basic system settings")) -function n.on_after_commit(self) - luci.http.redirect(luci.dispatcher.build_url("admin", "freifunk", "basics")) -end - -b = n:section(TypedSection, "system") -b.anonymous = true - -hn = b:option(Value, "hostname", translate("Hostname")) -hn.rmempty = false -hn.datatype = "hostname" - -loc = b:option(Value, "location", translate("Location")) -loc.rmempty = false -loc.datatype = "minlength(1)" - -lat = b:option(Value, "latitude", translate("Latitude"), translate("e.g.") .. " 48.12345") -lat.datatype = "float" -lat.rmempty = false - -lon = b:option(Value, "longitude", translate("Longitude"), translate("e.g.") .. " 10.12345") -lon.datatype = "float" -lon.rmempty = false - ---[[ -Opens an OpenStreetMap iframe or popup -Makes use of resources/OSMLatLon.htm and htdocs/resources/osm.js -]]-- - -local class = util.class -local ff = uci:get("freifunk", "community", "name") or "" -local co = "profile_" .. ff - -local deflat = uci:get_first("system", "system", "latitude") or uci:get_first(co, "community", "latitude") or 52 -local deflon = uci:get_first("system", "system", "longitude") or uci:get_first(co, "community", "longitude") or 10 -local zoom = 12 -if ( deflat == 52 and deflon == 10 ) then - zoom = 4 -end - -OpenStreetMapLonLat = luci.util.class(AbstractValue) - -function OpenStreetMapLonLat.__init__(self, ...) - AbstractValue.__init__(self, ...) - self.template = "cbi/osmll_value" - self.latfield = nil - self.lonfield = nil - self.centerlat = "" - self.centerlon = "" - self.zoom = "0" - self.width = "100%" --popups will ignore the %-symbol, "100%" is interpreted as "100" - self.height = "600" - self.popup = false - self.displaytext="OpenStreetMap" --text on button, that loads and displays the OSMap - self.hidetext="X" -- text on button, that hides OSMap -end - - osm = b:option(OpenStreetMapLonLat, "latlon", translate("Find your coordinates with OpenStreetMap"), translate("Select your location with a mouse click on the map. The map will only show up if you are connected to the Internet.")) - osm.latfield = "latitude" - osm.lonfield = "longitude" - osm.centerlat = uci:get_first("system", "system", "latitude") or deflat - osm.centerlon = uci:get_first("system", "system", "longitude") or deflon - osm.zoom = zoom - osm.width = "100%" - osm.height = "600" - osm.popup = false - osm.displaytext=translate("Show OpenStreetMap") - osm.hidetext=translate("Hide OpenStreetMap") - -return m, n diff --git a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/contact.lua b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/contact.lua deleted file mode 100644 index 0a6995b266..0000000000 --- a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/contact.lua +++ /dev/null @@ -1,16 +0,0 @@ --- Copyright 2008 Steven Barth <steven@midlink.org> --- Copyright 2011 Manuel Munz <freifunk at somakoma dot de> --- Licensed to the public under the Apache License 2.0. - -m = Map("freifunk", translate("Contact"), translate("Please fill in your contact details below.")) - -c = m:section(NamedSection, "contact", "public", "") - -c:option(Value, "nickname", translate("Nickname")) -c:option(Value, "name", translate("Realname")) -c:option(DynamicList, "homepage", translate("Homepage")) -c:option(Value, "mail", translate("E-Mail")) -c:option(Value, "phone", translate("Phone")) -c:option(TextValue, "note", translate("Notice")).rows = 10 - -return m diff --git a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/profile.lua b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/profile.lua deleted file mode 100644 index de7caf4c18..0000000000 --- a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/profile.lua +++ /dev/null @@ -1,74 +0,0 @@ --- Copyright 2011-2012 Manuel Munz <freifunk at somakoma dot de> --- Licensed to the public under the Apache License 2.0. - -local uci = require "luci.model.uci".cursor() -local ipkg = require "luci.model.ipkg" -local community = uci:get("freifunk", "community", "name") - -if community == nil then - luci.http.redirect(luci.dispatcher.build_url("admin", "freifunk", "profile_error")) - return -else - community = "profile_" .. community - m = Map(community, translate("Community settings"), translate("These are the settings of your local community.")) - c = m:section(NamedSection, "profile", "community") - - local name = c:option(Value, "name", "Name") - name.rmempty = false - - local homepage = c:option(Value, "homepage", translate("Homepage")) - - local cc = c:option(Value, "country", translate("Country code")) - function cc.cfgvalue(self, section) - return uci:get(community, "wifi_device", "country") - end - function cc.write(self, sec, value) - if value then - uci:set(community, "wifi_device", "country", value) - uci:save(community) - end - end - - local ssid = c:option(Value, "ssid", translate("ESSID")) - ssid.rmempty = false - - local prefix = c:option(Value, "mesh_network", translate("Mesh prefix")) - prefix.datatype = "ip4addr" - prefix.rmempty = false - - local splash_net = c:option(Value, "splash_network", translate("Network for client DHCP addresses")) - splash_net.datatype = "ip4addr" - splash_net.rmempty = false - - local splash_prefix = c:option(Value, "splash_prefix", translate("Client network size")) - splash_prefix.datatype = "range(0,32)" - splash_prefix.rmempty = false - - local ipv6 = c:option(Flag, "ipv6", translate("Enable IPv6")) - ipv6.rmempty = true - - local ipv6_config = c:option(ListValue, "ipv6_config", translate("IPv6 Config")) - ipv6_config:depends("ipv6", 1) - ipv6_config:value("static") - if ipkg.installed ("auto-ipv6-ib") then - ipv6_config:value("auto-ipv6-random") - ipv6_config:value("auto-ipv6-fromv4") - end - ipv6_config.rmempty = true - - local ipv6_prefix = c:option(Value, "ipv6_prefix", translate("IPv6 Prefix"), translate("IPv6 network in CIDR notation.")) - ipv6_prefix:depends("ipv6", 1) - ipv6_prefix.datatype = "ip6addr" - ipv6_prefix.rmempty = true - - local vap = c:option(Flag, "vap", translate("VAP"), translate("Enable a virtual access point (VAP) by default if possible.")) - vap.rmempty = true - - local lat = c:option(Value, "latitude", translate("Latitude")) - lat.datatype = "range(-180, 180)" - lat.rmempty = false - - local lon = c:option(Value, "longitude", translate("Longitude")) - lon.rmempty = false - return m -end diff --git a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/profile_expert.lua b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/profile_expert.lua deleted file mode 100644 index 22554a66fc..0000000000 --- a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/profile_expert.lua +++ /dev/null @@ -1,32 +0,0 @@ --- Copyright 2011 Manuel Munz <freifunk at somakoma dot de> --- Licensed to the public under the Apache License 2.0. - -local fs = require "nixio.fs" -local uci = require "luci.model.uci".cursor() -local community = uci:get("freifunk", "community", "name") - -if community == nil then - luci.http.redirect(luci.dispatcher.build_url("admin", "freifunk", "profile_error")) - return -else - community = "/etc/config/profile_" .. community - f = SimpleForm("community", translate("Community profile"), translate("You can manually edit the selected community profile here.")) - - t = f:field(TextValue, "cop") - t.rmempty = true - t.rows = 30 - function t.cfgvalue() - return fs.readfile(community) or "" - end - - function f.handle(self, state, data) - if state == FORM_VALID then - if data.cop then - fs.writefile(community, data.cop:gsub("\r\n", "\n")) - end - end - return true - end - return f -end - diff --git a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/user_index.lua b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/user_index.lua deleted file mode 100644 index fe1d8fe7ed..0000000000 --- a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/user_index.lua +++ /dev/null @@ -1,30 +0,0 @@ -local fs = require "nixio.fs" -local file = "/www/luci-static/index_user.html" - -m = Map("freifunk", translate("Edit index page"), translate("You can display additional content on the public index page by inserting valid XHTML in the form below.<br />Headlines should be enclosed between <h2> and </h2>.")) - -s = m:section(NamedSection, "community", "public", "") -s.anonymous = true - -di = s:option(Flag, "DefaultText", translate("Disable default content"), translate("If selected then the default content element is not shown.")) -di.enabled = "disabled" -di.disabled = "enabled" -di.rmempty = false - -t = s:option(TextValue, "_text") -t.rmempty = true -t.rows = 20 - -function t.cfgvalue() - return fs.readfile(file) or "" -end - -function t.write(self, section, value) - return fs.writefile(file, value) -end - -function t.remove(self, section) - return fs.unlink(file) -end - -return m |