luci-mod-admin-full: offer "Cancel" button in iface add dialog
authorJo-Philipp Wich <jo@mein.io>
Wed, 18 Jul 2018 08:11:45 +0000 (10:11 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 18 Jul 2018 10:05:05 +0000 (12:05 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/iface_add.lua

index e48e3b4bdf9932211ff1108ded4f2ef4fa562a8d..ca66e9f365ccb8a3442328331ca33c58abad425a 100644 (file)
@@ -10,6 +10,10 @@ m = SimpleForm("network", translate("Create Interface"))
 m.redirect = luci.dispatcher.build_url("admin/network/network")
 m.reset = false
 
+function m.on_cancel()
+       luci.http.redirect(luci.dispatcher.build_url("admin/network/network"))
+end
+
 newnet = m:field(Value, "_netname", translate("Name of the new interface"),
        translate("The allowed characters are: <code>A-Z</code>, <code>a-z</code>, " ..
                "<code>0-9</code> and <code>_</code>"