2 Copyright
2008 Steven Barth
<steven@midlink.org
>
3 Copyright
2008-
2018 Jo-Philipp Wich
<jo@mein.io
>
4 Licensed to the public under the Apache License
2.0.
9 <h2 name=
"content"><%:Status%
></h2>
12 <div class=
"spinning"><%:Loading view…%
></div>
15 <script type=
"text/javascript">//<![CDATA[
16 function progressbar(query, value, max, byte)
18 var pg = document.querySelector(query),
19 vn = parseInt(value) ||
0,
20 mn = parseInt(max) ||
100,
21 fv = byte ? String.format('%
1024.2mB', value) : value,
22 fm = byte ? String.format('%
1024.2mB', max) : max,
23 pc = Math.floor((
100 / mn) * vn);
26 pg.firstElementChild.style.width = pc + '%';
27 pg.setAttribute('title', '%s / %s (%d%%)'.format(fv, fm, pc));
31 function renderBox(title, active, childs) {
32 childs = childs || [];
33 childs.unshift(L.itemlist(E('span'), [].slice.call(arguments,
3)));
35 return E('div', { class: 'ifacebox' }, [
36 E('div', { class: 'ifacebox-head center ' + (active ? 'active' : '') },
38 E('div', { class: 'ifacebox-body left' }, childs)
42 function renderBadge(icon, title) {
43 return E('span', { class: 'ifacebadge' }, [
44 E('img', { src: icon, title: title || '' }),
45 L.itemlist(E('span'), [].slice.call(arguments,
2))
51 <div class=
"includes" style=
"display:none">
53 local util = require
"luci.util"
54 local fs = require
"nixio.fs"
56 local incdir = util.libpath() ..
"/view/admin_status/index/"
57 if fs.access(incdir) then
60 for inc in fs.dir(incdir) do
61 if inc:match(
"%.htm$") then
62 includes[#includes +
1] = inc:gsub(
"%.htm$",
"")
65 for _, inc in luci.util.vspairs(includes) do
66 include(
"admin_status/index/" .. inc)
72 <script type=
"text/javascript">L.require('view.status.index').catch(function(err) {
73 L.dom.content(document.querySelector('#view'), null);