summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-travelmate/luasrc/controller
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2017-04-21 22:19:35 +0300
committerGitHub <noreply@github.com>2017-04-21 22:19:35 +0300
commit494fc4cdb913cfd68c7299bfc7dbad0dab8dfc0c (patch)
tree7d7af73538a5e2fcf610e45668816c164cce3dbc /applications/luci-app-travelmate/luasrc/controller
parent7ae244a26ef516511a5e476dd14ec033501a1d8d (diff)
parentbbd2c52a1690f82965d17104c33f02dc09e7eb82 (diff)
Merge pull request #1118 from dibdot/app-travelmate
travelmate: major frontend update
Diffstat (limited to 'applications/luci-app-travelmate/luasrc/controller')
-rw-r--r--applications/luci-app-travelmate/luasrc/controller/travelmate.lua22
1 files changed, 20 insertions, 2 deletions
diff --git a/applications/luci-app-travelmate/luasrc/controller/travelmate.lua b/applications/luci-app-travelmate/luasrc/controller/travelmate.lua
index 27c19c4e52..4286b80d76 100644
--- a/applications/luci-app-travelmate/luasrc/controller/travelmate.lua
+++ b/applications/luci-app-travelmate/luasrc/controller/travelmate.lua
@@ -1,11 +1,29 @@
--- Licensed to the public under the Apache License 2.0.
+-- Copyright 2017 Dirk Brenken (dev@brenken.org)
+-- This is free software, licensed under the Apache License, Version 2.0
module("luci.controller.travelmate", package.seeall)
+local fs = require("nixio.fs")
+local util = require("luci.util")
+local template = require("luci.template")
+local i18n = require("luci.i18n")
+
function index()
if not nixio.fs.access("/etc/config/travelmate") then
return
end
+ entry({"admin", "services", "travelmate"}, firstchild(), _("Travelmate"), 30).dependent = false
+ entry({"admin", "services", "travelmate", "tab_from_cbi"}, cbi("travelmate/overview_tab"), _("Overview"), 10).leaf = true
+ entry({"admin", "services", "travelmate", "logfile"}, call("logread"), _("View Logfile"), 20).leaf = true
+ entry({"admin", "services", "travelmate", "advanced"}, firstchild(), _("Advanced"), 100)
+ entry({"admin", "services", "travelmate", "advanced", "setup"}, cbi("travelmate/setup_tab"), _("Setup WWAN Interface"), 110).leaf = true
+ entry({"admin", "services", "travelmate", "advanced", "configuration"}, cbi("travelmate/configuration_tab"), _("Edit Travelmate Configuration"), 120).leaf = true
+ entry({"admin", "services", "travelmate", "advanced", "cfg_wireless"}, cbi("travelmate/cfg_wireless_tab"), _("Edit Wireless Configuration"), 130).leaf = true
+ entry({"admin", "services", "travelmate", "advanced", "cfg_network"}, cbi("travelmate/cfg_network_tab"), _("Edit Network Configuration"), 140).leaf = true
+ entry({"admin", "services", "travelmate", "advanced", "cfg_firewall"}, cbi("travelmate/cfg_firewall_tab"), _("Edit Firewall Configuration"), 150).leaf = true
+end
- entry({"admin", "services", "travelmate"}, cbi("travelmate"), _("Travelmate"), 60)
+function logread()
+ local logfile = util.trim(util.exec("logread -e 'travelmate'"))
+ template.render("travelmate/logread", {title = i18n.translate("Travelmate Logfile"), content = logfile})
end