Skip to content

Commit

Permalink
applications/luci-minidlna: fix whitespace in controller, add status …
Browse files Browse the repository at this point in the history
…display to cbi map

git-svn-id: http://svn.luci.subsignal.org/luci/trunk@8527 ab181a69-ba2e-0410-a84d-ff88ab4c47bc
  • Loading branch information
jow committed Apr 7, 2012
1 parent fc31857 commit 7853450
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 7 additions & 7 deletions applications/luci-minidlna/luasrc/controller/minidlna.lua
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions applications/luci-minidlna/luasrc/model/cbi/minidlna.lua
Expand Up @@ -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
Expand Down

0 comments on commit 7853450

Please sign in to comment.