summaryrefslogtreecommitdiffhomepage
path: root/applications
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-04-07 23:39:27 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-04-07 23:39:27 +0000
commit62d83c80eadcbb6b0cc8abc96c680b2f2cd9b077 (patch)
tree1558d90480694517b395f5bb110f34039e2d5aed /applications
parent3353616e61d46ca34bbfcb7825a1ffba492ee525 (diff)
applications/luci-minidlna: fix whitespace in controller, add status display to cbi map
Diffstat (limited to 'applications')
-rw-r--r--applications/luci-minidlna/luasrc/controller/minidlna.lua14
-rw-r--r--applications/luci-minidlna/luasrc/model/cbi/minidlna.lua2
2 files changed, 9 insertions, 7 deletions
diff --git a/applications/luci-minidlna/luasrc/controller/minidlna.lua b/applications/luci-minidlna/luasrc/controller/minidlna.lua
index c775bdd24..5b9d62ef1 100644
--- a/applications/luci-minidlna/luasrc/controller/minidlna.lua
+++ b/applications/luci-minidlna/luasrc/controller/minidlna.lua
@@ -30,15 +30,15 @@ end
function minidlna_status()
local sys = require "luci.sys"
- local uci = require "luci.model.uci".cursor()
- local port = tonumber(uci:get_first("minidlna", "minidlna", "port"))
+ local uci = require "luci.model.uci".cursor()
+ local port = tonumber(uci:get_first("minidlna", "minidlna", "port"))
- local status = {
+ local status = {
running = (sys.call("pidof minidlna >/dev/null") == 0),
- audio = 0,
- video = 0,
- image = 0
- }
+ audio = 0,
+ video = 0,
+ image = 0
+ }
if status.running then
local fd = sys.httpget("http://127.0.0.1:%d/" % (port or 8200), true)
diff --git a/applications/luci-minidlna/luasrc/model/cbi/minidlna.lua b/applications/luci-minidlna/luasrc/model/cbi/minidlna.lua
index 051e35521..820569261 100644
--- a/applications/luci-minidlna/luasrc/model/cbi/minidlna.lua
+++ b/applications/luci-minidlna/luasrc/model/cbi/minidlna.lua
@@ -15,6 +15,8 @@ $Id$
m = Map("minidlna", translate("miniDLNA"),
translate("MiniDLNA is server software with the aim of being fully compliant with DLNA/UPnP-AV clients."))
+m:section(SimpleSection).template = "minidlna_status"
+
s = m:section(TypedSection, "minidlna", "miniDLNA Settings")
s.addremove = false
s.anonymous = true