From d1ffe61305b53a5520d65b58f55df9540ab1ef2e Mon Sep 17 00:00:00 2001 From: Pdboy Sir <63764630+sirpdboy@users.noreply.github.com> Date: Fri, 15 Mar 2024 17:39:11 +0800 Subject: [PATCH] =?UTF-8?q?up=20=E6=94=AF=E6=8C=81LEDE=E5=92=8COPENWRT?= =?UTF-8?q?=E5=AE=98=E6=96=B9=E7=89=88=E6=9C=AC=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- luci-app-poweroffdevice/Makefile | 5 +-- .../luasrc/controller/poweroffdevice.lua | 4 ++- .../po/zh-cn/poweroffdevice.po | 31 +++++++++++++++++++ .../po/zh_Hans/poweroffdevice.po | 31 +++++++++++++++++++ .../rpcd/acl.d/luci-app-poweroffdevice.json | 11 +++++++ 5 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 luci-app-poweroffdevice/po/zh-cn/poweroffdevice.po create mode 100644 luci-app-poweroffdevice/po/zh_Hans/poweroffdevice.po create mode 100644 luci-app-poweroffdevice/root/usr/share/rpcd/acl.d/luci-app-poweroffdevice.json diff --git a/luci-app-poweroffdevice/Makefile b/luci-app-poweroffdevice/Makefile index 309b2ba..61629aa 100644 --- a/luci-app-poweroffdevice/Makefile +++ b/luci-app-poweroffdevice/Makefile @@ -1,11 +1,12 @@ # # provides Web UI to shut down (power off) your device. -# routers are listed at https://github.com/sirpdboy/luci-app-poweroffdevice +# Copyright (C) 2022-2023 sirpdboy # This is free software, licensed under the GNU General Public License v3. include $(TOPDIR)/rules.mk -PKG_NAME:=luci-app-poweroffdevice +NAME:=poweroffdevice +PKG_NAME:=luci-app-$(NAME) LUCI_TITLE:=LuCI support for poweroffdevice Router LUCI_DESCRIPTION:=provides Web UI to shut down (power off) your device. diff --git a/luci-app-poweroffdevice/luasrc/controller/poweroffdevice.lua b/luci-app-poweroffdevice/luasrc/controller/poweroffdevice.lua index 4ce8d30..7f5fb3a 100644 --- a/luci-app-poweroffdevice/luasrc/controller/poweroffdevice.lua +++ b/luci-app-poweroffdevice/luasrc/controller/poweroffdevice.lua @@ -3,7 +3,9 @@ module("luci.controller.poweroffdevice", package.seeall) function index() - entry({"admin","system","poweroffdevice"},template("poweroffdevice/poweroffdevice"), _("PowerOff"), 92) + local e = entry({"admin","system","poweroffdevice"},template("poweroffdevice/poweroffdevice"), _("PowerOff"), 92) + e.dependent=false + e.acl_depends = { "luci-app-poweroffdevice" } entry({"admin","system","poweroffdevice","call"},post("action_poweroff")) end diff --git a/luci-app-poweroffdevice/po/zh-cn/poweroffdevice.po b/luci-app-poweroffdevice/po/zh-cn/poweroffdevice.po new file mode 100644 index 0000000..3aa7ff2 --- /dev/null +++ b/luci-app-poweroffdevice/po/zh-cn/poweroffdevice.po @@ -0,0 +1,31 @@ +# +# provides Web UI to shut down (power off) your device. +# routers are listed at https://github.com/sirpdboy/luci-app-poweroffdevice +# This is free software, licensed under the GNU General Public License v3. + +msgid "PowerOff" +msgstr "关机" + +msgid "Power Off Device" +msgstr "设备关机" + +msgid "Perform Power Off" +msgstr "执行关机" + +msgid "Turn off the power to the device you are using" +msgstr "关闭您正在使用的设备的电源" + +msgid "WARNING: Power off might result in a reboot on a device which not support power off." +msgstr "警告:对于不支持关机的设备,关机可能会导致重新启动." + +msgid "Device unreachable" +msgstr "操作设备无效" + +msgid "Shutting Down..." +msgstr "正在关机..." + +msgid "Device shutdown complete!" +msgstr "设备关机完毕!" + + + diff --git a/luci-app-poweroffdevice/po/zh_Hans/poweroffdevice.po b/luci-app-poweroffdevice/po/zh_Hans/poweroffdevice.po new file mode 100644 index 0000000..3aa7ff2 --- /dev/null +++ b/luci-app-poweroffdevice/po/zh_Hans/poweroffdevice.po @@ -0,0 +1,31 @@ +# +# provides Web UI to shut down (power off) your device. +# routers are listed at https://github.com/sirpdboy/luci-app-poweroffdevice +# This is free software, licensed under the GNU General Public License v3. + +msgid "PowerOff" +msgstr "关机" + +msgid "Power Off Device" +msgstr "设备关机" + +msgid "Perform Power Off" +msgstr "执行关机" + +msgid "Turn off the power to the device you are using" +msgstr "关闭您正在使用的设备的电源" + +msgid "WARNING: Power off might result in a reboot on a device which not support power off." +msgstr "警告:对于不支持关机的设备,关机可能会导致重新启动." + +msgid "Device unreachable" +msgstr "操作设备无效" + +msgid "Shutting Down..." +msgstr "正在关机..." + +msgid "Device shutdown complete!" +msgstr "设备关机完毕!" + + + diff --git a/luci-app-poweroffdevice/root/usr/share/rpcd/acl.d/luci-app-poweroffdevice.json b/luci-app-poweroffdevice/root/usr/share/rpcd/acl.d/luci-app-poweroffdevice.json new file mode 100644 index 0000000..f223ead --- /dev/null +++ b/luci-app-poweroffdevice/root/usr/share/rpcd/acl.d/luci-app-poweroffdevice.json @@ -0,0 +1,11 @@ +{ + "luci-app-poweroffdevice": { + "description": "Grant UCI access for luci-app-poweroffdevice", + "read": { + "uci": [ "poweroffdevice" ] + }, + "write": { + "uci": [ "poweroffdevice" ] + } + } +}