applications/luci-minidlna: fix whitespace in controller, add status display to cbi map

This commit is contained in:
Jo-Philipp Wich 2012-04-07 23:39:27 +00:00
parent 3353616e61
commit 62d83c80ea
2 changed files with 9 additions and 7 deletions

View file

@ -30,15 +30,15 @@ end
function minidlna_status() function minidlna_status()
local sys = require "luci.sys" local sys = require "luci.sys"
local uci = require "luci.model.uci".cursor() local uci = require "luci.model.uci".cursor()
local port = tonumber(uci:get_first("minidlna", "minidlna", "port")) local port = tonumber(uci:get_first("minidlna", "minidlna", "port"))
local status = { local status = {
running = (sys.call("pidof minidlna >/dev/null") == 0), running = (sys.call("pidof minidlna >/dev/null") == 0),
audio = 0, audio = 0,
video = 0, video = 0,
image = 0 image = 0
} }
if status.running then if status.running then
local fd = sys.httpget("http://127.0.0.1:%d/" % (port or 8200), true) local fd = sys.httpget("http://127.0.0.1:%d/" % (port or 8200), true)

View file

@ -15,6 +15,8 @@ $Id$
m = Map("minidlna", translate("miniDLNA"), m = Map("minidlna", translate("miniDLNA"),
translate("MiniDLNA is server software with the aim of being fully compliant with DLNA/UPnP-AV clients.")) 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 = m:section(TypedSection, "minidlna", "miniDLNA Settings")
s.addremove = false s.addremove = false
s.anonymous = true s.anonymous = true