diff options
author | Hannu Nyman <hannu.nyman@iki.fi> | 2017-12-09 09:39:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-09 09:39:47 +0200 |
commit | 8e6b1a6d8628d6da4820a4400eddd8a1da84fa27 (patch) | |
tree | 74dee0faba6eafe4bb71c818b4779404a7b3eaaa /applications/luci-app-travelmate | |
parent | 6d086bfb94c5390399941606b4a61569a5c03c5d (diff) | |
parent | c7b39ae08f29f49b8b014054161b8b34a4cda8fb (diff) |
Merge pull request #1468 from dibdot/travelmate
luci-app-travelmate: sync with travelmate 0.9.6
Diffstat (limited to 'applications/luci-app-travelmate')
-rw-r--r-- | applications/luci-app-travelmate/luasrc/controller/travelmate.lua | 14 | ||||
-rw-r--r-- | applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm | 12 |
2 files changed, 16 insertions, 10 deletions
diff --git a/applications/luci-app-travelmate/luasrc/controller/travelmate.lua b/applications/luci-app-travelmate/luasrc/controller/travelmate.lua index a418a8ec6..efbe619a4 100644 --- a/applications/luci-app-travelmate/luasrc/controller/travelmate.lua +++ b/applications/luci-app-travelmate/luasrc/controller/travelmate.lua @@ -3,9 +3,9 @@ module("luci.controller.travelmate", package.seeall) -local fs = require("nixio.fs") -local util = require("luci.util") -local i18n = require("luci.i18n") +local fs = require("nixio.fs") +local util = require("luci.util") +local i18n = require("luci.i18n") local templ = require("luci.template") function index() @@ -30,6 +30,12 @@ function index() end function logread() - local logfile = util.trim(util.exec("logread -e 'travelmate'")) + local logfile + + if nixio.fs.access("/var/log/messages") then + logfile = util.trim(util.exec("cat /var/log/messages | grep 'travelmate'")) + else + logfile = util.trim(util.exec("logread -e 'travelmate'")) + end templ.render("travelmate/logread", {title = i18n.translate("Travelmate Logfile"), content = logfile}) end diff --git a/applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm b/applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm index 402b1c15c..11c36d427 100644 --- a/applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm +++ b/applications/luci-app-travelmate/luasrc/view/travelmate/stations.htm @@ -4,8 +4,8 @@ This is free software, licensed under the Apache License, Version 2.0 -%> <%- - local write = io.write - local uci = require("luci.model.uci").cursor() + local write = io.write + local uci = require("luci.model.uci").cursor() local trmiface = uci:get("travelmate", "global", "trm_iface") or "trm_wwan" -%> @@ -31,10 +31,10 @@ This is free software, licensed under the Apache License, Version 2.0 local iface = s.network or "" if iface == trmiface then local section = s['.name'] or "" - local device = s.device or "" - local ssid = s.ssid or "" - local bssid = s.bssid or "" - local encryption = s.encryption or "" + local device = s.device or "-" + local ssid = s.ssid or "-" + local bssid = s.bssid or "-" + local encryption = s.encryption or "-" local disabled = s.disabled or "" local style = "color:#000000" if disabled == "0" then |