From c9d083f52384c2a52c303924de3960705c7c945b Mon Sep 17 00:00:00 2001 From: bdobe Date: Tue, 4 Oct 2016 19:47:36 +0200 Subject: [PATCH] gluon-config-mode-reboot-ffhh: Use a "pretty" hostname --- .../config-mode/reboot/0101-nopubkey.lua | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/gluon-config-mode-reboot-ffhh/files/lib/gluon/config-mode/reboot/0101-nopubkey.lua b/gluon-config-mode-reboot-ffhh/files/lib/gluon/config-mode/reboot/0101-nopubkey.lua index 3aa2c85..169c532 100644 --- a/gluon-config-mode-reboot-ffhh/files/lib/gluon/config-mode/reboot/0101-nopubkey.lua +++ b/gluon-config-mode-reboot-ffhh/files/lib/gluon/config-mode/reboot/0101-nopubkey.lua @@ -4,18 +4,26 @@ local meshvpn_enabled = uci:get("fastd", "mesh_vpn", "enabled", "0") if meshvpn_enabled == "1" then return nil else + local gluon_luci = require 'gluon.luci' local i18n = require "luci.i18n" local site = require 'gluon.site_config' local sysconfig = require 'gluon.sysconfig' - local hostname = uci:get_first("system", "system", "hostname") + local pretty_hostname = require 'pretty_hostname' + + local hostname = pretty_hostname.get(uci) local msg = [[

]] .. i18n.translate('gluon-config-mode:nopubkey') .. [[

]] return function () - luci.template.render_string(msg, { hostname=hostname - , site=site - , sysconfig=sysconfig - }) - end + luci.template.render_string(msg, + { + hostname=hostname, + site=site, + sysconfig=sysconfig, + escape = gluon_luci.escape, + urlescape = gluon_luci.urlescape, + } + ) + end end