ss.options_common(s, "advanced")
if stype == "ss_server" then
- ss.options_server(s, "general")
+ ss.options_server(s, {tab="general"})
o = s:taboption("general", Value, "bind_address",
translate("Bind address"),
translate("The address ss-server will initiate connection from"))
end
s = m:section(NamedSection, sname, "server")
m.title = m.title .. ' - ' .. sname
+ opts = {}
else
s = m:section(TypedSection, "server")
s.template = 'cbi/tblsection'
s.addremove = true
+ s.extedit = function(self, section)
+ return 'servers/' .. section
+ end
+ opts = {row=true}
end
s:option(Flag, "disabled", translate("Disable"))
-ss.options_server(s)
+ss.options_server(s, opts)
return m
o.datatype = "port"
end
-function options_server(s, tab)
+function options_server(s, opts)
local o
local optfunc
+ local tab = opts and opts.tab or nil
+ local row = opts and opts.row or false
if tab == nil then
optfunc = function(...) return s:option(...) end
for _, m in ipairs(methods) do
o:value(m)
end
- o = optfunc(Value, "key", translate("Key (base64)"))
- o.datatype = "base64"
- o.password = true
- o.size = 12
o = optfunc(Value, "password", translate("Password"))
o.password = true
o.size = 12
+ if not row then
+ o = optfunc(Value, "key", translate("Key (base64)"))
+ o.datatype = "base64"
+ o.password = true
+ o.size = 12
+ optfunc(Value, "plugin", translate("Plugin"))
+ optfunc(Value, "plugin_opts", translate("Plugin Options"))
+ end
end
function options_common(s, tab)
o.datatype = "uinteger"
o = s:taboption(tab, Value, "timeout", translate("Timeout (sec)"))
o.datatype = "uinteger"
- s:taboption(tab, Value, "plugin", translate("Plugin"))
- s:taboption(tab, Value, "plugin_opts", translate("Plugin Options"))
s:taboption(tab, Value, "user", translate("Run as"))
s:taboption(tab, Flag, "verbose", translate("Verbose"))
"method",
"key",
"password",
+ "plugin",
+ "plugin_opts",
}
names_options_client = {
"mode",
"mtu",
"timeout",
- "plugin",
- "plugin_opts",
"user",
}