From 8687547e47b7c90099013b903e89113300903d27 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Thu, 29 May 2008 18:27:12 +0000 Subject: [PATCH] * Bugfixes * Moved cbi.js into the right directory * Added more debugging to dispatcher * Introduced about page --- THANKYOU | 5 +- .../www/{ => luci-static}/resources/cbi.js | 0 libs/web/luasrc/dispatcher.lua | 9 +- modules/admin-core/luasrc/view/about.htm | 27 ++++ modules/admin-core/luasrc/view/footer.htm | 8 +- modules/admin-core/luasrc/view/header.htm | 138 +----------------- .../luasrc/view/themes/fledermaus/footer.htm | 7 + .../luasrc/view/themes/fledermaus/header.htm | 137 +++++++++++++++++ .../www/luci-static/fledermaus/cascade.css | 6 - 9 files changed, 185 insertions(+), 152 deletions(-) rename libs/cbi/root/www/{ => luci-static}/resources/cbi.js (100%) create mode 100644 modules/admin-core/luasrc/view/about.htm create mode 100644 themes/fledermaus/luasrc/view/themes/fledermaus/footer.htm create mode 100644 themes/fledermaus/luasrc/view/themes/fledermaus/header.htm diff --git a/THANKYOU b/THANKYOU index 4e0712f9c..2bf567bfb 100644 --- a/THANKYOU +++ b/THANKYOU @@ -7,4 +7,7 @@ I'd like to thank the following people for contributing to this software: - for donating a Linksys WRT54GL for development purposes * Mickey (Freifunk Hannover) - - for his feedback and fixes for the OpenWRT builds \ No newline at end of file + - for his feedback and fixes for the OpenWRT builds + +* nbd (OpenWRT) + - for his work on OpenWRT integration and lua modules \ No newline at end of file diff --git a/libs/cbi/root/www/resources/cbi.js b/libs/cbi/root/www/luci-static/resources/cbi.js similarity index 100% rename from libs/cbi/root/www/resources/cbi.js rename to libs/cbi/root/www/luci-static/resources/cbi.js diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua index fc551a4bd..d075975da 100644 --- a/libs/web/luasrc/dispatcher.lua +++ b/libs/web/luasrc/dispatcher.lua @@ -220,11 +220,18 @@ function createtree() if not built_index then createindex() end + + require("luci.i18n") for k, v in pairs(index) do luci.util.updfenv(v, _M) luci.util.extfenv(v, "_NAME", k) - pcall(v) + + local stat, err = pcall(v) + if not stat then + error500(err) + os.exit(1) + end end built_tree = true diff --git a/modules/admin-core/luasrc/view/about.htm b/modules/admin-core/luasrc/view/about.htm new file mode 100644 index 000000000..48a8674e0 --- /dev/null +++ b/modules/admin-core/luasrc/view/about.htm @@ -0,0 +1,27 @@ +<%+header%> +

<%:about Über%> Luci

+

<%:lucidesc Luci ist eine freie Lua-Bibliothek mit integriertem MVC-Webframework und Weboberfläche für eingebettete Geräte, +speziell Netzwerkrouter unter OpenWRT. Luci steht unter der Apache-Lizenz.%>

+ +

<%:projecthome Projekt-Homepage%>: luci.freifunk-halle.net

+ +
+

<%:leaddev Leitende Entwicklung%>

+ +
+ +

<%:contributors Mitwirkende Entwickler%>

+ +
+ +

<%:thanksto Dank an%>

+ +<%+footer%> \ No newline at end of file diff --git a/modules/admin-core/luasrc/view/footer.htm b/modules/admin-core/luasrc/view/footer.htm index 4de7bbab0..645e2f494 100644 --- a/modules/admin-core/luasrc/view/footer.htm +++ b/modules/admin-core/luasrc/view/footer.htm @@ -1,7 +1 @@ - -
- - -
<%=require("luci").__appname__ .. " " .. luci.__version__%> - Lua Configuration Interface
- - \ No newline at end of file +<% include("themes/" .. luci.fs.basename(media) .. "/footer") %> \ No newline at end of file diff --git a/modules/admin-core/luasrc/view/header.htm b/modules/admin-core/luasrc/view/header.htm index 5f876781f..1a7780f70 100644 --- a/modules/admin-core/luasrc/view/header.htm +++ b/modules/admin-core/luasrc/view/header.htm @@ -1,137 +1 @@ -<% -require("luci.sys") -local load1, load5, load15 = luci.sys.loadavg() - -local request = require("luci.dispatcher").request -local category = request[1] -local tree = luci.dispatcher.node() -local cattree = category and luci.dispatcher.node(category) -local node = luci.dispatcher.dispatched - -local c = tree -for i,r in ipairs(request) do - if c.nodes and c.nodes[r] then - c = c.nodes[r] - c._menu_selected = true - end -end - -require("luci.i18n").loadc("default") - -require("luci.http").prepare_content("text/html") -%> - - - - - <% if node and node.css then %><% end %> - - - LuCI - Lua Configuration Interface - - - - -
-<%:path Pfad%>: <% -local c = tree -local url = controller -for k,v in pairs(request) do - if c.nodes and c.nodes[v] then - c = c.nodes[v] - url = url .. "/" .. v - %><%=c.title or v%> <% if k ~= #request then %>» <% end - end -end -%> -
- -
- -<% end - end -end -%> -
- -
\ No newline at end of file +<% include("themes/" .. luci.fs.basename(media) .. "/header") %> \ No newline at end of file diff --git a/themes/fledermaus/luasrc/view/themes/fledermaus/footer.htm b/themes/fledermaus/luasrc/view/themes/fledermaus/footer.htm new file mode 100644 index 000000000..4de7bbab0 --- /dev/null +++ b/themes/fledermaus/luasrc/view/themes/fledermaus/footer.htm @@ -0,0 +1,7 @@ +
+
+
+ +
<%=require("luci").__appname__ .. " " .. luci.__version__%> - Lua Configuration Interface
+ + \ No newline at end of file diff --git a/themes/fledermaus/luasrc/view/themes/fledermaus/header.htm b/themes/fledermaus/luasrc/view/themes/fledermaus/header.htm new file mode 100644 index 000000000..5f876781f --- /dev/null +++ b/themes/fledermaus/luasrc/view/themes/fledermaus/header.htm @@ -0,0 +1,137 @@ +<% +require("luci.sys") +local load1, load5, load15 = luci.sys.loadavg() + +local request = require("luci.dispatcher").request +local category = request[1] +local tree = luci.dispatcher.node() +local cattree = category and luci.dispatcher.node(category) +local node = luci.dispatcher.dispatched + +local c = tree +for i,r in ipairs(request) do + if c.nodes and c.nodes[r] then + c = c.nodes[r] + c._menu_selected = true + end +end + +require("luci.i18n").loadc("default") + +require("luci.http").prepare_content("text/html") +%> + + + + + <% if node and node.css then %><% end %> + + + LuCI - Lua Configuration Interface + + + + +
+<%:path Pfad%>: <% +local c = tree +local url = controller +for k,v in pairs(request) do + if c.nodes and c.nodes[v] then + c = c.nodes[v] + url = url .. "/" .. v + %><%=c.title or v%> <% if k ~= #request then %>» <% end + end +end +%> +
+ +
+ +<% end + end +end +%> +
+ +
\ No newline at end of file diff --git a/themes/fledermaus/root/www/luci-static/fledermaus/cascade.css b/themes/fledermaus/root/www/luci-static/fledermaus/cascade.css index 5920254c7..c8bb21d6d 100644 --- a/themes/fledermaus/root/www/luci-static/fledermaus/cascade.css +++ b/themes/fledermaus/root/www/luci-static/fledermaus/cascade.css @@ -194,12 +194,6 @@ code { white-space: pre; } -table th, table, td { - vertical-align: top; - text-align: left; - border: 1px solid gray; -} - .cbi-section { margin-top: 1em; } -- 2.25.1