diff --git a/package/lean/luci-app-ssr-plus/Makefile b/package/lean/luci-app-ssr-plus/Makefile index 06d7303925..15b40708df 100644 --- a/package/lean/luci-app-ssr-plus/Makefile +++ b/package/lean/luci-app-ssr-plus/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-ssr-plus PKG_VERSION:=1 -PKG_RELEASE:=90 +PKG_RELEASE:=91 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \ CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \ diff --git a/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua b/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua index 5d93348234..5c76574240 100644 --- a/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua +++ b/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua @@ -3,13 +3,20 @@ local uci = luci.model.uci.cursor() local server_table = {} uci:foreach(shadowsocksr, "servers", function(s) - if s.alias and s.type == "ssr" then - server_table[s[".name"]] = s.alias - elseif s.server and s.server_port and s.type == "ssr" then - server_table[s[".name"]] = "%s:%s" %{s.server, s.server_port} + if s.alias then + server_table[s[".name"]] = "[%s]:%s" %{string.upper(s.type), s.alias} + elseif s.server and s.server_port then + server_table[s[".name"]] = "[%s]:%s:%s" %{string.upper(s.type), s.server, s.server_port} end end) +local key_table = {} +for key,_ in pairs(server_table) do + table.insert(key_table,key) +end + +table.sort(key_table) + m = Map(shadowsocksr) s = m:section(TypedSection, "global", translate("Server failsafe auto swith settings")) @@ -38,7 +45,7 @@ s.anonymous = true o = s:option(ListValue, "server", translate("Server")) o:value("nil", translate("Disable")) -for k, v in pairs(server_table) do o:value(k, v) end +for _,key in pairs(key_table) do o:value(key,server_table[key]) end o.default = "nil" o.rmempty = false