gluon-config-mode: convert templates to use the new site config

This commit is contained in:
Matthias Schiffer 2014-05-14 13:23:15 +02:00
parent df315034db
commit dfd3eedcf8
4 changed files with 16 additions and 25 deletions

View File

@ -4,8 +4,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-config-mode PKG_NAME:=gluon-config-mode
PKG_VERSION:=1 PKG_VERSION:=2
PKG_RELEASE:=1.$(GLUON_CONFIG_VERSION)
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
@ -34,7 +33,6 @@ endef
define Package/gluon-config-mode/install define Package/gluon-config-mode/install
$(CP) ./files/* $(1)/ $(CP) ./files/* $(1)/
$(GLUON_GENERATE) ./generate/* $(1)/
endef endef
$(eval $(call BuildPackage,gluon-config-mode)) $(eval $(call BuildPackage,gluon-config-mode))

View File

@ -12,8 +12,12 @@ $Id$
module("luci.controller.gluon-config-mode.index", package.seeall) module("luci.controller.gluon-config-mode.index", package.seeall)
local site = require 'gluon.site_config'
local meshvpn_name = "mesh_vpn" local meshvpn_name = "mesh_vpn"
function index() function index()
local uci_state = luci.model.uci.cursor_state() local uci_state = luci.model.uci.cursor_state()
@ -56,11 +60,11 @@ function action_reboot()
uci:save("gluon-config-mode") uci:save("gluon-config-mode")
uci:commit("gluon-config-mode") uci:commit("gluon-config-mode")
hostname = uci:get_first("system", "system", "hostname") local hostname = uci:get_first("system", "system", "hostname")
if nixio.fork() ~= 0 then if nixio.fork() ~= 0 then
luci.template.render("gluon-config-mode/reboot", luci.template.render("gluon-config-mode/reboot",
{pubkey=pubkey, hostname=hostname}) {pubkey=pubkey, hostname=hostname, site=site})
else else
debug.setfenv(io.stdout, debug.getfenv(io.open '/dev/null')) debug.setfenv(io.stdout, debug.getfenv(io.open '/dev/null'))
io.stdout:close() io.stdout:close()

View File

@ -1,6 +1,10 @@
<%-
local site = require 'gluon.site_config'
-%>
<h2>Willkommen!</h2> <h2>Willkommen!</h2>
<p> <p>
@config_mode.msg_welcome@ <%= site.config_mode.msg_welcome %>
</p> </p>
<% if not self.embedded then %> <% if not self.embedded then %>

View File

@ -1,18 +1,3 @@
<%#
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$
-%>
<html> <html>
<head> <head>
<title><%=hostname%> - <% if title then %><%=title%><% else %><%:Rebooting...%><% end %></title> <title><%=hostname%> - <% if title then %><%=title%><% else %><%:Rebooting...%><% end %></title>
@ -25,17 +10,17 @@ $Id$
<% if pubkey then %> <% if pubkey then %>
<fieldset class="cbi-section"> <fieldset class="cbi-section">
<p> <p>
@config_mode.msg_pubkey@ <%= site.config_mode.msg_pubkey %>
</p> </p>
<div class="the-key"> <div class="the-key">
# <%=hostname%> # Hostname: <%= hostname %>
<br/> <br/>
<%=pubkey%> <%= pubkey %>
</div> </div>
</fieldset> </fieldset>
<% end %> <% end %>
<fieldset class="cbi-section"> <fieldset class="cbi-section">
@config_mode.msg_reboot@ <%= site.config_mode.msg_reboot %>
</fieldset> </fieldset>
</div> </div>
</div> </div>