<%# Argon is a clean HTML5 theme for LuCI. It is based on luci-theme-bootstrap and MUI and Argon Template luci-theme-argon Copyright 2020 Jerryk Have a bug? Please create an issue here on GitHub! https://github.com/jerrykuku/luci-theme-argon/issues luci-theme-bootstrap: Copyright 2008 Steven Barth Copyright 2008-2016 Jo-Philipp Wich Copyright 2012 David Menting MUI: https://github.com/muicss/mui Agron Theme https://demos.creative-tim.com/argon-dashboard/index.html Licensed to the public under the Apache License 2.0 -%> <%+header_login%> <% local util = require "luci.util" local uci = require "luci.model.uci".cursor() logosize = uci:get("custom", "logo", "size") if logosize == nil then logosize = "small" end 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) headername = headername .. line line = file:read("*line") line = file:read("*line") linex = file:read("*line") if linex ~= nil then img_name = resource .. linex else img_name = resource .. "/img/tomato.png" end file:close() end local fs = require "nixio.fs" local nutil = require "nixio.util" function glob(...) local iter, code, msg = fs.glob(...) if iter then return nutil.consume(iter) else return nil, code, msg end end function getExtension(str) return str:match(".+%.(%w+)$") end local bgcount = 0 local currentBg = {} local bgs,attr = {} local theme_dir = "/luci-static/background/" for i, f in ipairs(glob("/www" .. theme_dir .. "*")) do attr = fs.stat(f) if attr then local ext = getExtension(fs.basename(f)) if ext == "jpg" or ext == "png" or ext == "gif" or ext == "mp4" then local bg = {} bg.type = ext bg.url = theme_dir .. fs.basename(f) table.insert(bgs,bg) bgcount = bgcount + 1 end end end if bgcount > 0 then currentBg = bgs[math.random(1,bgcount)] end iframe = uci:get("iframe", "login", "logframe") if iframe == nil then iframe = "0" end if iframe == "1" then os.execute("/usr/lib/iframe/update.sh") ifloc = uci:get("iframe", "login", "logtype") ifimg = "/luci-static/img/" .. uci:get("iframe", "login", "logimage") ifr = true else ifr = false end %>