瀏覽代碼

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 月之前
父節點
當前提交
14405355bc
共有 1 個文件被更改,包括 8 次插入0 次删除
  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 "luci.ip"
 require "nixio.fs"
 require "nixio.fs"
+require "luci.sys"
 local m, s, o
 local m, s, o
 
 
 m = Map("shadowsocksr")
 m = Map("shadowsocksr")
@@ -140,4 +141,11 @@ o.remove = function(self, section, value)
 	nixio.fs.writefile(netflixconf, "")
 	nixio.fs.writefile(netflixconf, "")
 end
 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
 return m