add new ipk luci-app-webadmin

This commit is contained in:
coolsnowwolf 2018-10-23 17:34:06 +08:00
parent af05b04a4e
commit 8366075488
4 changed files with 126 additions and 0 deletions

View File

@ -0,0 +1,18 @@
#
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI page for Web Admin
LUCI_DEPENDS:=+uhttpd
PKG_VERSION:=1.0
PKG_RELEASE:=1
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,17 @@
-- Copyright 2015 Daniel Dickinson <openwrt@daniel.thecshore.com>
-- Licensed to the public under the Apache License 2.0.
module("luci.controller.webadmin", package.seeall)
function index()
if not nixio.fs.access("/etc/config/uhttpd") then
return
end
local page
page = entry({"admin", "system", "webadmin"}, cbi("webadmin"), _("Web Admin"), 1)
page.leaf = true
end

View File

@ -0,0 +1,50 @@
-- Copyright 2015 Daniel Dickinson <openwrt@daniel.thecshore.com>
-- Licensed to the public under the Apache License 2.0.
local fs = require("nixio.fs")
local m = Map("uhttpd", translate("Web Admin Settings"),
translate("Web Admin Settings Page"))
local ucs = m:section(TypedSection, "uhttpd")
ucs.addremove = false
ucs.anonymous = false
lhttp = ucs:option(DynamicList, "listen_http", translate("HTTP listeners (address:port)"), translate("Bind to specific interface:port (by specifying interface address"))
lhttp.datatype = "list(ipaddrport(1))"
function lhttp.validate(self, value, section)
local have_https_listener = false
local have_http_listener = false
if lhttp and lhttp:formvalue(section) and (#(lhttp:formvalue(section)) > 0) then
for k, v in pairs(lhttp:formvalue(section)) do
if v and (v ~= "") then
have_http_listener = true
break
end
end
end
if lhttps and lhttps:formvalue(section) and (#(lhttps:formvalue(section)) > 0) then
for k, v in pairs(lhttps:formvalue(section)) do
if v and (v ~= "") then
have_https_listener = true
break
end
end
end
if not (have_http_listener or have_https_listener) then
return nil, "must listen on at list one address:port"
end
return DynamicList.validate(self, value, section)
end
o = ucs:option(Flag, "redirect_https", translate("Redirect all HTTP to HTTPS"))
o.default = o.enabled
o.rmempty = false
o.description = translate("Redirect all HTTP to HTTPS when SSl cert was installed")
o = ucs:option(Flag, "rfc1918_filter", translate("Ignore private IPs on public interface"), translate("Prevent access from private (RFC1918) IPs on an interface if it has an public IP address"))
o.default = o.enabled
o.rmempty = false
return m

View File

@ -0,0 +1,41 @@
msgid ""
msgstr ""
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
msgid "Web Admin"
msgstr "路由器Web管理页面"
msgid "Web Admin Settings"
msgstr "路由器Web管理页面设置"
msgid "Web Admin Settings Page"
msgstr "设置更改路由器Web管理页面端口绑定地址是否允许从互联网访问等"
msgid "HTTP listeners (address:port)""
msgstr "HTTP 监听 (IP地址:端口)""
msgid "Bind to specific interface:port (by specifying interface address"
msgstr "绑定到指定的IP地址:端口"
msgid "Redirect all HTTP to HTTPS"
msgstr "重定向HTTP到HTTPS"
msgid "Redirect all HTTP to HTTPS when SSl cert was installed"
msgstr "当安装了SSL证书后重定向HTTP到HTTPS管理页面"
msgid "Auto activate"
msgstr "自动激活局域网客户端"
msgid "configfile"
msgstr "配置文件"
msgid "Ignore private IPs on public interface"
msgstr "只允许内网访问"
msgid "Prevent access from private (RFC1918) IPs on an interface if it has an public IP address"
msgstr "拒绝从互联网访问Web管理页面"