luci-app-travelmate: sync with travelmate 0.7.3
authorDirk Brenken <dev@brenken.org>
Wed, 10 May 2017 14:56:58 +0000 (16:56 +0200)
committerDirk Brenken <dev@brenken.org>
Wed, 10 May 2017 14:56:58 +0000 (16:56 +0200)
* Automatically refresh the overview page after button onclick event,
e.g. 'Save & Apply'

Signed-off-by: Dirk Brenken <dev@brenken.org>
applications/luci-app-travelmate/luasrc/model/cbi/travelmate/overview_tab.lua

index 6b07aabaedbf40470d291a37d61ac752d8f25281..236bbb0de5669ed96c2d8be063614c3538267bc1 100644 (file)
@@ -16,6 +16,11 @@ m = Map("travelmate", translate("Travelmate"),
        .. "<a href=\"%s\" target=\"_blank\">"
        .. "see online documentation</a>", "https://github.com/openwrt/packages/blob/master/net/travelmate/files/README.md"))
 
+function m.on_after_commit(self)
+       luci.sys.call("/etc/init.d/travelmate restart >/dev/null 2>&1")
+       luci.http.redirect(luci.dispatcher.build_url("admin", "services", "travelmate"))
+end
+
 -- Main travelmate options
 
 s = m:section(NamedSection, "global", "travelmate")