From 62d8a4fdd71540dba56fa4c982df2b753a49996d Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Thu, 9 May 2019 06:00:52 +0000 Subject: luci-app-shadowsocks-libev: move plugin options to server sections In this change, plugin options are moved from component settings to only server settings. This should make the configuration easier. And it will be less error-prone as it's impossible now for users to inconsisitent plugin settings for instances referring to the same remote server Signed-off-by: Yousong Zhou --- .../luasrc/model/cbi/shadowsocks-libev/instance-details.lua | 2 +- .../luasrc/model/cbi/shadowsocks-libev/servers.lua | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'applications/luci-app-shadowsocks-libev/luasrc/model/cbi') diff --git a/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/instance-details.lua b/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/instance-details.lua index 195a31f2fd..c6323b4dfd 100644 --- a/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/instance-details.lua +++ b/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/instance-details.lua @@ -27,7 +27,7 @@ ss.option_install_package(s, "general") 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")) 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 index a0d0079278..ec601c4fe6 100644 --- 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 @@ -19,13 +19,18 @@ if sname then 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 -- cgit v1.2.3