NIU: More LAN settings, initial WAN
[project/luci.git] / modules / niu / luasrc / model / cbi / niu / network / lan.lua
index acbfe4f..b5d97d2 100644 (file)
@@ -1,3 +1,4 @@
+local cursor = require "luci.model.uci".cursor()
 local d = Delegator()
 d.allow_finish = true
 d.allow_back = true
@@ -5,4 +6,14 @@ d.allow_cancel = true
 
 d:add("lan1", load("niu/network/lan1"))
 
+function d.on_cancel()
+       cursor:revert("network")
+       cursor:revert("dhcp")
+end
+
+function d.on_done()
+       cursor:commit("network")
+       cursor:commit("dhcp")
+end
+
 return d
\ No newline at end of file