add luci-app-k3screenctrl
This commit is contained in:
parent
dce2dd8b33
commit
6df495760a
49
package/cnsztl/luci-app-k3screenctrl/Makefile
Normal file
49
package/cnsztl/luci-app-k3screenctrl/Makefile
Normal file
@ -0,0 +1,49 @@
|
||||
# Copyright (C) 2018 XiaoShan mivm.cn
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-k3screenctrl
|
||||
PKG_VERSION:=1.1.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=GPLv3
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=Hill <lufanzhong@gmail.com>
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=luci
|
||||
CATEGORY:=LuCI
|
||||
SUBMENU:=3. Applications
|
||||
TITLE:=LuCI Support for k3screenctrl
|
||||
DEPENDS:=@PACKAGE_phicommk3-screenctrl +phicommk3-screenctrl
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
LuCI Support for k3screenctrl.
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(foreach po,$(wildcard ${CURDIR}/files/luci/i18n/*.po), \
|
||||
po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));)
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller
|
||||
$(INSTALL_DATA) ./files/luci/controller/k3screenctrl.lua $(1)/usr/lib/lua/luci/controller/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/k3screenctrl.*.lmo $(1)/usr/lib/lua/luci/i18n/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi
|
||||
$(INSTALL_DATA) ./files/luci/model/cbi/k3screenctrl.lua $(1)/usr/lib/lua/luci/model/cbi/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@ -0,0 +1,10 @@
|
||||
-- Copyright (C) 2018 XiaoShan mivm.cn
|
||||
|
||||
module("luci.controller.k3screenctrl", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/k3screenctrl") then
|
||||
return
|
||||
end
|
||||
entry({"admin","system","k3screenctrl"}, cbi("k3screenctrl"), _("Screen"),60)
|
||||
end
|
||||
Binary file not shown.
@ -0,0 +1,155 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
||||
msgid "Screen"
|
||||
msgstr "屏幕"
|
||||
|
||||
msgid "Customize your device screen"
|
||||
msgstr "自定义你的设备屏幕"
|
||||
|
||||
msgid "General Setting"
|
||||
msgstr "基本设置"
|
||||
|
||||
msgid "Screen time :"
|
||||
msgstr "亮屏时间:"
|
||||
|
||||
msgid "This time no action, the screen will close."
|
||||
msgstr "这段时间没有操作,屏幕将关闭。"
|
||||
|
||||
msgid "Refresh interval :"
|
||||
msgstr "刷新间隔:"
|
||||
|
||||
msgid "Screen data refresh interval."
|
||||
msgstr "屏幕数据刷新间隔"
|
||||
|
||||
msgid "Hide Wireless password"
|
||||
msgstr "隐藏无线密码"
|
||||
|
||||
msgid "Display CPU temperature"
|
||||
msgstr "显示 CPU 温度"
|
||||
|
||||
msgid "The first page shows the CPU temperature."
|
||||
msgstr "第一页显示 CPU 温度"
|
||||
|
||||
msgid "Test"
|
||||
msgstr "测试"
|
||||
|
||||
msgid "Print info"
|
||||
msgstr "输出信息"
|
||||
|
||||
msgid "Execute k3screenctrl -t and return the result"
|
||||
msgstr "执行 k3screenctrl -t 并返回结果"
|
||||
|
||||
msgid "Output results"
|
||||
msgstr "输出结果"
|
||||
|
||||
msgid "Device customization"
|
||||
msgstr "设备自定义"
|
||||
|
||||
msgid "Customize the fifth page of device information"
|
||||
msgstr "自定义第五页设备信息"
|
||||
|
||||
msgid "Device"
|
||||
msgstr "设备"
|
||||
|
||||
msgid "Icon"
|
||||
msgstr "图标"
|
||||
|
||||
msgid "2 s"
|
||||
msgstr "2 秒"
|
||||
|
||||
msgid "5 s"
|
||||
msgstr "5 秒"
|
||||
|
||||
msgid "10 s"
|
||||
msgstr "10 秒"
|
||||
|
||||
msgid "30 s"
|
||||
msgstr "30 秒"
|
||||
|
||||
msgid "60 s"
|
||||
msgstr "60 秒"
|
||||
|
||||
msgid "5 m"
|
||||
msgstr "5 分"
|
||||
|
||||
msgid "10 m"
|
||||
msgstr "10 分"
|
||||
|
||||
msgid "15 m"
|
||||
msgstr "15 分"
|
||||
|
||||
msgid "30 m"
|
||||
msgstr "30 分"
|
||||
|
||||
msgid "60 m"
|
||||
msgid "60 分"
|
||||
|
||||
msgid "Auto"
|
||||
msgstr "自动"
|
||||
|
||||
msgid "OnePlus"
|
||||
msgstr "一加"
|
||||
|
||||
msgid "Asus"
|
||||
msgstr "华硕"
|
||||
|
||||
msgid "Coolpad"
|
||||
msgstr "酷派"
|
||||
|
||||
msgid "Dell"
|
||||
msgstr "戴尔"
|
||||
|
||||
msgid "Haier"
|
||||
msgstr "海尔"
|
||||
|
||||
msgid "Hasee"
|
||||
msgstr "神舟"
|
||||
|
||||
msgid "Honor"
|
||||
msgid "荣耀"
|
||||
|
||||
msgid "HP"
|
||||
msgstr "惠普"
|
||||
|
||||
msgid "Huawei"
|
||||
msgstr "华为"
|
||||
|
||||
msgid "Apple"
|
||||
msgstr "苹果"
|
||||
|
||||
msgid "Lenovo"
|
||||
msgid "联想"
|
||||
|
||||
msgid "LeEco"
|
||||
msgstr "乐视"
|
||||
|
||||
msgid "Meitu"
|
||||
msgstr "美图"
|
||||
|
||||
msgid "Meizu"
|
||||
msgstr "魅族"
|
||||
|
||||
msgid "Phicomm"
|
||||
msgstr "斐讯"
|
||||
|
||||
msgid "Samsung"
|
||||
msgstr "三星"
|
||||
|
||||
msgid "Smartisan"
|
||||
msgstr "锤子"
|
||||
|
||||
msgid "Sony"
|
||||
msgstr "索尼"
|
||||
|
||||
msgid "TongfangPC"
|
||||
msgstr "清华同方"
|
||||
|
||||
msgid "Microsoft"
|
||||
msgstr "微软"
|
||||
|
||||
msgid "XiaoMi"
|
||||
msgstr "小米"
|
||||
|
||||
msgid "ZTE"
|
||||
msgstr "中兴"
|
||||
@ -0,0 +1,99 @@
|
||||
-- Copyright (C) 2018 XiaoShan mivm.cn
|
||||
|
||||
local m, s ,o
|
||||
|
||||
m = Map("k3screenctrl", translate("Screen"), translate("Customize your device screen"))
|
||||
|
||||
s = m:section(TypedSection, "general", translate("General Setting") )
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(ListValue, "screen_time", translate("Screen time :"), translate("This time no action, the screen will close."))
|
||||
o:value("10",translate("10 s"))
|
||||
o:value("30",translate("30 s"))
|
||||
o:value("60",translate("60 s"))
|
||||
o:value("300",translate("5 m"))
|
||||
o:value("600",translate("10 m"))
|
||||
o:value("900",translate("15 m"))
|
||||
o:value("1800",translate("30 m"))
|
||||
o:value("3600",translate("60 m"))
|
||||
o.default = 10
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, "refresh_time", translate("Refresh interval :"), translate("Screen data refresh interval."))
|
||||
o:value("2",translate("2 s"))
|
||||
o:value("5",translate("5 s"))
|
||||
o:value("10",translate("10 s"))
|
||||
o.default = 2
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Flag, "psk_hide", translate("Hide Wireless password"))
|
||||
o.default = 0
|
||||
|
||||
o = s:option(Flag, "cputemp", translate("Display CPU temperature"), translate("The first page shows the CPU temperature."))
|
||||
o.default = 0
|
||||
|
||||
o = s:option(Button,"test_print",translate("Test"),translate("Execute k3screenctrl -t and return the result"))
|
||||
o.inputtitle = translate("Print info")
|
||||
o.write = function()
|
||||
luci.sys.call("k3screenctrl -t > /tmp/k3screenctrl/test")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin","system","k3screenctrl"))
|
||||
end
|
||||
|
||||
s = m:section(TypedSection, "device_custom", translate("Device customization") ,translate("Customize the fifth page of device information"))
|
||||
s.template = "cbi/tblsection"
|
||||
s.addremove = true
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Value,"mac",translate("Device"))
|
||||
o.datatype = "macaddr"
|
||||
o.rmempty = false
|
||||
luci.sys.net.mac_hints(function(t,a)
|
||||
o:value(t,"%s (%s)"%{a,t})
|
||||
end)
|
||||
|
||||
o = s:option(Value,"name",translate("Hostname"))
|
||||
|
||||
o = s:option(ListValue,"icon",translate("Icon"))
|
||||
o:value("0",translate("Auto"))
|
||||
o:value("1",translate("OnePlus"))
|
||||
o:value("2","360")
|
||||
o:value("3",translate("Asus"))
|
||||
o:value("4",translate("Coolpad"))
|
||||
o:value("5",translate("Dell"))
|
||||
o:value("6",translate("Haier"))
|
||||
o:value("7",translate("Hasee"))
|
||||
o:value("8",translate("Honor"))
|
||||
o:value("9",translate("HP"))
|
||||
o:value("10","HTC")
|
||||
o:value("11",translate("Huawei"))
|
||||
o:value("12",translate("Apple"))
|
||||
o:value("13",translate("Lenovo"))
|
||||
o:value("14",translate("LeEco"))
|
||||
o:value("15","LG")
|
||||
o:value("16",translate("Meitu"))
|
||||
o:value("17",translate("Meizu"))
|
||||
o:value("18","OPPO")
|
||||
o:value("19",translate("Phicomm"))
|
||||
o:value("20",translate("Samsung"))
|
||||
o:value("21",translate("Smartisan"))
|
||||
o:value("22",translate("Sony"))
|
||||
o:value("23","TCL")
|
||||
o:value("24","ThinkPad")
|
||||
o:value("25",translate("TongfangPC"))
|
||||
o:value("26","VIVO")
|
||||
o:value("27",translate("Microsoft"))
|
||||
o:value("28",translate("XiaoMi"))
|
||||
o:value("29",translate("ZTE"))
|
||||
|
||||
if nixio.fs.access("/tmp/k3screenctrl/test") then
|
||||
s = m:section(TypedSection, "general", translate("Output results"))
|
||||
s.anonymous = true
|
||||
o = s:option(TextValue,"test_output_results")
|
||||
o.readonly = true
|
||||
o.rows = 30
|
||||
o.cfgvalue = function()
|
||||
return luci.sys.exec("cat /tmp/k3screenctrl/test && rm -f /tmp/k3screenctrl/test")
|
||||
end
|
||||
end
|
||||
|
||||
return m
|
||||
Loading…
Reference in New Issue
Block a user