Browse Source

Merge pull request #1634 from zxlhhyccc/patch-4

luci-app-ssr-plus: control.lua: Fix "Add or Remove" domain name list domain name click "Save and apply" pop-up "No changes to apply" box.
coolsnowwolf 10 months ago
parent
commit
14405355bc
1 changed files with 8 additions and 0 deletions
  1. 8 0
      luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/control.lua

+ 8 - 0
luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/control.lua

@@ -1,5 +1,6 @@
 require "luci.ip"
 require "nixio.fs"
+require "luci.sys"
 local m, s, o
 
 m = Map("shadowsocksr")
@@ -140,4 +141,11 @@ o.remove = function(self, section, value)
 	nixio.fs.writefile(netflixconf, "")
 end
 
+if luci.sys.call('[ -f "/www/luci-static/resources/uci.js" ]') == 0 then
+	m.apply_on_parse = true
+	function m.on_apply(self)
+		luci.sys.call("/etc/init.d/shadowsocksr reload > /dev/null 2>&1 &")
+	end
+end
+
 return m