From 7043c30e0e55bbbfacdddf97619b6bae96d20ddb Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 11 Jun 2014 13:29:05 +0000 Subject: build: introduce luci-base Merges libs/core, libs/ipkg, libs/web, libs/sys, libs/sgi-cgi, libs/sgi-uhttpd, modules/admin-core, themes/base and protcols/core into modules/base and renames luci-lib-core to luci-base. --- modules/base/luasrc/view/error404.htm | 19 +++++++++ modules/base/luasrc/view/error500.htm | 19 +++++++++ modules/base/luasrc/view/footer.htm | 15 +++++++ modules/base/luasrc/view/header.htm | 21 +++++++++ modules/base/luasrc/view/indexer.htm | 15 +++++++ modules/base/luasrc/view/sysauth.htm | 80 +++++++++++++++++++++++++++++++++++ 6 files changed, 169 insertions(+) create mode 100644 modules/base/luasrc/view/error404.htm create mode 100644 modules/base/luasrc/view/error500.htm create mode 100644 modules/base/luasrc/view/footer.htm create mode 100644 modules/base/luasrc/view/header.htm create mode 100644 modules/base/luasrc/view/indexer.htm create mode 100644 modules/base/luasrc/view/sysauth.htm (limited to 'modules/base/luasrc/view') diff --git a/modules/base/luasrc/view/error404.htm b/modules/base/luasrc/view/error404.htm new file mode 100644 index 0000000000..813604d12c --- /dev/null +++ b/modules/base/luasrc/view/error404.htm @@ -0,0 +1,19 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +-%> +<%+header%> +

404 <%:Not Found%>

+

<%:Sorry, the object you requested was not found.%>

+<%:Unable to dispatch%>: <%=luci.http.request.env.PATH_INFO%> +<%+footer%> diff --git a/modules/base/luasrc/view/error500.htm b/modules/base/luasrc/view/error500.htm new file mode 100644 index 0000000000..14ba0410a4 --- /dev/null +++ b/modules/base/luasrc/view/error500.htm @@ -0,0 +1,19 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +-%> +<%+header%> +

500 <%:Internal Server Error%>

+

<%:Sorry, the server encountered an unexpected error.%>

+
<%=message%>
+<%+footer%> diff --git a/modules/base/luasrc/view/footer.htm b/modules/base/luasrc/view/footer.htm new file mode 100644 index 0000000000..6c6d214210 --- /dev/null +++ b/modules/base/luasrc/view/footer.htm @@ -0,0 +1,15 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +-%> +<% include("themes/" .. theme .. "/footer") %> \ No newline at end of file diff --git a/modules/base/luasrc/view/header.htm b/modules/base/luasrc/view/header.htm new file mode 100644 index 0000000000..77018b1173 --- /dev/null +++ b/modules/base/luasrc/view/header.htm @@ -0,0 +1,21 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +-%> + +<% + if not luci.dispatcher.context.template_header_sent then + include("themes/" .. theme .. "/header") + luci.dispatcher.context.template_header_sent = true + end +%> diff --git a/modules/base/luasrc/view/indexer.htm b/modules/base/luasrc/view/indexer.htm new file mode 100644 index 0000000000..c628289711 --- /dev/null +++ b/modules/base/luasrc/view/indexer.htm @@ -0,0 +1,15 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +-%> +<% include("themes/" .. theme .. "/indexer") %> \ No newline at end of file diff --git a/modules/base/luasrc/view/sysauth.htm b/modules/base/luasrc/view/sysauth.htm new file mode 100644 index 0000000000..7c39f0da51 --- /dev/null +++ b/modules/base/luasrc/view/sysauth.htm @@ -0,0 +1,80 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008-2012 Jo-Philipp Wich + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +-%> + +<%+header%> + +
"> +
+

<%:Authorization Required%>

+
+ <%:Please enter your username and password.%> + <%- if fuser then %> +
<%:Invalid username and/or password! Please try again.%>
+
+ <% end -%> +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ + +
+
+ + +<% +local uci = require "luci.model.uci".cursor() +local fs = require "nixio.fs" +local https_key = uci:get("uhttpd", "main", "key") +local https_port = uci:get("uhttpd", "main", "listen_https") +if type(https_port) == "table" then + https_port = https_port[1] +end + +if https_port and fs.access(https_key) then + https_port = https_port:match("(%d+)$") +%> + + + +<% end %> + +<%+footer%> -- cgit v1.2.3