%#
Material is a clean HTML5 theme for LuCI. It is based on luci-theme-bootstrap and MUI
luci-theme-material
Copyright 2015-2017 Lutty Yang
Have a bug? Please create an issue here on GitHub!
https://github.com/LuttyYang/luci-theme-material/issues
luci-theme-bootstrap:
Copyright 2008 Steven Barth
Copyright 2008-2016 Jo-Philipp Wich
Copyright 2012 David Menting
MUI:
https://github.com/muicss/mui
Licensed to the public under the Apache License 2.0
-%>
<%
local sys = require "luci.sys"
local util = require "luci.util"
local http = require "luci.http"
local disp = require "luci.dispatcher"
function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
local boardinfo = util.ubus("system", "board")
if boardinfo.model == nil then
boardinfo.model = " "
end
if file_exists("/etc/custom") then
file = io.open("/etc/custom", "r")
board = file:read("*line")
model = file:read("*line")
hostname = file:read("*line")
file:close()
else
board = boardinfo.model
model = boardinfo.model
end
local headername = " "
local file = io.open("/etc/header_msg", "r")
if file ~= nil then
line = file:read("*line")
line = line:gsub("", model)
line = line:gsub(" ", " ")
headername = headername .. line
line = file:read("*line")
if line ~= nil then
img_name = resource .. line
else
img_name = resource .. "/img/header.png"
end
file:close()
end
local node = disp.context.dispatched
-- send as HTML5
http.prepare_content("text/html")
-%>
<%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI
- LuCI">
- LuCI">
<% if node and node.css then %>
<% end -%>
<% if css then %>
<% end -%>
">