Browse Source

replace ffho-luci-autoupdater-wifi-fallback by ffho-web-autoupdater

Karsten Böddeker 6 years ago
parent
commit
6ceec458ea

+ 0 - 6
ffho/ffho-luci-autoupdater-wifi-fallback/ReadMe.md

@@ -1,6 +0,0 @@
-ffho-luci-autoupdater-wifi-fallback
-===================================
-
-Luci module for `gluon-autoupdater` and `ffho-autoupdater-wifi-fallback`,
-based on `gluon-luci-autoupdater`. In addition to `gluon-luci-autoupdater`
-you can also enable or disable wifi-fallback-mode.

+ 0 - 19
ffho/ffho-luci-autoupdater-wifi-fallback/luasrc/usr/lib/lua/luci/controller/admin/autoupdater.lua

@@ -1,19 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2013 Nils Schneider <nils@nilsschneider.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-module("luci.controller.admin.autoupdater", package.seeall)
-
-function index()
-        entry({"admin", "autoupdater"}, cbi("admin/autoupdater"), _("Automatic updates"), 80)
-end

+ 0 - 39
ffho/ffho-luci-autoupdater-wifi-fallback/luasrc/usr/lib/lua/luci/model/cbi/admin/autoupdater.lua

@@ -1,39 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2013 Nils Schneider <nils@nilsschneider.net>
-Copyright 2016 Karsten Böddeker <freifunk@kb-light.de>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-m = Map("autoupdater", translate("Automatic updates"))
-
-s = m:section(TypedSection, "autoupdater", nil)
-s.addremove = false
-s.anonymous = true
-
-s:option(Flag, "enabled", translate("Enable"))
-f = s:option(ListValue, "branch", translate("Branch"))
-
-uci.cursor():foreach("autoupdater", "branch", function (section) f:value(section[".name"]) end)
-
-m2 = Map("autoupdater-wifi-fallback", translate("Wifi fallback updates"))
-
-s2 = m2:section(TypedSection, "autoupdater-wifi-fallback", nil)
-s2.addremove = false
-s2.anonymous = true
-
-s2:option(Flag, "enabled", translate("Enable"))
-
-local c = Compound(m, m2)
-c.pageaction = false
-c.template = "cbi/simpleform"
-return c
-

+ 12 - 8
ffho/ffho-luci-autoupdater-wifi-fallback/Makefile → ffho/ffho-web-autoupdater/Makefile

@@ -1,6 +1,9 @@
+# Copyright (C) 2013 Nils Schneider <nils at nilsschneider.net>
+# This is free software, licensed under the Apache 2.0 license.
+
 include $(TOPDIR)/rules.mk
 
-PKG_NAME:=ffho-luci-autoupdater-wifi-fallback
+PKG_NAME:=ffho-web-autoupdater
 PKG_VERSION:=1
 PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG_VERSION)
 
@@ -10,11 +13,12 @@ include $(TOPDIR)/../package/gluon.mk
 
 PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
 
-define Package/ffho-luci-autoupdater-wifi-fallback
+
+define Package/ffho-web-autoupdater
   SECTION:=ffho
   CATEGORY:=FFHO
-  TITLE:=Luci module for gluon-autoupdater and ffho-autoupdater-wifi-fallback
-  DEPENDS:=+gluon-luci-admin +gluon-autoupdater +ffho-autoupdater-wifi-fallback
+  TITLE:=gluon-web module for gluon-autoupdater and ffho-autoupdater-wifi-fallback
+  DEPENDS:=+gluon-web-admin +ffho-autoupdater-wifi-fallback
   MAINTAINER:=Freifunk Hochstift <kontakt@hochstift.freifunk.net>
 endef
 
@@ -26,13 +30,13 @@ define Build/Configure
 endef
 
 define Build/Compile
-	$(call GluonBuildI18N,ffho-luci-autoupdater-wifi-fallback,i18n)
+	$(call GluonBuildI18N,gluon-web-autoupdater,i18n)
 	$(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/)
 endef
 
-define Package/ffho-luci-autoupdater-wifi-fallback/install
+define Package/gluon-web-autoupdater/install
 	$(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
-	$(call GluonInstallI18N,ffho-luci-autoupdater-wifi-fallback,$(1))
+	$(call GluonInstallI18N,gluon-web-autoupdater,$(1))
 endef
 
-$(eval $(call BuildPackage,ffho-luci-autoupdater-wifi-fallback))
+$(eval $(call BuildPackage,gluon-web-autoupdater))

+ 6 - 0
ffho/ffho-web-autoupdater/ReadMe.md

@@ -0,0 +1,6 @@
+ffho-web-autoupdater
+====================
+
+Gluon-web module for `gluon-autoupdater` and `ffho-autoupdater-wifi-fallback`,
+based on `gluon-web-autoupdater`. In addition to `gluon-web-autoupdater`
+you can also enable or disable wifi-fallback-mode.

+ 5 - 2
ffho/ffho-luci-autoupdater-wifi-fallback/i18n/de.po → ffho/ffho-web-autoupdater/i18n/de.po

@@ -1,12 +1,12 @@
 msgid ""
 msgstr ""
-"Content-Type: text/plain; charset=UTF-8\n"
 "Project-Id-Version: PACKAGE VERSION\n"
-"PO-Revision-Date: 2016-04-16 01:26+0200\n"
+"PO-Revision-Date: 2017-06-24 23:00+0200\n"
 "Last-Translator:  <freifunk@kb-light.de>\n"
 "Language-Team: German\n"
 "Language: de\n"
 "MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
@@ -16,5 +16,8 @@ msgstr "Automatische Updates"
 msgid "Branch"
 msgstr "Branch"
 
+msgid "Enable"
+msgstr "Aktivieren"
+
 msgid "Wifi fallback updates"
 msgstr "Wifi-Fallback Updates"

+ 3 - 0
ffho/ffho-luci-autoupdater-wifi-fallback/i18n/ffho-luci-autoupdater-wifi-fallback.pot → ffho/ffho-web-autoupdater/i18n/ffho-web-autoupdater.pot

@@ -7,5 +7,8 @@ msgstr ""
 msgid "Branch"
 msgstr ""
 
+msgid "Enable"
+msgstr ""
+
 msgid "Wifi fallback updates"
 msgstr ""

+ 1 - 0
ffho/ffho-web-autoupdater/luasrc/lib/gluon/web/controller/admin/autoupdater.lua

@@ -0,0 +1 @@
+entry({"admin", "autoupdater"}, model("admin/autoupdater"), _("Automatic updates"), 80)

+ 50 - 0
ffho/ffho-web-autoupdater/luasrc/lib/gluon/web/model/admin/autoupdater.lua

@@ -0,0 +1,50 @@
+--[[
+Copyright 2013 Nils Schneider <nils@nilsschneider.net>
+Copyright 2017 Karsten Böddeker <freifunk@kb-light.de>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+]]--
+
+local uci = require('simple-uci').cursor()
+local autoupdater = uci:get_first('autoupdater', 'autoupdater')
+local wifi-fallback = uci:get_first('autoupdater-wifi-fallback', 'autoupdater-wifi-fallback')
+
+local f = Form(translate('Automatic updates'))
+local s = f:section(Section)
+local o
+
+o = s:option(Flag, 'enabled', translate('Enable'))
+o.default = uci:get_bool('autoupdater', autoupdater, 'enabled')
+function o:write(data)
+	uci:set('autoupdater', autoupdater, 'enabled', data)
+end
+
+o = s:option(ListValue, 'branch', translate('Branch'))
+uci:foreach('autoupdater', 'branch',
+	function (section)
+		o:value(section['.name'])
+	end
+)
+o.default = uci:get('autoupdater', autoupdater, 'branch')
+function o:write(data)
+	uci:set('autoupdater', autoupdater, 'branch', data)
+end
+
+local s = f:section(Section, translate('Wifi fallback updates'))
+
+o = s:option(Flag, 'enabled', translate('Enable'))
+o.default = uci:get_bool('autoupdater-wifi-fallback', wifi-fallback, 'enabled')
+function o:write(data)
+	uci:set('autoupdater-wifi-fallback', wifi-fallback, 'enabled', data)
+	uci:commit('autoupdater-wifi-fallback')
+end
+
+function f:write()
+	uci:commit('autoupdater')
+end
+
+return f