diff --git a/doc/lucky1.png b/doc/lucky1.png deleted file mode 100644 index a5b41b6e..00000000 Binary files a/doc/lucky1.png and /dev/null differ diff --git a/doc/lucky2.png b/doc/lucky2.png deleted file mode 100644 index ba4c026f..00000000 Binary files a/doc/lucky2.png and /dev/null differ diff --git a/doc/lucky3.png b/doc/lucky3.png deleted file mode 100644 index 6fa7982f..00000000 Binary files a/doc/lucky3.png and /dev/null differ diff --git a/doc/taskplan1.png b/doc/taskplan1.png new file mode 100644 index 00000000..1f8db7be Binary files /dev/null and b/doc/taskplan1.png differ diff --git a/doc/taskplan2.png b/doc/taskplan2.png new file mode 100644 index 00000000..edb45d6d Binary files /dev/null and b/doc/taskplan2.png differ diff --git a/doc/taskplan3.png b/doc/taskplan3.png new file mode 100644 index 00000000..d4794702 Binary files /dev/null and b/doc/taskplan3.png differ diff --git a/doc/view.png b/doc/view.png new file mode 100644 index 00000000..169e112f Binary files /dev/null and b/doc/view.png differ diff --git a/doc/view2.png b/doc/view2.png new file mode 100644 index 00000000..9058c632 Binary files /dev/null and b/doc/view2.png differ diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua index 7d428241..fec29453 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua @@ -49,24 +49,16 @@ m.uci:foreach(appname, "socks", function(s) end end) + local dynamicList_write = function(self, section, value) - local t = {} - local t2 = {} + local new_t = {} if type(value) == "table" then - local x - for _, x in ipairs(value) do - if x and #x > 0 then - if not t2[x] then - t2[x] = x - t[#t+1] = x - end - end - end + new_t = api.table_remove_duplicates(value) else - t = { value } + new_t = { value } end - t = table.concat(t, " ") - return DynamicList.write(self, section, t) + local new_val = table.concat(new_t, " ") + return DynamicList.write(self, section, new_val) end -- [[ ACLs Settings ]]-- diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua index 62f9071f..52f342a6 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua @@ -373,22 +373,13 @@ if api.is_finded("smartdns") then return m:get(section, self.option) or {"tcp://1.1.1.1"} end function o.write(self, section, value) - local t = {} - local t2 = {} + local new_t = {} if type(value) == "table" then - local x - for _, x in ipairs(value) do - if x and #x > 0 then - if not t2[x] then - t2[x] = x - t[#t+1] = x - end - end - end + new_t = api.table_remove_duplicates(value) else - t = { value } + new_t = { value } end - return DynamicList.write(self, section, t) + return DynamicList.write(self, section, new_t) end end diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/shunt_rules.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/shunt_rules.lua index 8ae6a0e6..a02db5f6 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/shunt_rules.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/shunt_rules.lua @@ -165,23 +165,14 @@ source.validate = function(self, value, t) end local dynamicList_write = function(self, section, value) - local t = {} - local t2 = {} + local new_t = {} if type(value) == "table" then - local x - for _, x in ipairs(value) do - if x and #x > 0 then - if not t2[x] then - t2[x] = x - t[#t+1] = x - end - end - end + new_t = api.table_remove_duplicates(value) else - t = { value } + new_t = { value } end - t = table.concat(t, " ") - return DynamicList.write(self, section, t) + local new_val = table.concat(new_t, " ") + return DynamicList.write(self, section, new_val) end source.write = dynamicList_write diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/ray.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/ray.lua index b3efefdb..ee7a72bc 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/ray.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/ray.lua @@ -216,23 +216,14 @@ o:depends({ [_n("reality")] = true }) o = s:option(DynamicList, _n("reality_serverNames"), translate("serverNames")) o:depends({ [_n("reality")] = true }) -function o.write(self, section, value) - local t = {} - local t2 = {} +function o.custom_write(self, section, value) + local new_t = {} if type(value) == "table" then - local x - for _, x in ipairs(value) do - if x and #x > 0 then - if not t2[x] then - t2[x] = x - t[#t+1] = x - end - end - end + new_t = api.table_remove_duplicates(value) else - t = { value } + new_t = { value } end - return DynamicList.write(self, section, t) + m:set(section, self.option:sub(1 + #option_prefix), new_t) end o = s:option(ListValue, _n("alpn"), translate("alpn")) diff --git a/luci-app-passwall/luasrc/passwall/api.lua b/luci-app-passwall/luasrc/passwall/api.lua index 6dc1b152..d026127d 100644 --- a/luci-app-passwall/luasrc/passwall/api.lua +++ b/luci-app-passwall/luasrc/passwall/api.lua @@ -1874,3 +1874,20 @@ function get_network_devices() table.sort(_devices, function(a, b) return a.sort < b.sort end) return _devices end + + +function table_remove_duplicates(t) + if not t or #t == 0 then return nil end + local t_lookup = {} + local new_t = {} + local x + for _, x in ipairs(t) do + if x and #x > 0 then + if not t_lookup[x] then + t_lookup[x] = x + new_t[#new_t+1] = x + end + end + end + return new_t +end diff --git a/luci-app-passwall/luasrc/view/passwall/log/log.htm b/luci-app-passwall/luasrc/view/passwall/log/log.htm index 83836942..7afc934a 100644 --- a/luci-app-passwall/luasrc/view/passwall/log/log.htm +++ b/luci-app-passwall/luasrc/view/passwall/log/log.htm @@ -1,5 +1,6 @@ <% local api = require "luci.passwall.api" +local section_tag = api.is_js_luci() and "div" or "fieldset" -%> <%+header%> -
+<<%=section_tag%> class="cbi-section" id="_log_fieldset"> -
+> <%+footer%> diff --git a/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm b/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm index 85eb3e85..98d77bdd 100644 --- a/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm +++ b/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm @@ -1,6 +1,8 @@ <% local api = require "luci.passwall.api" local appname = api.appname +local is_js_luci = api.is_js_luci() +local section_tag = is_js_luci and "div" or "fieldset" -%> @@ -364,7 +366,7 @@ table td, .table .td { -
-
+<<%=section_tag%> class="cbi-section" id="node_list"> +> @@ -326,7 +329,7 @@ table td, .table .td { -
-

Sing-Box/Xray <%:Shunt Rule%>

+<<%=section_tag%> class="cbi-section"> + <<%=title_tag%>>Sing-Box/Xray <%:Shunt Rule%>>
<%:Please note attention to the priority, the higher the order, the higher the priority.%>
-
+>