diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2014-12-03 15:17:05 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-01-08 16:26:20 +0100 |
commit | 1bb4822dca6113f73e3bc89e2acf15935e6f8e92 (patch) | |
tree | 35e16f100466e4e00657199b38bb3d87d52bf73f /libs/luci-lib-nixio/axTLS/www/lua/overview.lp | |
parent | 9edd0e46c3f880727738ce8ca6ff1c8b85f99ef4 (diff) |
Rework LuCI build system
* Rename subdirectories to their repective OpenWrt package names
* Make each LuCI module its own standalone package
* Deploy a shared luci.mk which is used by each module Makefile
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'libs/luci-lib-nixio/axTLS/www/lua/overview.lp')
-rw-r--r-- | libs/luci-lib-nixio/axTLS/www/lua/overview.lp | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/libs/luci-lib-nixio/axTLS/www/lua/overview.lp b/libs/luci-lib-nixio/axTLS/www/lua/overview.lp new file mode 100644 index 000000000..4d17002a0 --- /dev/null +++ b/libs/luci-lib-nixio/axTLS/www/lua/overview.lp @@ -0,0 +1,64 @@ +<?lua +-- Tries to load known libraries +for _, t in ipairs { "lxp", "luasql.postgres", "luasql.mysql", "luasql.oci8", "luasql.sqlite", "luasql.odbc", "socket", "xmlrpc", "soap", "lualdap", "logging", "md5", "zip", "stable", "copas", } do + pcall (require, t) +end + +libraries = { "lxp", "luasql", "socket", "xmlrpc", "soap", "lualdap", "logging", "md5", "zip", "stable", "copas", } + +local colors = { "#999999", "#CCCCCC", "#FFFFFF", } +local i = 0 +function color () i = math.mod (i + 1, 3) return colors[i + 1] end + +function pack_name (p) return string.gsub (p, "^([^.]+).-", "%1") end + +function idx (t, f) return _G[t][f] or _G[t]["_"..f] or "" end +?> +<html> +<head><title>CGILua installation overview</title></head> + +<body bgcolor="#FFFFFF"> +<h1>CGILua installation overview</h1> + +<table> + <tr> + <th bgcolor="#999999">Version + <th bgcolor="#999999">Copyright + <th bgcolor="#999999">Description + </tr> +<?lua +local support = { + { "Lua", "_VERSION" }, + { "compat-5.1", "_COMPAT51" }, +} +for _, l in ipairs (support) do bg = color() +?> + <tr> + <td bgcolor = "<%= bg %>"><%= tostring(_G[l[2]]) %> + <td bgcolor = "<%= bg %>"> + <td bgcolor = "<%= bg %>"> + </tr> +<? end ?> + <tr><td colspan="4"></tr> +<?lua +local pack = {} +for i, p in ipairs (libraries) do + local s = _G[p] + local n = pack_name(p) + if type(_G[n]) == "table" and _G[n]._VERSION then + pack[n] = true + table.insert (pack, n) + end +end +table.sort (pack) +for _, p in ipairs (pack) do bg = color() ?> + <tr> + <td bgcolor = "<%= bg %>"><%= idx(p,"VERSION") %> + <td bgcolor = "<%= bg %>"><small><%= idx(p,"COPYRIGHT") %></small> + <td bgcolor = "<%= bg %>"><small><%= idx(p,"DESCRIPTION") %></small> + </tr> +<?lua end ?> +</table> + +</body> +</html> |