mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-29 23:05:13 +08:00
update 2026-09-26 11:07:27
This commit is contained in:
1 parent
7b88b273d0
commit
97ae9f68da
4898 files changed
-1712274
No files matched your search
@@ -1,18 +0,0 @@
|
||||
module("luci.controller.softethervpn", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/luci-app-softethervpn") then return end
|
||||
|
||||
e = entry({"admin", "vpn", "softethervpn"}, cbi("softethervpn"), _("SoftEther VPN"), 80)
|
||||
e.dependent = true
|
||||
e.acl_depends = { "luci-app-softethervpn" }
|
||||
|
||||
entry({"admin", "vpn", "softethervpn", "status"}, call("status")).leaf = true
|
||||
end
|
||||
|
||||
function status()
|
||||
local e = {}
|
||||
e.status = luci.sys.call("pidof %s >/dev/null" % "vpnserver") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
@@ -1,38 +0,0 @@
|
||||
m = Map("luci-app-softethervpn", translate("SoftEther VPN"))
|
||||
m.description = translate("SoftEther VPN is an open source, cross-platform, multi-protocol virtual private network solution developed by university of tsukuba graduate student Daiyuu Nobori for master's thesis. <br>can easily set up OpenVPN, IPsec, L2TP, ms-sstp, L2TPv3 and EtherIP servers on the router using the console.")
|
||||
m.template = "softethervpn/index"
|
||||
|
||||
s = m:section(TypedSection, "softether")
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(DummyValue, "softethervpn_status", translate("Current Condition"))
|
||||
o.template = "softethervpn/status"
|
||||
o.value = translate("Collecting data...")
|
||||
|
||||
o = s:option(Flag, "enabled", translate("Enabled"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(DummyValue, "moreinfo", translate("Console download"))
|
||||
o.rawhtml = true
|
||||
o.cfgvalue = function(self, section)
|
||||
local obj = {
|
||||
{
|
||||
title = "Windows-x86_x64-intel.exe",
|
||||
url = "https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.38-9760-rtm/softether-vpnserver_vpnbridge-v4.38-9760-rtm-2021.08.17-windows-x86_x64-intel.exe"
|
||||
},
|
||||
{
|
||||
title = "macos-x86-32bit.pkg",
|
||||
url = "https://www.softether-download.com/files/softether/v4.21-9613-beta-2016.04.24-tree/Mac_OS_X/Admin_Tools/VPN_Server_Manager_Package/softether-vpnserver_manager-v4.21-9613-beta-2016.04.24-macos-x86-32bit.pkg"
|
||||
}
|
||||
}
|
||||
|
||||
local html = ""
|
||||
|
||||
for i, o in ipairs(obj) do
|
||||
html = html .. string.format("<a href='%s'>%s   </a>", o.url, o.title)
|
||||
end
|
||||
|
||||
return html
|
||||
end
|
||||
|
||||
return m
|
||||
@@ -1,13 +0,0 @@
|
||||
<% include("cbi/map") %>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(2, '<%=luci.dispatcher.build_url("admin", "vpn", "softethervpn", "status")%>', null,
|
||||
function(x, result)
|
||||
{
|
||||
var status = document.getElementsByClassName('softethervpn_status')[0];
|
||||
status.setAttribute("style","font-weight:bold;");
|
||||
status.setAttribute("color",result.status ? "green":"red");
|
||||
status.innerHTML = result.status?'<%=translate("RUNNING")%>':'<%=translate("NOT RUNNING")%>';
|
||||
}
|
||||
)
|
||||
//]]>
|
||||
</script>
|
||||
@@ -1,3 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<font class="softethervpn_status"><%=pcdata(self:cfgvalue(section) or self.default or "")%></font>
|
||||
<%+cbi/valuefooter%>
|
||||
Reference in new issue
Block a user