Merge pull request #11 from freifunk-gluon/expertmode

gluon-luci-admin: various changes
This commit is contained in:
Nils Schneider 2014-01-22 12:03:00 -08:00
commit cd822a3a57
5 changed files with 25 additions and 37 deletions

View File

@ -16,8 +16,13 @@ $Id$
module("luci.controller.admin.index", package.seeall) module("luci.controller.admin.index", package.seeall)
function index() function index()
local uci_state = luci.model.uci.cursor_state() local uci_state = luci.model.uci.cursor_state()
local configmode = uci_state:get_first("gluon-config-mode", "wizard", "running", "0") == "1" local configmode = uci_state:get_first("gluon-config-mode", "wizard", "running", "0") == "1"
-- Disable gluon-luci-admin when configmode is not enabled
if not configmode then
return
end
local root = node() local root = node()
if not root.lock then if not root.lock then
@ -25,18 +30,21 @@ function index()
root.index = true root.index = true
end end
local page = entry({"admin"}, alias("admin", "index"), _("Expertmode"), 10) local page = entry({"admin"}, alias("admin", "index"), _("Expertmode"), 10)
page.sysauth = "root" page.sysauth = "root"
if configmode then if configmode then
-- force root to be logged in when running in configmode -- force root to be logged in when running in configmode
page.sysauth_authenticator = function() return "root" end page.sysauth_authenticator = function() return "root" end
else else
page.sysauth_authenticator = "htmlauth" page.sysauth_authenticator = "htmlauth"
end end
page.index = true page.index = true
entry({"admin", "index"}, form("admin/index"), _("Overview"), 1).ignoreindex = true entry({"admin", "index"}, form("admin/index"), _("Overview"), 1).ignoreindex = true
entry({"admin", "logout"}, call("action_logout"), _("Logout"))
if not configmode then
entry({"admin", "logout"}, call("action_logout"), _("Logout"))
end
end end
function action_logout() function action_logout()

View File

@ -13,8 +13,7 @@ $Id$
-%> -%>
<%+header%> <%+header%>
<h2><a id="content" name="content"><%:System%></a></h2> <h2><a id="content" name="content"><%:Backup / Restore%></a></h2>
<h3><%:Backup / Restore%></h3>
<p><%:Here you can backup and restore your configuration and - if possible - reset this device to the default settings.%></p> <p><%:Here you can backup and restore your configuration and - if possible - reset this device to the default settings.%></p>
<br /> <br />
<div> <div>

View File

@ -1,21 +1,5 @@
<%#
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
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$
-%>
<h2><a id="content" name="content"><%:Hello!%></a></h2> <h2><a id="content" name="content"><%:Hello!%></a></h2>
<p><%_This is the administration area of <abbr title="Lua Configuration Interface">LuCI</abbr>.%></p> <p>Dies ist der Experten-Modus deines Freifunkknotens.</p>
<p><%_<abbr title="Lua Configuration Interface">LuCI</abbr> is a free, flexible, and user friendly graphical interface for configuring OpenWrt.%><br /> <p>Hier kannst du weitere Einstellungen vornehmen, Firmware Upates
<%:On the following pages you can adjust all important settings of this device.%></p> einspielen und auch vieles kaputt machen.</p>
<p><%:As we always want to improve this interface we are looking forward to your feedback and suggestions.%></p> <p>Sei bitte vorsichtig!</p>
<p><%:And now have fun with your OpenWrt device!%></p>
<p><em><strong><a href="<%=controller%>/about"><%_The <abbr title="Lua Configuration Interface">LuCI</abbr> Team%></a></strong></em></p>

View File

@ -13,8 +13,7 @@ $Id$
-%> -%>
<%+header%> <%+header%>
<h2><a id="content" name="content"><%:System%></a></h2> <h2><a id="content" name="content"><%:Reboot%></a></h2>
<h3><%:Reboot%></h3>
<p><%:Reboots the operating system of your device%></p> <p><%:Reboots the operating system of your device%></p>
<%- <%-
local c = require("luci.model.uci").cursor():changes() local c = require("luci.model.uci").cursor():changes()
@ -28,6 +27,5 @@ if not reboot then
<p><a href="<%=REQUEST_URI%>?reboot=1"><%:Perform reboot%></a></p> <p><a href="<%=REQUEST_URI%>?reboot=1"><%:Perform reboot%></a></p>
<%- else -%> <%- else -%>
<p><%:Please wait: Device rebooting...%></p> <p><%:Please wait: Device rebooting...%></p>
<script type="text/javascript">setTimeout("location='<%=controller%>'", 60000)</script>
<%- end -%> <%- end -%>
<%+footer%> <%+footer%>

View File

@ -15,8 +15,7 @@ $Id$
<%+header%> <%+header%>
<h2><a id="content" name="content"><%:System%></a></h2> <h2><a id="content" name="content"><%:Flash Firmware%></a></h2>
<h3><%:Flash Firmware%></h3>
<% if step == 1 then %> <% if step == 1 then %>
<% if supported then %> <% if supported then %>