summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-minidlna/luasrc/view
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-04-07 23:38:53 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-04-07 23:38:53 +0000
commit3353616e61d46ca34bbfcb7825a1ffba492ee525 (patch)
tree04979776bd89d989d0f752cd317396940daf6d81 /applications/luci-minidlna/luasrc/view
parent393d85fcab7551f85dc94871faa63e71928b082e (diff)
applications/luci-minidlna: add status output
Diffstat (limited to 'applications/luci-minidlna/luasrc/view')
-rw-r--r--applications/luci-minidlna/luasrc/view/admin_status/index/minidlna.htm1
-rw-r--r--applications/luci-minidlna/luasrc/view/minidlna_status.htm29
2 files changed, 30 insertions, 0 deletions
diff --git a/applications/luci-minidlna/luasrc/view/admin_status/index/minidlna.htm b/applications/luci-minidlna/luasrc/view/admin_status/index/minidlna.htm
new file mode 100644
index 0000000000..b2feeb2efd
--- /dev/null
+++ b/applications/luci-minidlna/luasrc/view/admin_status/index/minidlna.htm
@@ -0,0 +1 @@
+<%+minidlna_status%>
diff --git a/applications/luci-minidlna/luasrc/view/minidlna_status.htm b/applications/luci-minidlna/luasrc/view/minidlna_status.htm
new file mode 100644
index 0000000000..6808245aba
--- /dev/null
+++ b/applications/luci-minidlna/luasrc/view/minidlna_status.htm
@@ -0,0 +1,29 @@
+<script type="text/javascript">//<![CDATA[
+ XHR.poll(5, '<%=luci.dispatcher.build_url("admin/services/minidlna_status")%>', null,
+ function(x, st)
+ {
+ var tb = document.getElementById('minidlna_status');
+ if (st && tb)
+ {
+ if (st.running)
+ {
+ tb.innerHTML = String.format(
+ '<%:%The miniDLNA service is active, serving %d audio, %d video and %d image files.%>',
+ st.audio, st.video, st.image
+ );
+ }
+ else
+ {
+ tb.innerHTML = '<%:The miniDLNA service is not running.%>';
+ }
+ }
+ }
+ );
+//]]></script>
+
+<fieldset class="cbi-section">
+ <legend><%:miniDLNA Status%></legend>
+ <p id="minidlna_status">
+ <em><%:Collecting data...%></em>
+ </p>
+</fieldset>