1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <%-
- local fs = require 'luci.fs'
- local uci = require('luci.model.uci').cursor()
- local util = require 'luci.util'
- local site = require 'gluon.site_config'
- local sysconfig = require 'gluon.sysconfig'
- local platform = require 'gluon.platform'
- local keys = {
- hostname = 'Hostname',
- primary_mac = 'MAC-Adresse',
- model = 'Hardware-Modell',
- version = 'Gluon-Version',
- release = 'Firmware-Release',
- site = 'Site',
- pubkey = 'Öffentlicher VPN-Schlüssel',
- }
- local values = {
- hostname = uci:get_first('system', 'system', 'hostname'),
- primary_mac = sysconfig.primary_mac,
- model = platform.get_model(),
- version = util.trim(fs.readfile('/lib/gluon/gluon-version')),
- release = util.trim(fs.readfile('/lib/gluon/release')),
- site = site.site_name,
- pubkey = 'n/a',
- }
- local meshvpn_enabled = uci:get("fastd", "mesh_vpn", "enabled", "0")
- if meshvpn_enabled == "1" then
- local pubkey = util.trim(util.exec('/etc/init.d/fastd show_key mesh_vpn'))
- if pubkey ~= '' then
- values.pubkey = pubkey
- end
- end
- -%>
- <h2>Info</h2>
- <% for _, key in ipairs({'hostname', 'primary_mac', 'model', 'version', 'release', 'site', 'pubkey'}) do %>
- <div class="cbi-value">
- <div class="cbi-value-title"><%=keys[key]%></div><div class="cbi-value-field"><%=values[key] or 'n/a'%></div>
- </div>
- <% end %>
|