Browse Source

new package ffho-luci-ap-timer

Karsten Böddeker 7 years ago
parent
commit
8bd0fcdb28

+ 39 - 0
ffho/ffho-luci-ap-timer/Makefile

@@ -0,0 +1,39 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ffho-luci-ap-timer
+PKG_VERSION:=1
+PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG_VERSION)
+
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
+
+include $(GLUONDIR)/include/package.mk
+
+PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
+
+define Package/ffho-luci-ap-timer
+  SECTION:=ffho
+  CATEGORY:=FFHO
+  TITLE:=Luci module for ap-timer settings
+  DEPENDS:=+gluon-luci-admin
+  MAINTAINER:=Freifunk Hochstift <kontakt@hochstift.freifunk.net>
+  URL:=https://git.c3pb.de/freifunk-pb/ffho-packages
+endef
+
+define Build/Prepare
+	mkdir -p $(PKG_BUILD_DIR)
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+	$(call GluonBuildI18N,ffho-luci-ap-timer,i18n)
+	$(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/)
+endef
+
+define Package/ffho-luci-ap-timer/install
+	$(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
+	$(call GluonInstallI18N,ffho-luci-ap-timer,$(1))
+endef
+
+$(eval $(call BuildPackage,ffho-luci-ap-timer))

+ 4 - 0
ffho/ffho-luci-ap-timer/ReadMe.md

@@ -0,0 +1,4 @@
+ffho-luci-ap-timer
+==================
+
+Luci module for ap-timer settings.

+ 11 - 0
ffho/ffho-luci-ap-timer/i18n/de.po

@@ -0,0 +1,11 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+msgid "You can setup the AP Timer here"
+msgstr "Hier kannst du den AP-Timer konfigurieren"
+
+msgid "per day"
+msgstr "nach Tag"
+
+msgid "Daily"
+msgstr "Täglich"

+ 11 - 0
ffho/ffho-luci-ap-timer/i18n/ffho-luci-ap-timer.pot

@@ -0,0 +1,11 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+msgid "You can setup the AP Timer here"
+msgstr ""
+
+msgid "per day"
+msgstr ""
+
+msgid "Daily"
+msgstr ""

+ 5 - 0
ffho/ffho-luci-ap-timer/luasrc/usr/lib/lua/luci/controller/admin/ap-timer.lua

@@ -0,0 +1,5 @@
+module("luci.controller.admin.ap-timer", package.seeall)
+
+function index()
+        entry({"admin", "ap-timer"}, cbi("admin/ap-timer"), _("AP Timer"), 30)
+end

+ 29 - 0
ffho/ffho-luci-ap-timer/luasrc/usr/lib/lua/luci/model/cbi/admin/ap-timer.lua

@@ -0,0 +1,29 @@
+m = Map('ap-timer', translate('AP Timer'), translate(
+  'You can setup the AP Timer here'))
+m.pageaction = false
+m.template = "admin/expertmode"
+
+s = m:section(NamedSection, 'settings', 'ap-timer', nil)
+s.addremove = false
+s.anonymous = true
+
+o = s:option(Flag, 'enabled', translate('Enabled'))
+o.rmempty = false
+
+o = s:option(ListValue, 'type', translate('Type'))
+o.default = 'day'
+o:value('day', translate('per Day'))
+
+s = m:section(NamedSection, 'all', 'day', 'Daily')
+s.addremove = false
+s.anonymous = true
+
+o = s:option(DynamicList, 'on', translate('ON'))
+o.placeholder = '06:30'
+o.datatype = 'rangelength(5, 5)'
+
+o = s:option(DynamicList, 'off', translate('OFF'))
+o.placeholder = '23:00'
+o.datatype = 'rangelength(5, 5)'
+
+return m