mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-01 16:44:23 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,18 @@
|
||||
module("luci.controller.pptp-server", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/pptpd") then
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "vpn"}, firstchild(), "VPN", 45).dependent = false
|
||||
entry({"admin", "vpn", "pptp-server"}, cbi("pptp-server"), _("PPTP VPN Server"), 80).dependent = false
|
||||
entry({"admin", "vpn", "pptp-server", "status"}, call("act_status")).leaf = true
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e = {}
|
||||
e.running = luci.sys.call("pgrep pptpd >/dev/null") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
@@ -0,0 +1,37 @@
|
||||
mp = Map("pptpd")
|
||||
mp.title = translate("PPTP VPN Server")
|
||||
mp.description = translate("PPTP VPN Server connectivity using the native built-in VPN Client on Windows/Linux or Android")
|
||||
|
||||
mp:section(SimpleSection).template = "pptp-server/pptp-server_status"
|
||||
|
||||
s = mp:section(NamedSection, "pptpd", "service")
|
||||
s.anonymouse = true
|
||||
|
||||
enabled = s:option(Flag, "enabled", translate("Enable"))
|
||||
enabled.default = 0
|
||||
enabled.rmempty = false
|
||||
|
||||
localip = s:option(Value, "localip", translate("Local IP"))
|
||||
localip.datatype = "ip4addr"
|
||||
|
||||
clientip = s:option(Value, "remoteip", translate("Client IP"))
|
||||
clientip.description = translate("LAN DHCP reserved start-to-end IP addresses with the same subnet mask")
|
||||
clientip.datatype = "string"
|
||||
|
||||
remotedns = s:option(Value, "remotedns", translate("Remote Client DNS"))
|
||||
remotedns.datatype = "ip4addr"
|
||||
|
||||
logging = s:option(Flag, "logwtmp", translate("Debug Logging"))
|
||||
logging.default = 0
|
||||
logging.rmempty = false
|
||||
|
||||
logins = mp:section(NamedSection, "login", "login", translate("PPTP Logins"))
|
||||
logins.anonymouse = true
|
||||
|
||||
username = logins:option(Value, "username", translate("User name"))
|
||||
username.datatype = "string"
|
||||
|
||||
password = logins:option(Value, "password", translate("Password"))
|
||||
password.password = true
|
||||
|
||||
return mp
|
||||
@@ -0,0 +1,22 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(3, '<%=url([[admin]], [[vpn]], [[pptp-server]], [[status]])%>', null,
|
||||
function(x, data) {
|
||||
var tb = document.getElementById('pptp-server_status');
|
||||
if (data && tb) {
|
||||
if (data.running) {
|
||||
var links = '<em><b><font color=green>PPTP VPN Server <%:RUNNING%></font></b></em>';
|
||||
tb.innerHTML = links;
|
||||
} else {
|
||||
tb.innerHTML = '<em><b><font color=red>PPTP VPN Server <%:NOT RUNNING%></font></b></em>';
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]>
|
||||
</script>
|
||||
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
|
||||
<fieldset class="cbi-section">
|
||||
<p id="pptp-server_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
Reference in new issue
Block a user