diff options
Diffstat (limited to 'modules/niu/luasrc/model/cbi')
-rw-r--r-- | modules/niu/luasrc/model/cbi/niu/network/lan.lua | 10 | ||||
-rw-r--r-- | modules/niu/luasrc/model/cbi/niu/system/reboot.lua | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/modules/niu/luasrc/model/cbi/niu/network/lan.lua b/modules/niu/luasrc/model/cbi/niu/network/lan.lua index b5d97d2b1c..6f6237e608 100644 --- a/modules/niu/luasrc/model/cbi/niu/network/lan.lua +++ b/modules/niu/luasrc/model/cbi/niu/network/lan.lua @@ -1,10 +1,12 @@ -local cursor = require "luci.model.uci".cursor() +local uci = require "luci.model.uci" +local cursor = uci.cursor() local d = Delegator() d.allow_finish = true d.allow_back = true d.allow_cancel = true d:add("lan1", load("niu/network/lan1")) +d:set("warnip", {Template("niu/network/warn_ip_change")}) function d.on_cancel() cursor:revert("network") @@ -12,6 +14,12 @@ function d.on_cancel() end function d.on_done() + if uci.inst_state:get("network", "lan", "ipaddr") ~= cursor:get("network", "lan", "ipaddr") then + local cs = uci.cursor_state() + cs:set("network", "lan", "_ipchanged", "1") + cs:save("network") + end + cursor:commit("network") cursor:commit("dhcp") end diff --git a/modules/niu/luasrc/model/cbi/niu/system/reboot.lua b/modules/niu/luasrc/model/cbi/niu/system/reboot.lua new file mode 100644 index 0000000000..d8f852bdc9 --- /dev/null +++ b/modules/niu/luasrc/model/cbi/niu/system/reboot.lua @@ -0,0 +1 @@ +local f = Form("reboot", "Rebooting Device", "Device is rebooting. Please wait...")
\ No newline at end of file |