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)
function index()
local uci_state = luci.model.uci.cursor_state()
local configmode = uci_state:get_first("gluon-config-mode", "wizard", "running", "0") == "1"
local uci_state = luci.model.uci.cursor_state()
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()
if not root.lock then
@ -25,18 +30,21 @@ function index()
root.index = true
end
local page = entry({"admin"}, alias("admin", "index"), _("Expertmode"), 10)
local page = entry({"admin"}, alias("admin", "index"), _("Expertmode"), 10)
page.sysauth = "root"
if configmode then
-- force root to be logged in when running in configmode
page.sysauth_authenticator = function() return "root" end
else
page.sysauth_authenticator = "htmlauth"
end
if configmode then
-- force root to be logged in when running in configmode
page.sysauth_authenticator = function() return "root" end
else
page.sysauth_authenticator = "htmlauth"
end
page.index = 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
function action_logout()

View File

@ -13,8 +13,7 @@ $Id$
-%>
<%+header%>
<h2><a id="content" name="content"><%:System%></a></h2>
<h3><%:Backup / Restore%></h3>
<h2><a id="content" name="content"><%:Backup / Restore%></a></h2>
<p><%:Here you can backup and restore your configuration and - if possible - reset this device to the default settings.%></p>
<br />
<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>
<p><%_This is the administration area of <abbr title="Lua Configuration Interface">LuCI</abbr>.%></p>
<p><%_<abbr title="Lua Configuration Interface">LuCI</abbr> is a free, flexible, and user friendly graphical interface for configuring OpenWrt.%><br />
<%:On the following pages you can adjust all important settings of this device.%></p>
<p><%:As we always want to improve this interface we are looking forward to your feedback and suggestions.%></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>
<p>Dies ist der Experten-Modus deines Freifunkknotens.</p>
<p>Hier kannst du weitere Einstellungen vornehmen, Firmware Upates
einspielen und auch vieles kaputt machen.</p>
<p>Sei bitte vorsichtig!</p>

View File

@ -13,8 +13,7 @@ $Id$
-%>
<%+header%>
<h2><a id="content" name="content"><%:System%></a></h2>
<h3><%:Reboot%></h3>
<h2><a id="content" name="content"><%:Reboot%></a></h2>
<p><%:Reboots the operating system of your device%></p>
<%-
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>
<%- else -%>
<p><%:Please wait: Device rebooting...%></p>
<script type="text/javascript">setTimeout("location='<%=controller%>'", 60000)</script>
<%- end -%>
<%+footer%>

View File

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