Skip to content

Commit

Permalink
Merge branch 'feature/lime-webui' into 15.04.1
Browse files Browse the repository at this point in the history
  • Loading branch information
altergui committed Jul 19, 2015
2 parents 1bba479 + 78bc487 commit 6f26719
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
20 changes: 16 additions & 4 deletions packages/lime-webui/src/controller/lime.lua
Expand Up @@ -29,18 +29,30 @@ function index()
root.index = true
-- Main window with auth enabled
status = entry({"lime"}, template("admin_status/index"), "lime", 1)
status = entry({"lime"}, firstchild(), _("Simple Config"), 9.5)
status.dependent = false
status.sysauth = "root"
status.sysauth_authenticator = "htmlauth"
-- Rest of entries
entry({"lime","status"}, template("admin_status/index"), "Status", 2).dependent=false
entry({"lime","essentials"}, cbi("lime/essentials"), "Essentials", 3).dependent=false
entry({"lime","about"}, call("action_about"), "About", 9).dependent=false
entry({"lime","essentials"}, cbi("lime/essentials"), _("Advanced"), 70).dependent=false
entry({"lime","about"}, call("action_about"), _("About"), 80).dependent=false
entry({"lime","logout"}, call("action_logout"), _("Logout"), 90)
end
function action_about()
-- package.path = package.path .. ";/etc/lime/?.lua"
luci.template.render("lime/about",{})
end
function action_logout()
local dsp = require "luci.dispatcher"
local sauth = require "luci.sauth"
if dsp.context.authsession then
sauth.kill(dsp.context.authsession)
dsp.context.urltoken.stok = nil
end
luci.http.header("Set-Cookie", "sysauth=; path=" .. dsp.build_url())
luci.http.redirect(luci.dispatcher.build_url())
end
4 changes: 2 additions & 2 deletions packages/lime-webui/src/model/essentials.lua
Expand Up @@ -34,8 +34,8 @@ wifi.addremove = true
system:option(Value,"hostname",translate("Hostname"),translate("Name for this node"))
-- network
network:option(Value,"main_ipv4",translate("Main IPv4"),translate("The main IPv4 configured for this node"))
network:option(Value,"main_ipv6",translate("Main IPv6"),translate("The main IPv6 configured for this node"))
network:option(Value,"main_ipv4_address",translate("Main IPv4"),translate("The main IPv4 configured for this node, with slash notation (for ex. 1.2.3.4/24)"))
network:option(Value,"main_ipv6_address",translate("Main IPv6"),translate("The main IPv6 configured for this node, with slash notation (for ex. 2001:db8::1/64)"))
-- wifi
wifi:option(Value,"public_essid",translate("Public SSID"),translate("The SSID (WiFi network name) used for this node"))
Expand Down
Expand Up @@ -518,6 +518,7 @@ <h2><a id="content" name="content"><%:Status%></a></h2>
<legend><%:System%></legend>

<table width="100%" cellspacing="10">
<tr><td width="33%"><%:Hostname%></td><td><%=luci.sys.hostname() or "?"%></td></tr>
<tr><td width="33%"><%:Model%></td><td><%=pcdata(model or "?")%></td></tr>
<tr><td width="33%"><%:Firmware Version%></td><td>
<%=pcdata(luci.version.distname)%> <%=pcdata(luci.version.distversion)%> /
Expand Down

0 comments on commit 6f26719

Please sign in to comment.