From e69005c67987abc4b17aa9fd4d1c25240162c58f Mon Sep 17 00:00:00 2001 From: Jian Chang Date: Wed, 27 Jul 2016 10:10:22 +0800 Subject: [PATCH] luci-app-shadowsocks-spec: update && bump support v2.4.8-2 --- Makefile | 2 +- files/luci/i18n/shadowsocks.zh-cn.po | 21 +++++++++++++++------ files/luci/model/cbi/shadowsocks.lua | 27 ++++++++++++++++++--------- 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index f084553..c794606 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openwrt-dist-luci -PKG_VERSION:=1.4.0 +PKG_VERSION:=1.5.0 PKG_RELEASE:=1 PKG_LICENSE:=GPLv3 diff --git a/files/luci/i18n/shadowsocks.zh-cn.po b/files/luci/i18n/shadowsocks.zh-cn.po index d406770..e26351f 100644 --- a/files/luci/i18n/shadowsocks.zh-cn.po +++ b/files/luci/i18n/shadowsocks.zh-cn.po @@ -16,6 +16,9 @@ msgstr "仅允许列表外" msgid "Allow listed only" msgstr "仅允许列表内" +msgid "Bypassed" +msgstr "绕过" + msgid "Bypassed IP List" msgstr "被忽略IP列表" @@ -28,6 +31,9 @@ msgstr "ChinaDNS路由表" msgid "Connection Timeout" msgstr "连接超时" +msgid "Default Action" +msgstr "默认行为" + msgid "Disable ShadowSocks" msgstr "停用ShadowSocks" @@ -46,27 +52,30 @@ msgstr "强制走代理IP" msgid "Forwarding Tunnel" msgstr "UDP转发地址" +msgid "Global" +msgstr "全局" + msgid "Global Server" msgstr "全局服务器" msgid "Global Setting" msgstr "全局设置" +msgid "Hosts Action" +msgstr "主机行为" + msgid "Interfaces - LAN" msgstr "接口 - LAN" msgid "Interfaces - WAN" msgstr "接口 - WAN" -msgid "LAN Access Control" -msgstr "内网访问控制" - -msgid "LAN Host List" -msgstr "内网主机列表" - msgid "Local Port" msgstr "本地端口" +msgid "Normal" +msgstr "常规" + msgid "NOT RUNNING" msgstr "未运行" diff --git a/files/luci/model/cbi/shadowsocks.lua b/files/luci/model/cbi/shadowsocks.lua index b033e56..89f6f61 100644 --- a/files/luci/model/cbi/shadowsocks.lua +++ b/files/luci/model/cbi/shadowsocks.lua @@ -3,7 +3,7 @@ openwrt-dist-luci: ShadowSocks ]]-- local pkg_name -local min_version = "2.4.4-1" +local min_version = "2.4.8-2" local m, s, o local shadowsocks = "shadowsocks" local uci = luci.model.uci.cursor() @@ -45,7 +45,7 @@ end if compare_versions(min_version, ">>", get_version()) then local tip = 'shadowsocks-libev-spec not found' if pkg_name then - tip = 'Please update the packages: %s' %{pkg_name} + tip = 'Please upgrade %s to v%s and above.' %{pkg_name, min_version} end return Map(shadowsocks, translate("ShadowSocks"), '%s' %{tip}) end @@ -192,16 +192,25 @@ o.datatype = "ip4addr" -- Part of LAN s:tab("lan_ac", translate("Interfaces - LAN")) -o = s:taboption("lan_ac", ListValue, "lan_ac_mode", translate("LAN Access Control")) -o:value("0", translate("Disable")) -o:value("w", translate("Allow listed only")) -o:value("b", translate("Allow all except listed")) +o = s:taboption("lan_ac", DynamicList, "interface", translate("Interface")) +o.template = "cbi/network_netlist" +o.nocreate = true +o.unspecified = false +o.widget = "checkbox" +o.default = "lan" o.rmempty = false -o = s:taboption("lan_ac", DynamicList, "lan_ac_ips", translate("LAN Host List")) -o.datatype = "ipaddr" +o = s:taboption("lan_ac", ListValue, "lan_default_target", translate("Default Action")) +o:value("SS_SPEC_WAN_AC", translate("Normal")) +o:value("RETURN", translate("Bypassed")) +o:value("SS_SPEC_WAN_FW", translate("Global")) +o.default = "SS_SPEC_WAN_AC" + +o = s:taboption("lan_ac", DynamicList, "lan_hosts_action", translate("Hosts Action")) for _, v in ipairs(arp_table) do - o:value(v["IP address"], "%s (%s)" %{v["IP address"], v["HW address"]}) + o:value("b,%s" %{v["IP address"]}, "%s %s (%s)" %{translate("Bypassed"), v["IP address"], v["HW address"]}) + o:value("g,%s" %{v["IP address"]}, "%s %s (%s)" %{translate("Global"), v["IP address"], v["HW address"]}) + o:value("n,%s" %{v["IP address"]}, "%s %s (%s)" %{translate("Normal"), v["IP address"], v["HW address"]}) end return m