summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/servers.lua
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2017-07-23 19:37:10 +0300
committerGitHub <noreply@github.com>2017-07-23 19:37:10 +0300
commit8f62b28948f8b24f1eb8239074a19d868a02cad6 (patch)
tree9f75453fedbb838374d8c52ae0b2f651b2185f78 /applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/servers.lua
parent52a0787c3fd6ad066e98f3d81849c413d8ea3bd4 (diff)
parent48b5ccfad54d6d21468f68a2ae8c52c377bc5c5e (diff)
Merge pull request #1242 from yousong/shadowsocks-libev
luci-app-shadowsocks-libev: rewrite for shadowsocks-libev 3.0.6-2
Diffstat (limited to 'applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/servers.lua')
-rw-r--r--applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/servers.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/servers.lua b/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/servers.lua
new file mode 100644
index 0000000000..71c66562e1
--- /dev/null
+++ b/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/servers.lua
@@ -0,0 +1,31 @@
+-- Copyright 2017 Yousong Zhou <yszhou4tech@gmail.com>
+-- Licensed to the public under the Apache License 2.0.
+
+local ds = require "luci.dispatcher"
+local ss = require("luci.model.shadowsocks-libev")
+
+local m, s
+
+m = Map("shadowsocks-libev",
+ translate("Remote Servers"),
+ translate("Definition of remote shadowsocks servers. \
+ Disable any of them will also disable instances refering to it."))
+
+local sname = arg[1]
+if sname then
+ if not m:get(sname) then
+ luci.http.redirect(ds.build_url("admin/services/shadowsocks-libev/servers"))
+ return
+ end
+ s = m:section(NamedSection, sname, "server")
+ m.title = m.title .. ' - ' .. sname
+else
+ s = m:section(TypedSection, "server")
+ s.template = 'cbi/tblsection'
+ s.addremove = true
+end
+
+s:option(Flag, "disabled", translate("Disable"))
+ss.options_server(s)
+
+return m