diff --git a/modules/admin-mini/luasrc/model/cbi/mini/index.lua b/modules/admin-mini/luasrc/model/cbi/mini/index.lua index 71b5daf..cc5816f 100644 --- a/modules/admin-mini/luasrc/model/cbi/mini/index.lua +++ b/modules/admin-mini/luasrc/model/cbi/mini/index.lua @@ -11,4 +11,15 @@ You may obtain a copy of the License at $Id$ ]]-- + +if nixio.fs.access("/bin/opkg") then + local ipkg = require("luci.model.ipkg") + local update = luci.http.formvalue("update") + if update then + ipkg.update() + ipkg.install("luci-mod-admin-full") + nixio.fs.unlink("/tmp/luci-indexcache") + end +end + return Template("mini/index") diff --git a/modules/admin-mini/luasrc/view/mini/index.htm b/modules/admin-mini/luasrc/view/mini/index.htm index c14d3b0..52dcf76 100644 --- a/modules/admin-mini/luasrc/view/mini/index.htm +++ b/modules/admin-mini/luasrc/view/mini/index.htm @@ -12,7 +12,35 @@ You may obtain a copy of the License at $Id$ -%> +<%- +local opkg = require "luci.model.ipkg" +local fs = require "nixio.fs" +local fstat = fs.statvfs(opkg.overlay_root()) +local wa = require "luci.tools.webadmin" +local space_total = fstat and fstat.blocks or 0 +local space_free = fstat and fstat.bfree or 0 +local space_used = space_total - space_free + +local used_perc = math.floor(0.5 + ((space_total > 0) and ((100 / space_total) * space_used) or 100)) +local free_byte = space_free * fstat.frsize + +-%>
<%:Install LUCI-MOD-ADMIN-FULL%>
+ + +<%- end -%><%_This is the administration area of LuCI.%>
<%_LuCI is a free, flexible, and user friendly graphical interface for configuring OpenWrt.%>
<%:On the following pages you can adjust all important settings of this device.%>