luci-theme-argon: sync with upstream source

This commit is contained in:
CN_SZTL 2020-08-22 01:46:11 +08:00
parent 14e2d9810e
commit 3be8f81a51
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
5 changed files with 49 additions and 32 deletions

View File

@ -7,14 +7,15 @@
include $(TOPDIR)/rules.mk
LUCI_TITLE:=Argon Theme
LUCI_DEPENDS:=+luasocket
PKG_VERSION:=2.2.3
PKG_RELEASE:=20200820
LUCI_DEPENDS:=
PKG_VERSION:=2.2.4
PKG_RELEASE:=20200821
include $(TOPDIR)/feeds/luci/luci.mk
define Package/luci-theme-argon/postinst
#!/bin/sh
sed -i ":a;$!N;s/tmpl.render.*sysauth_template.*return/local scope = { duser = default_user, fuser = user }\nlocal ok, res = luci.util.copcall\(luci.template.render_string, [[<% include\(\"themes\/\" .. theme .. \"\/sysauth\"\) %>]], scope\)\nif ok then\nreturn res\nend\nreturn luci.template.render\(\"sysauth\", scope\)/;ba" /usr/lib/lua/luci/dispatcher.lua
[ -f /usr/lib/lua/luci/view/themes/argon/out_header_login.htm ] && mv -f /usr/lib/lua/luci/view/themes/argon/out_header_login.htm /usr/lib/lua/luci/view/header_login.htm
rm -Rf /var/luci-modulecache
rm -Rf /var/luci-indexcache

View File

@ -330,6 +330,18 @@ hr {
.login-page .volume-control.mute {
background-image: url(../img/volume_off.svg);
}
.login-page .main-bg {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-image: url(../img/blank.png);
background-repeat: no-repeat;
background-position: center;
background-size: cover;
transition: all 0.5s;
}
.login-page .login-container {
height: 100%;
margin-left: 4.5rem;

View File

@ -392,6 +392,19 @@ hr {
}
}
.main-bg{
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-image: url(../img/blank.png);
background-repeat: no-repeat;
background-position: center;
background-size: cover;
transition: all 0.5s;
}
.login-container {
height: 100%;
margin-left: 4.5rem;

View File

@ -43,5 +43,4 @@
</script>
<script src="<%=media%>/js/script.js"></script>
</body>
</html>
</html>

View File

@ -71,7 +71,6 @@
</video>
</div>
<div class="volume-control mute"></div>
<script>
$(".volume-control").click(function(){
if($(this).hasClass("mute")){
@ -83,6 +82,25 @@
}
})
</script>
<% else %>
<div class="main-bg" id="main-bg"
<%
if (bgcount == 0 ) then
local http = require "luci.sys"
local json = require "luci.jsonc"
local bg_url = media .. "/img/bg1.jpg"
local bing = http.httpget("http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US")
if (bing and bing ~= '') then
local bingjson = json.parse(bing)
bg_url = "https://www.bing.com" .. bingjson.images[1].url
end
%>
style="background-image:url(<%=bg_url%>)"
<% elseif (bgcount > 0 and currentBg["type"] ~= "mp4") then %>
style="background-image:url(<%=currentBg.url%>)"
<% end %>
></div>
<% end %>
<div class="login-container">
<div class="login-form">
@ -115,32 +133,6 @@
input.focus();
//]]></script>
<%
if (bgcount == 0 ) then
local bingjson = "{}"
local http = require "socket.http"
local bing = http.request("http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US")
if (bing and bing ~= '') then
bingjson = bing
end
%>
<script type="text/javascript">//<![CDATA[
try {
var bing = <%=bingjson%>;
var bg = "https://www.bing.com" + bing.images[0].url;
$(".login-page").css("background-image", "url(" + bg + ")");
} catch{
console.log("can not access bing api");
$(".login-page").css("background-image", "url(<%=media%>/img/bg1.jpg)");
}
//]]></script>
<% elseif (bgcount > 0 and currentBg["type"] ~= "mp4") then%>
<script type="text/javascript">//<![CDATA[
console.log("can not access bing api");
$(".login-page").css("background-image", "url(<%=currentBg.url%>)");
//]]></script>
<%
end
local uci = require "luci.model.uci".cursor()
local fs = require "nixio.fs"
local https_key = uci:get("uhttpd", "main", "key")