1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-15 03:51:51 +00:00

Merge pull request #78 from Ysurac/develop

sync
This commit is contained in:
suyuan 2021-02-26 21:26:22 +08:00 committed by GitHub
commit 4ac8c7539b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 3206 additions and 1953 deletions

View file

@ -1,28 +1,35 @@
config classify config classify
option direction 'both' option direction 'both'
option proto 'icmp' option proto 'icmp'
option class 'cs5' option class 'cs7'
option comment 'ICMP' option comment 'ICMP'
config classify config classify
option direction 'both' option direction 'both'
option proto 'udp' option proto 'udp'
option class 'cs5' option class 'cs4'
option src_port '53,123,5353' option src_port '53,123,5353'
option comment 'DNS udp and NTP' option comment 'DNS udp and NTP'
config classify config classify
option direction 'both' option direction 'both'
option proto 'tcp' option proto 'tcp'
option class 'cs5' option class 'cs4'
option src_port '53,5353' option src_port '53,5353'
option comment 'DNS tcp' option comment 'DNS tcp'
config classify
option direction 'both'
option proto 'tcp'
option class 'cs4'
option src_port '65500'
option comment 'OMR API'
config classify config classify
option direction 'both' option direction 'both'
option proto 'tcp' option proto 'tcp'
option class 'cs6' option class 'cs6'
option dest_port '65001,65301,65011' option dest_port '65001,65301,65401,65011'
option comment 'OMR vpn' option comment 'OMR vpn'
config classify config classify
@ -32,6 +39,13 @@ config classify
option dest_port '65001,65301' option dest_port '65001,65301'
option comment 'OMR vpn' option comment 'OMR vpn'
config classify
option direction 'both'
option proto 'tcp'
option class 'cs6'
option dest_port '65101,65228'
option comment 'OMR proxy'
config domains config domains
option name 'googlevideo.com' option name 'googlevideo.com'
option class 'cs4' option class 'cs4'

View file

@ -38,10 +38,10 @@ function wizard_add()
local gostatus = true local gostatus = true
-- Force WAN zone firewall members to be a list -- Force WAN zone firewall members to be a list
local fwwan = sys.exec("uci -q get firewall.@zone[1].network") local fwwan = sys.exec("uci -q get firewall.zone_wan.network")
luci.sys.call("uci -q delete firewall.@zone[1].network") luci.sys.call("uci -q delete firewall.zone_wan.network")
for interface in fwwan:gmatch("%S+") do for interface in fwwan:gmatch("%S+") do
luci.sys.call("uci -q add_list firewall.@zone[1].network=" .. interface) luci.sys.call("uci -q add_list firewall.zone_wan.network=" .. interface)
end end
ucic:save("firewall") ucic:save("firewall")
@ -185,7 +185,7 @@ function wizard_add()
luci.sys.call("uci -q commit vnstat") luci.sys.call("uci -q commit vnstat")
-- Dirty way to add new interface to firewall... -- Dirty way to add new interface to firewall...
luci.sys.call("uci -q add_list firewall.@zone[1].network=wan" .. i) luci.sys.call("uci -q add_list firewall.zone_wan.network=wan" .. i)
luci.sys.call("uci -q commit firewall") luci.sys.call("uci -q commit firewall")
luci.sys.call("/etc/init.d/macvlan restart >/dev/null 2>/dev/null") luci.sys.call("/etc/init.d/macvlan restart >/dev/null 2>/dev/null")
@ -217,7 +217,7 @@ function wizard_add()
luci.sys.call("uci -q del_list vnstat.@vnstat[-1].interface=" .. defif) luci.sys.call("uci -q del_list vnstat.@vnstat[-1].interface=" .. defif)
end end
luci.sys.call("uci -q commit vnstat") luci.sys.call("uci -q commit vnstat")
luci.sys.call("uci -q del_list firewall.@zone[1].network=" .. intf) luci.sys.call("uci -q del_list firewall.zone_wan.network=" .. intf)
luci.sys.call("uci -q commit firewall") luci.sys.call("uci -q commit firewall")
gostatus = false gostatus = false
end end

View file

@ -455,6 +455,7 @@ local statuslogo = ucic:get("openmptcprouter","settings","statuslogo") or "openm
var multipath_available = mArray.wans[i].multipath_available; var multipath_available = mArray.wans[i].multipath_available;
var multipath_state = mArray.wans[i].multipath_state; var multipath_state = mArray.wans[i].multipath_state;
var duplicateif = mArray.wans[i].duplicateif; var duplicateif = mArray.wans[i].duplicateif;
var duplicatemac = mArray.wans[i].duplicatemac;
// Generate template // Generate template
if(mArray.openmptcprouter.remote_from_lease == true && mArray.wans.length == 1) if(mArray.openmptcprouter.remote_from_lease == true && mArray.wans.length == 1)
{ {
@ -547,12 +548,12 @@ local statuslogo = ucic:get("openmptcprouter","settings","statuslogo") or "openm
if(gateway == '' && gateway6 == '') if(gateway == '' && gateway6 == '')
{ {
statusMessage += '<%:No gateway defined%>' + '<br />'; statusMessage += '<%:No gateway defined%>' + '<br />';
} else if(gw_ping == 'DOWN') } else if(gateway != '' && gw_ping == 'DOWN')
{ {
statusMessage += '<%:Gateway DOWN%>' + '<br />'; statusMessage += '<%:Gateway DOWN%>' + '<br />';
} else if(gw_ping6 == 'DOWN') } else if(gateway6 != '' && gw_ping6 == 'DOWN')
{ {
statusMessage += '<%:Gateway DOWN%>' + '<br />'; statusMessage += '<%:Gateway IPv6 DOWN%>' + '<br />';
} else if(multipath_available == 'ERROR') } else if(multipath_available == 'ERROR')
{ {
statusMessage += '<%:Multipath seems to be blocked on the connection%>' + '<br />'; statusMessage += '<%:Multipath seems to be blocked on the connection%>' + '<br />';
@ -566,7 +567,7 @@ local statuslogo = ucic:get("openmptcprouter","settings","statuslogo") or "openm
statusMessage += '<%:Wan IP and gateway are identical%>' + '<br />'; statusMessage += '<%:Wan IP and gateway are identical%>' + '<br />';
statusMessageClass = "error"; statusMessageClass = "error";
} }
if (stat == 'Offline' && ip6addr != '' && ipaddr == mArray.wans[i].gateway6) if (stat == 'Offline' && ip6addr != '' && ip6addr == mArray.wans[i].gateway6)
{ {
statusMessage += '<%:Wan IP and gateway are identical%>' + '<br />'; statusMessage += '<%:Wan IP and gateway are identical%>' + '<br />';
statusMessageClass = "error"; statusMessageClass = "error";
@ -595,6 +596,11 @@ local statuslogo = ucic:get("openmptcprouter","settings","statuslogo") or "openm
statusMessage += '<%:Network interface duplicated%>' + '<br />'; statusMessage += '<%:Network interface duplicated%>' + '<br />';
statusMessageClass = "error"; statusMessageClass = "error";
} }
if(duplicatemac)
{
statusMessage += '<%:Network interface MAC address duplicated%>' + '<br />';
statusMessageClass = "error";
}
if(ipv6_discover == 'DETECTED') if(ipv6_discover == 'DETECTED')
{ {
statusMessage += '<%:IPv6 route received%>' + '<br />' statusMessage += '<%:IPv6 route received%>' + '<br />'

View file

@ -372,7 +372,7 @@
<% <%
for _, iface in ipairs(net:get_networks()) do for _, iface in ipairs(net:get_networks()) do
local ifname = iface:name() local ifname = iface:name()
local firewall_lan = luci.util.trim(luci.sys.exec("uci -q get firewall.@zone[0].network | grep " .. ifname)) local firewall_lan = luci.util.trim(luci.sys.exec("uci -q get firewall.zone_lan.network | grep " .. ifname))
if firewall_lan ~= "" then if firewall_lan ~= "" then
%> %>
<h3><%=ifname%></h3> <h3><%=ifname%></h3>
@ -475,7 +475,7 @@
<% <%
for _, iface in ipairs(net:get_networks()) do for _, iface in ipairs(net:get_networks()) do
local ifname = iface:name() local ifname = iface:name()
local firewall_wan = luci.util.trim(luci.sys.exec("uci -q get firewall.@zone[1].network | grep " .. ifname)) local firewall_wan = luci.util.trim(luci.sys.exec("uci -q get firewall.zone_wan.network | grep " .. ifname))
if firewall_wan ~= "" then if firewall_wan ~= "" then
-- local multipath = uci:get("network",ifname,"multipath") -- local multipath = uci:get("network",ifname,"multipath")
@ -943,9 +943,10 @@
</div> </div>
</fieldset> </fieldset>
</div> </div>
<div class="cbi-page-actions"> <div class="cbi-page-actions control-group">
<input type="hidden" name="token" value="<%=token%>" /> <input type="hidden" name="token" value="<%=token%>" />
<input class="cbi-button cbi-button-apply" type="submit" value="<%:Save & Apply%>" /> <input class="cbi-button cbi-button-reset" type="button" value="Reset" onclick="location.href='<%=url('admin/system/openmptcprouter/wizard')%>'" /> <button class="cbi-button cbi-button-apply"><%:Save & Apply%></button>
<button class="cbi-button cbi-button-reset"><%:Reset%></button>
</div> </div>
</form> </form>
<script type="text/javascript">cbi_init();</script> <script type="text/javascript">cbi_init();</script>

View file

@ -1105,6 +1105,7 @@ function interfaces_status()
mArray.wans = {} mArray.wans = {}
mArray.tunnels = {} mArray.tunnels = {}
allintf = {} allintf = {}
allmac = {}
uci:foreach("network", "interface", function (section) uci:foreach("network", "interface", function (section)
local interface = section[".name"] local interface = section[".name"]
@ -1117,6 +1118,7 @@ function interfaces_status()
local enabled = section["auto"] local enabled = section["auto"]
local proto = section["proto"] or "" local proto = section["proto"] or ""
local ipv6 = section["ipv6"] or "0" local ipv6 = section["ipv6"] or "0"
local mac = section ["macaddr"] or ""
--if not ipaddr or not gateway then return end --if not ipaddr or not gateway then return end
-- Don't show if0 in the overview -- Don't show if0 in the overview
@ -1140,6 +1142,16 @@ function interfaces_status()
end end
end end
duplicatemac = false
if mac ~= "" and mac ~= nil and not (section["ifname"] ~= nil and section["ifname"]:match("^@.*")) then
if allmac[mac] then
connectivity = "ERROR"
duplicatemac = true
else
allmac[mac] = true
end
end
--if multipath == "off" and not ifname:match("^tun.*") then return end --if multipath == "off" and not ifname:match("^tun.*") then return end
if multipath == "off" then return end if multipath == "off" then return end
@ -1237,7 +1249,7 @@ function interfaces_status()
if gateway ~= "" then if gateway ~= "" then
local gw_ping_test = "" local gw_ping_test = ""
if ifname ~= "" and ifname ~= nil then if ifname ~= "" and ifname ~= nil then
gw_ping_test = ut.trim(sys.exec("ping -w 1 -c 1 -I " .. ifname .. " " .. gateway .. " | grep '100% packet loss'")) gw_ping_test = ut.trim(sys.exec("ping -w 1 -c 1 -B -I " .. ifname .. " " .. gateway .. " | grep '100% packet loss'"))
else else
gw_ping_test = ut.trim(sys.exec("ping -w 1 -c 1 " .. gateway .. " | grep '100% packet loss'")) gw_ping_test = ut.trim(sys.exec("ping -w 1 -c 1 " .. gateway .. " | grep '100% packet loss'"))
end end
@ -1247,11 +1259,13 @@ function interfaces_status()
connectivity = "WARNING" connectivity = "WARNING"
end end
end end
else
gw_ping = "DOWN"
end end
if gateway6 ~= "" then if gateway6 ~= "" then
local gw_ping6_test = "" local gw_ping6_test = ""
if ifname ~= "" and ifname ~= nil then if ifname ~= "" and ifname ~= nil then
gw_ping6_test = ut.trim(sys.exec("ping -w 1 -c 1 -I " .. ifname .. " " .. gateway6 .. " | grep '100% packet loss'")) gw_ping6_test = ut.trim(sys.exec("ping -w 1 -c 1 -B -I " .. ifname .. " " .. gateway6 .. " | grep '100% packet loss'"))
else else
gw_ping6_test = ut.trim(sys.exec("ping -w 1 -c 1 " .. gateway6 .. " | grep '100% packet loss'")) gw_ping6_test = ut.trim(sys.exec("ping -w 1 -c 1 " .. gateway6 .. " | grep '100% packet loss'"))
end end
@ -1261,6 +1275,8 @@ function interfaces_status()
connectivity = "WARNING" connectivity = "WARNING"
end end
end end
else
gw_ping6 = "DOWN"
end end
end end
if uci:get("openmptcprouter", interface, "manufacturer") == "huawei" then if uci:get("openmptcprouter", interface, "manufacturer") == "huawei" then
@ -1346,6 +1362,10 @@ function interfaces_status()
multipath_available = "NO CHECK" multipath_available = "NO CHECK"
end end
local zonewan = "NO"
if ut.trim(sys.exec("uci -q get firewall.zone_wan.networks | grep '" .. interface .. "'")) ~= "" then
zonewan = "OK"
end
-- Detect if WAN get an IPv6 -- Detect if WAN get an IPv6
local ipv6_discover = "NONE" local ipv6_discover = "NONE"
@ -1449,6 +1469,7 @@ function interfaces_status()
multipath_available = multipath_available, multipath_available = multipath_available,
multipath_state = current_multipath_state, multipath_state = current_multipath_state,
duplicateif = duplicateif, duplicateif = duplicateif,
duplicatemac = duplicatemac,
signal = signal, signal = signal,
operator = operator, operator = operator,
phonenumber = phonenumber, phonenumber = phonenumber,
@ -1457,6 +1478,7 @@ function interfaces_status()
proto = proto, proto = proto,
rx = rx, rx = rx,
tx = tx, tx = tx,
zonewan = zonewan,
} }
if ifname ~= nil and ifname:match("^tun.*") then if ifname ~= nil and ifname:match("^tun.*") then
table.insert(mArray.tunnels, data); table.insert(mArray.tunnels, data);

View file

@ -99,12 +99,15 @@
<input class="cbi-button" value="<%:Edit installed packages%>" onclick="edit_packages()" type="button"> <input class="cbi-button" value="<%:Edit installed packages%>" onclick="edit_packages()" type="button">
</div> </div>
</div> </div>
<!--
<div class="cbi-value cbi-value" id="server_div" style="display:none"> <div class="cbi-value cbi-value" id="server_div" style="display:none">
<label class="cbi-value-title" for="server"><%:Server:%></label> <label class="cbi-value-title" for="server"><%:Server:%></label>
<div class="cbi-value-field"> <div class="cbi-value-field">
<input onclick="edit_server()" class="cbi-button cbi-button-edit" value="" type="button" id="server" name="server"> <input onclick="edit_server()" class="cbi-button cbi-button-edit" value="" type="button" id="server" name="server">
</div> </div>
</div> </div>
-->
<input type="hidden" value="" id="server" name="server">
<div class="cbi-value cbi-value-last"> <div class="cbi-value cbi-value-last">
<div class="cbi-value-field"> <div class="cbi-value-field">
<input class="cbi-button cbi-button-apply" value="<%:Search for upgrades%>" style="display: none" onclick="upgrade_check()" type="button" id="upgrade_button"> <input class="cbi-button cbi-button-apply" value="<%:Search for upgrades%>" style="display: none" onclick="upgrade_check()" type="button" id="upgrade_button">

View file

@ -98,7 +98,7 @@ function setup_ready() {
upgrade_check(); upgrade_check();
} else { } else {
show("#upgrade_button"); show("#upgrade_button");
show("#server_div"); //show("#server_div");
$("#server").value = data.url; $("#server").value = data.url;
} }
} }

View file

@ -8,18 +8,9 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=Argon Theme LUCI_TITLE:=Argon Theme
LUCI_DEPENDS:= LUCI_DEPENDS:=
PKG_VERSION:=2.2.4 PKG_VERSION:=2.2.6
PKG_RELEASE:=20200821 PKG_RELEASE:=20210215
include $(TOPDIR)/feeds/luci/luci.mk 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
exit 0
endef
# call BuildPackage - OpenWrt buildroot signature # call BuildPackage - OpenWrt buildroot signature

View file

@ -1,36 +1,58 @@
# luci-theme-argon ([中文](/README_ZH.md)) <div align="center">
<img src="https://raw.githubusercontent.com/jerrykuku/staff/master/argon_title2.png" >
<h1 align="center">
A new LuCI theme for OpenWrt
</h1>
<h3 align="center">
Argon is a clean HTML5 theme for LuCI. Users may<br>setup their own favorite logins, including beautiful<br>pics and customized mp4 videos.<br><br>
</h3>
[1]: https://img.shields.io/badge/license-MIT-brightgreen.svg <a href="/LICENSE">
[2]: /LICENSE <img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="">
[3]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg </a>
[4]: https://github.com/jerrykuku/luci-theme-argon/pulls
[5]: https://img.shields.io/badge/Issues-welcome-brightgreen.svg
[6]: https://github.com/jerrykuku/luci-theme-argon/issues/new
[7]: https://img.shields.io/badge/release-v2.2.4-blue.svg?
[8]: https://github.com/jerrykuku/luci-theme-argon/releases
[9]: https://img.shields.io/github/downloads/jerrykuku/luci-theme-argon/total
[10]: https://img.shields.io/badge/Contact-telegram-blue
[11]: https://t.me/jerryk6
[![license][1]][2]
[![PRs Welcome][3]][4]
[![Issue Welcome][5]][6]
[![Release Version][7]][8]
[![Release Count][9]][8]
[![Contact Me][10]][11]
![](/Screenshots/screenshot_pc.jpg) <a href="https://github.com/jerrykuku/luci-theme-argon/pulls">
![](/Screenshots/screenshot_phone.jpg) <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="">
</a>
A new Luci theme for LEDE/OpenWRT <a href="https://github.com/jerrykuku/luci-theme-argon/issues/new">
Argon is a clean HTML5 theme for LuCI. It is based on luci-theme-material and Argon Template <img src="https://img.shields.io/badge/Issues-welcome-brightgreen.svg">
</a>
<a href="https://github.com/jerrykuku/luci-theme-argon/releases">
<img src="https://img.shields.io/badge/release-v2.2.5-blue.svg?">
</a>
<a href="https://github.com/jerrykuku/luci-theme-argon/releases">
<img src="https://img.shields.io/github/downloads/jerrykuku/luci-theme-argon/total">
</a>
<a href="https://t.me/jerryk6">
<img src="https://img.shields.io/badge/Contact-telegram-blue">
</a>
</div>
<br>
<div align="center">
<img src="https://raw.githubusercontent.com/jerrykuku/staff/master/argon2.gif">
</div>
<br>English | [简体中文](README_ZH.md)
## Notice ## Notice
It is strongly recommended to use the Chrome browser. Some new css3 features are used in the theme, and currently only Chrome has the best compatibility.
The mainline version of IE series currently has bugs to be resolved.
FireFox does not enable the backdrop-filter by default, see here for the opening method: https://developer.mozilla.org/zh-CN/docs/Web/CSS/backdrop-filter
v2.x.x Adapt to official mainline snapshot. v2.x.x Adapt to official mainline snapshot.
You can checkout branch 18.06 for OpenWRT 18.06 or lean 19.07. You can checkout branch 18.06 for OpenWRT 18.06 or lean 19.07.
## Update log 2020.08.21 v2.2.4 ## Update Log 2020.09.13 v2.2.5
- 【v2.2.5】New config app for argon theme. You can set the blur and transparency of the login page of argon theme, and manage the background pictures and videos.[Chrome is recommended] [Download](https://github.com/jerrykuku/luci-app-argon-config/releases/download/v0.8-beta/luci-app-argon-config_0.8-beta_all.ipk)
- 【v2.2.5】Automatically set as the default theme when compiling.
- 【v2.2.5】Modify the file structure to adapt to luci-app-argon-config. The old method of turning on dark mode is no longer applicable, please use it with luci-app-argon-config.
- 【v2.2.5】Adapt to Koolshare lede 2.3.6。
- 【v2.2.5】Fix some Bug。
- 【v2.2.4】Fix the problem that the login background cannot be displayed on some phones. - 【v2.2.4】Fix the problem that the login background cannot be displayed on some phones.
- 【v2.2.4】Remove the dependency of luasocket. - 【v2.2.4】Remove the dependency of luasocket.
- 【v2.2.3】Fix Firmware flash page display error in dark mode. - 【v2.2.3】Fix Firmware flash page display error in dark mode.
@ -78,16 +100,19 @@ make -j1 V=s
### For Lean openwrt 18.06 LuCI ### For Lean openwrt 18.06 LuCI
``` ```
wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v1.6.9/luci-theme-argon_1.6.9-20200821_all.ipk wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v1.7.0/luci-theme-argon_1.7.0-20200909_all.ipk
opkg install luci-theme-argon*.ipk opkg install luci-theme-argon*.ipk
``` ```
### For openwrt official 19.07 Snapshots LuCI master ### For openwrt official 19.07 Snapshots LuCI master
``` ```
wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v2.2.4/luci-theme-argon_2.2.4-20200821_all.ipk opkg install luci-compat
wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v2.2.5/luci-theme-argon_2.2.5-20200914_all.ipk
opkg install luci-theme-argon*.ipk opkg install luci-theme-argon*.ipk
``` ```
![](/Screenshots/screenshot_pc.jpg)
![](/Screenshots/screenshot_phone.jpg)
## Thanks to ## Thanks to

View file

@ -5,7 +5,7 @@
[4]: https://github.com/jerrykuku/luci-theme-argon/pulls [4]: https://github.com/jerrykuku/luci-theme-argon/pulls
[5]: https://img.shields.io/badge/Issues-welcome-brightgreen.svg [5]: https://img.shields.io/badge/Issues-welcome-brightgreen.svg
[6]: https://github.com/jerrykuku/luci-theme-argon/issues/new [6]: https://github.com/jerrykuku/luci-theme-argon/issues/new
[7]: https://img.shields.io/badge/release-v2.2.4-blue.svg? [7]: https://img.shields.io/badge/release-v2.2.5-blue.svg?
[8]: https://github.com/jerrykuku/luci-theme-argon/releases [8]: https://github.com/jerrykuku/luci-theme-argon/releases
[9]: https://img.shields.io/github/downloads/jerrykuku/luci-theme-argon/total [9]: https://img.shields.io/github/downloads/jerrykuku/luci-theme-argon/total
[10]: https://img.shields.io/badge/Contact-telegram-blue [10]: https://img.shields.io/badge/Contact-telegram-blue
@ -23,14 +23,21 @@
全新的 Openwrt 主题基于luci-theme-material 和 开源免费的 Argon 模板进行移植。 全新的 Openwrt 主题基于luci-theme-material 和 开源免费的 Argon 模板进行移植。
## 注意 ## 注意
强烈建议使用Chrome 浏览器。主题中使用了一些新的css3特性目前只有Chrome有最佳的兼容性。
主线版本 IE 系列目前还有Bug有待解决。
FireFox 默认不开启backdrop-filter开启方法见这里https://developer.mozilla.org/zh-CN/docs/Web/CSS/backdrop-filter
当前master版本基于官方 OpenWrt 19.07.1 稳定版固件进行移植适配。 当前master版本基于官方 OpenWrt 19.07.1 稳定版固件进行移植适配。
v2.x.x 适配主线快照版本。 v2.x.x 适配主线快照版本。
v1.x.x 适配18.06 和 Lean Openwrt [如果你是lean代码 请选择这个版本] v1.x.x 适配18.06 和 Lean Openwrt [如果你是lean代码 请选择这个版本]
## 更新日志 2020.08.21 v2.2.4 ## 更新日志 2020.09.13 v2.2.5
- 【v2.2.5】全新的设置app.你可以设置argon 主题的登录页面的模糊和透明度,并管理背景图片与视频。[建议使用 Chrome][点击下载](https://github.com/jerrykuku/luci-app-argon-config/releases/download/v0.8-beta/luci-app-argon-config_0.8-beta_all.ipk)
- 【v2.2.5】当编译固件时,将自动设置为默认主题。
- 【v2.2.5】修改文件结构以适应luci-app-argon-config旧的开启暗色模式方法将不再适用请搭配luci-app-argon-config使用。
- 【v2.2.5】适配Koolshare lede 2.3.6。
- 【v2.2.5】修复了一些Bug。
- 【v2.2.4】修复了在某些手机下图片背景第一次加载不能显示的问题。 - 【v2.2.4】修复了在某些手机下图片背景第一次加载不能显示的问题。
- 【v2.2.4】取消 luasocket 的依赖,无需再担心依赖问题。 - 【v2.2.4】取消 luasocket 的依赖,无需再担心依赖问题。
- 【v2.2.3】修正了在暗色模式下,固件刷写弹窗内的显示错误。 - 【v2.2.3】修正了在暗色模式下,固件刷写弹窗内的显示错误。
@ -78,14 +85,14 @@ make -j1 V=s
### Lean源码 ### Lean源码
``` ```
wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v1.6.9/luci-theme-argon_1.6.9-20200821_all.ipk wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v1.7.0/luci-theme-argon_1.7.0-20200909_all.ipk
opkg install luci-theme-argon*.ipk opkg install luci-theme-argon*.ipk
``` ```
### For openwrt official 19.07 Snapshots LuCI master ### For openwrt official 19.07 Snapshots LuCI master
``` ```
wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v2.2.4/luci-theme-argon_2.2.4-20200821_all.ipk wget --no-check-certificate https://github.com/jerrykuku/luci-theme-argon/releases/download/v2.2.5/luci-theme-argon_2.2.5-20200914_all.ipk
opkg install luci-theme-argon*.ipk opkg install luci-theme-argon*.ipk
``` ```

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 KiB

File diff suppressed because it is too large Load diff

View file

@ -50,11 +50,12 @@ body {
box-shadow: none; box-shadow: none;
} }
.login-page .login-container .login-form .form-login .cbi-button-apply { .login-page .login-container .login-form .form-login .cbi-button-apply {
background-image: linear-gradient(-135deg, #6c61ab 0%, #594ca9 100%); background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
} }
.login-page .login-container .login-form .form-login .cbi-button-apply:hover, .login-page .login-container .login-form .form-login .cbi-button-apply:hover,
.login-page .login-container .login-form .form-login .cbi-button-apply:focus { .login-page .login-container .login-form .form-login .cbi-button-apply:focus {
background-image: linear-gradient(-135deg, #554c8a 0%, #483d8b 100%); opacity: 0.9;
} }
header::after { header::after {
background-color: #1e1e1e !important; background-color: #1e1e1e !important;
@ -79,7 +80,8 @@ header::after {
background: none !important; background: none !important;
} }
.main .main-left .nav .slide .menu.active { .main .main-left .nav .slide .menu.active {
background-color: darkslateblue !important; background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
color: #cccccc !important; color: #cccccc !important;
} }
.main .main-left .nav .slide .menu.active a::after { .main .main-left .nav .slide .menu.active a::after {
@ -89,7 +91,8 @@ header::after {
color: #cccccc !important; color: #cccccc !important;
} }
.main .main-left .nav li a:hover { .main .main-left .nav li a:hover {
background-color: darkslateblue !important; background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
color: #cccccc !important; color: #cccccc !important;
} }
.main .main-left::-webkit-scrollbar-thumb { .main .main-left::-webkit-scrollbar-thumb {
@ -113,7 +116,8 @@ h3 {
a:-webkit-any-link { a:-webkit-any-link {
color: -webkit-link; color: -webkit-link;
cursor: pointer; cursor: pointer;
color: darkslateblue; color: #483d8b;
color: var(--dark-primary);
} }
input:-webkit-autofill { input:-webkit-autofill {
background-color: #3c3c3c !important; background-color: #3c3c3c !important;
@ -122,8 +126,10 @@ input:-webkit-autofill {
.cbi-button-apply, .cbi-button-apply,
.cbi-button-edit { .cbi-button-edit {
color: #fff !important; color: #fff !important;
background-color: darkslateblue !important; background-color: #483d8b !important;
border-color: darkslateblue !important; background-color: var(--dark-primary) !important;
border-color: #483d8b !important;
border-color: var(--dark-primary) !important;
} }
.cbi-section em { .cbi-section em {
color: #ccc; color: #ccc;
@ -235,7 +241,8 @@ h4 {
} }
.cbi-button { .cbi-button {
color: #ccc !important; color: #ccc !important;
background-color: darkslateblue; background-color: #483d8b;
background-color: var(--dark-primary);
} }
.cbi-section-node { .cbi-section-node {
background: none; background: none;
@ -271,7 +278,8 @@ div > .table > .tbody > .tr:nth-of-type(2n) {
} }
.tabs > li[class~="active"], .tabs > li[class~="active"],
.tabs > li:hover { .tabs > li:hover {
border-bottom: 0.18751rem solid darkslateblue; border-bottom: 0.18751rem solid #483d8b;
border-bottom: 0.18751rem solid var(--dark-primary);
color: #ccc; color: #ccc;
background-color: #181819; background-color: #181819;
} }
@ -311,7 +319,8 @@ input {
} }
select:not([multiple="multiple"]):focus, select:not([multiple="multiple"]):focus,
input:focus { input:focus {
border-color: darkslateblue !important; border-color: #483d8b !important;
border-color: var(--dark-primary) !important;
outline: 0; outline: 0;
} }
select { select {
@ -392,7 +401,8 @@ td.cbi-value-field var {
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.35); box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.35);
} }
.node-services-vssr .cbi-section-table-row.fast { .node-services-vssr .cbi-section-table-row.fast {
background: darkslateblue !important; background: #483d8b !important;
background: var(--dark-primary) !important;
color: #fff; color: #fff;
} }
.node-services-vssr .ssr-button { .node-services-vssr .ssr-button {
@ -406,7 +416,8 @@ td.cbi-value-field var {
background-color: darkolivegreen !important; background-color: darkolivegreen !important;
} }
.notice { .notice {
background-color: darkslateblue !important; background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
} }
.cbi-input-find, .cbi-input-find,
.cbi-input-save, .cbi-input-save,
@ -431,7 +442,8 @@ td.cbi-value-field var {
.cbi-button-apply.important, .cbi-button-apply.important,
.cbi-button-reload.important, .cbi-button-reload.important,
.cbi-button-action.important { .cbi-button-action.important {
border: 1px darkslateblue solid !important; border: 1px #483d8b solid !important;
border: 1px var(--dark-primary) solid !important;
} }
.btn[value="Dismiss"], .btn[value="Dismiss"],
.cbi-button[value="Terminate"], .cbi-button[value="Terminate"],
@ -477,7 +489,8 @@ header .fill .status span[data-style="active"] {
} }
td > .ifacebadge, td > .ifacebadge,
.td > .ifacebadge { .td > .ifacebadge {
background-color: darkslateblue; background-color: #483d8b;
background-color: var(--dark-primary);
border: 0; border: 0;
} }
.btn.danger, .btn.danger,
@ -529,7 +542,8 @@ div[style="width:100%;height:300px;border:1px solid #000;background:#fff"] {
background-color: darkorange !important; background-color: darkorange !important;
} }
.cbi-value input[type="password"] + .cbi-button-neutral { .cbi-value input[type="password"] + .cbi-button-neutral {
background-color: darkslateblue !important; background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
} }
.btn, .btn,
button, button,
@ -558,7 +572,8 @@ input,
color: #adb5bd !important; color: #adb5bd !important;
} }
.cbi-dropdown[open] { .cbi-dropdown[open] {
border-color: darkslateblue !important; border-color: #483d8b !important;
border-color: var(--dark-primary) !important;
} }
.cbi-dropdown[open] > ul.dropdown { .cbi-dropdown[open] > ul.dropdown {
background: #252526 !important; background: #252526 !important;
@ -571,11 +586,13 @@ input,
border-bottom: 1px solid #3c3c3c !important; border-bottom: 1px solid #3c3c3c !important;
} }
.cbi-dropdown[open] > ul.dropdown > li[selected] { .cbi-dropdown[open] > ul.dropdown > li[selected] {
background-color: darkslateblue !important; background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
border-bottom: 1px solid #3c3c3c !important; border-bottom: 1px solid #3c3c3c !important;
} }
.cbi-dropdown[open] > ul.dropdown > li.focus { .cbi-dropdown[open] > ul.dropdown > li.focus {
background: darkslateblue; background: #483d8b;
background: var(--dark-primary);
outline: none; outline: none;
} }
.ifacebadge { .ifacebadge {
@ -594,7 +611,8 @@ input,
.cbi-button[value="Upload"], .cbi-button[value="Upload"],
.cbi-button[value$="Apply"], .cbi-button[value$="Apply"],
.cbi-button[onclick="addKey(event)"] { .cbi-button[onclick="addKey(event)"] {
background: darkslateblue !important; background: #483d8b !important;
background: var(--dark-primary) !important;
} }
.btn.primary, .btn.primary,
.cbi-page-actions .cbi-button-save, .cbi-page-actions .cbi-button-save,
@ -607,7 +625,8 @@ input,
.cbi-button[value="Scan"], .cbi-button[value="Scan"],
.cbi-button[value^="Back"], .cbi-button[value^="Back"],
.cbi-button-neutral[onclick="handleConfig(event)"] { .cbi-button-neutral[onclick="handleConfig(event)"] {
background: darkslateblue; background: #483d8b;
background: var(--dark-primary);
} }
[data-page="admin-system-opkg"] h2 { [data-page="admin-system-opkg"] h2 {
color: #ccc !important; color: #ccc !important;

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,019 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 535 B

View file

@ -0,0 +1,3 @@
/* Disable minification (remove `.min` from URL path) for more info */
(function(undefined) {}).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});

View file

@ -89,6 +89,11 @@ document.addEventListener('luci-loaded', function(ev) {
$(".main > .main-left > .nav > .slide > .menu").click(function () { $(".main > .main-left > .nav > .slide > .menu").click(function () {
var ul = $(this).next(".slide-menu"); var ul = $(this).next(".slide-menu");
var menu = $(this); var menu = $(this);
$(".main > .main-left > .nav > .slide > .menu").each(function () {
var ulNode = $(this);
ulNode.removeClass("active");
ulNode.next(".slide-menu").stop(true).slideUp("fast")
});
if (!ul.is(":visible")) { if (!ul.is(":visible")) {
menu.addClass("active"); menu.addClass("active");
ul.addClass("active"); ul.addClass("active");

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,4 @@
// compress: false , sourceMap: false
/** /**
* Argon is a clean HTML5 theme for LuCI. It is based on luci-theme-material and Argon Template * Argon is a clean HTML5 theme for LuCI. It is based on luci-theme-material and Argon Template
* *
@ -61,11 +62,12 @@ body {
} }
.cbi-button-apply { .cbi-button-apply {
background-image: linear-gradient(-135deg, #6c61ab 0%, #594ca9 100%); background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
&:hover, &:hover,
&:focus { &:focus {
background-image: linear-gradient(-135deg, rgb(85, 76, 138) 0%, rgb(72, 61, 139) 100%); opacity: 0.9;
} }
} }
} }
@ -113,7 +115,8 @@ header::after {
} }
.menu.active { .menu.active {
background-color: darkslateblue !important; background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
color: #cccccc !important; color: #cccccc !important;
a::after { a::after {
@ -128,7 +131,8 @@ header::after {
} }
a:hover { a:hover {
background-color: darkslateblue !important; background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
color: #cccccc !important; color: #cccccc !important;
} }
} }
@ -163,7 +167,8 @@ h3 {
a:-webkit-any-link { a:-webkit-any-link {
color: -webkit-link; color: -webkit-link;
cursor: pointer; cursor: pointer;
color: darkslateblue; color: #483d8b;
color: var(--dark-primary);
} }
@ -175,8 +180,10 @@ input:-webkit-autofill {
.cbi-button-apply, .cbi-button-apply,
.cbi-button-edit { .cbi-button-edit {
color: #fff !important; color: #fff !important;
background-color: darkslateblue !important; background-color: #483d8b !important;
border-color: darkslateblue !important; background-color: var(--dark-primary) !important;
border-color: #483d8b !important;
border-color: var(--dark-primary) !important;
} }
@ -316,7 +323,8 @@ h4 {
.cbi-button { .cbi-button {
color: #ccc !important; color: #ccc !important;
background-color: darkslateblue; background-color: #483d8b;
background-color: var(--dark-primary);
} }
.cbi-section-node { .cbi-section-node {
@ -361,7 +369,8 @@ div>.table>.tbody>.tr:nth-of-type(2n) {
.tabs>li[class~="active"], .tabs>li[class~="active"],
.tabs>li:hover { .tabs>li:hover {
border-bottom: 0.18751rem solid darkslateblue; border-bottom: 0.18751rem solid #483d8b;
border-bottom: 0.18751rem solid var(--dark-primary);
color: #ccc; color: #ccc;
background-color: #181819; background-color: #181819;
} }
@ -410,7 +419,8 @@ input {
select:not([multiple="multiple"]):focus, select:not([multiple="multiple"]):focus,
input:focus { input:focus {
border-color: darkslateblue !important; border-color: #483d8b !important;
border-color: var(--dark-primary) !important;
outline: 0; outline: 0;
} }
@ -515,7 +525,8 @@ td.cbi-value-field var {
} }
.node-services-vssr .cbi-section-table-row.fast { .node-services-vssr .cbi-section-table-row.fast {
background: darkslateblue !important; background: #483d8b !important;
background: var(--dark-primary) !important;
color: #fff; color: #fff;
} }
@ -535,7 +546,8 @@ td.cbi-value-field var {
} }
.notice { .notice {
background-color: darkslateblue !important; background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
} }
.cbi-input-find, .cbi-input-find,
@ -563,7 +575,8 @@ td.cbi-value-field var {
.cbi-button-apply.important, .cbi-button-apply.important,
.cbi-button-reload.important, .cbi-button-reload.important,
.cbi-button-action.important { .cbi-button-action.important {
border: 1px darkslateblue solid !important; border: 1px #483d8b solid !important;
border: 1px var(--dark-primary) solid !important;
} }
.btn[value="Dismiss"], .btn[value="Dismiss"],
@ -619,7 +632,8 @@ header .fill .status span[data-style="active"] {
td>.ifacebadge, td>.ifacebadge,
.td>.ifacebadge { .td>.ifacebadge {
background-color: darkslateblue; background-color: #483d8b;
background-color: var(--dark-primary);
border: 0; border: 0;
} }
@ -684,7 +698,8 @@ div[style="width:100%;height:300px;border:1px solid #000;background:#fff"] {
} }
.cbi-value input[type="password"]+.cbi-button-neutral { .cbi-value input[type="password"]+.cbi-button-neutral {
background-color: darkslateblue !important; background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
} }
.btn, .btn,
@ -722,7 +737,8 @@ input,
} }
.cbi-dropdown[open] { .cbi-dropdown[open] {
border-color: darkslateblue !important; border-color: #483d8b !important;
border-color: var(--dark-primary) !important;
} }
.cbi-dropdown[open]>ul.dropdown { .cbi-dropdown[open]>ul.dropdown {
@ -740,12 +756,14 @@ input,
} }
.cbi-dropdown[open]>ul.dropdown>li[selected] { .cbi-dropdown[open]>ul.dropdown>li[selected] {
background-color: darkslateblue !important; background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
border-bottom: 1px solid #3c3c3c !important; border-bottom: 1px solid #3c3c3c !important;
} }
.cbi-dropdown[open]>ul.dropdown>li.focus { .cbi-dropdown[open]>ul.dropdown>li.focus {
background: darkslateblue; background: #483d8b;
background: var(--dark-primary);
outline: none; outline: none;
} }
@ -767,7 +785,8 @@ input,
.cbi-button[value="Upload"], .cbi-button[value="Upload"],
.cbi-button[value$="Apply"], .cbi-button[value$="Apply"],
.cbi-button[onclick="addKey(event)"] { .cbi-button[onclick="addKey(event)"] {
background: darkslateblue !important; background: #483d8b !important;
background: var(--dark-primary) !important;
} }
.btn.primary, .btn.primary,
@ -781,7 +800,8 @@ input,
.cbi-button[value="Scan"], .cbi-button[value="Scan"],
.cbi-button[value^="Back"], .cbi-button[value^="Back"],
.cbi-button-neutral[onclick="handleConfig(event)"] { .cbi-button-neutral[onclick="handleConfig(event)"] {
background: darkslateblue; background: #483d8b;
background: var(--dark-primary);
} }
[data-page="admin-system-opkg"] h2 { [data-page="admin-system-opkg"] h2 {

View file

@ -0,0 +1,46 @@
<%#
Argon is a clean HTML5 theme for LuCI. It is based on luci-theme-material Argon Template
luci-theme-argon
Copyright 2020 Jerrykuku <jerrykuku@qq.com>
Have a bug? Please create an issue here on GitHub!
https://github.com/jerrykuku/luci-theme-argon/issues
luci-theme-material:
Copyright 2015 Lutty Yang <lutty@wcan.in>
Agron Theme
https://demos.creative-tim.com/argon-dashboard/index.html
Licensed to the public under the Apache License 2.0
-%>
<% local ver = require "luci.version" %>
</div>
<footer class="mobile-hide">
<div>
<a class="luci-link" href="https://github.com/openwrt/luci">Powered by <%= ver.luciname %> (<%= ver.luciversion %>)</a> /
<a href="https://github.com/jerrykuku/luci-theme-argon">ArgonTheme <%# vPKG_VERSION %></a> /
<%= ver.distversion %>
<ul class="breadcrumb pull-right" id="modemenu" style="display:none"></ul>
</div>
</footer>
</div>
</div>
<script>
// thanks for Jo-Philipp Wich <jow@openwrt.org>
var luciLocation = <%= luci.http.write_json(luci.dispatcher.context.path) %>;
var winHeight = $(window).height();
$(window).resize(function () {
var winWidth = $(window).width()
if(winWidth < 600){
var newHeight = $(this).height();
var keyboradHeight = newHeight - winHeight;
$(".ftc").css("bottom", keyboradHeight + 30);
}
})
</script>
<script src="<%=media%>/js/script.js"></script>
</body>
</html>

View file

@ -10,7 +10,7 @@
luci-theme-material: luci-theme-material:
Copyright 2015 Lutty Yang <lutty@wcan.in> Copyright 2015 Lutty Yang <lutty@wcan.in>
Agron Theme Argon Theme
https://demos.creative-tim.com/argon-dashboard/index.html https://demos.creative-tim.com/argon-dashboard/index.html
Licensed to the public under the Apache License 2.0 Licensed to the public under the Apache License 2.0
@ -28,10 +28,31 @@
local fs = require "nixio.fs" local fs = require "nixio.fs"
local nutil = require "nixio.util" local nutil = require "nixio.util"
local uci = require 'luci.model.uci'.cursor()
-- send as HTML5 -- send as HTML5
http.prepare_content("text/html") http.prepare_content("text/html")
math.randomseed(os.time()) math.randomseed(os.time())
-- Custom settings
local mode = 'normal'
local dark_css = fs.readfile('/www/luci-static/argon/css/dark.css')
local bar_color = '#5e72e4'
local primary, dark_primary, blur_radius, blur_radius_dark, blur_opacity
if fs.access('/etc/config/argon') then
primary = uci:get_first('argon', 'global', 'primary')
dark_primary = uci:get_first('argon', 'global', 'dark_primary')
blur_radius = uci:get_first('argon', 'global', 'blur')
blur_radius_dark = uci:get_first('argon', 'global', 'blur_dark')
blur_opacity = uci:get_first('argon', 'global', 'transparency')
blur_opacity_dark = uci:get_first('argon', 'global', 'transparency_dark')
mode = uci:get_first('argon', 'global', 'mode')
bar_color = mode == 'dark' and dark_primary or primary
end
-- Brand name
local brand_name = boardinfo.hostname or "?"
-%> -%>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<%=luci.i18n.context.lang%>"> <html lang="<%=luci.i18n.context.lang%>">
@ -50,17 +71,41 @@
<meta name="x5-page-mode" content="app"> <meta name="x5-page-mode" content="app">
<meta name="browsermode" content="application"> <meta name="browsermode" content="application">
<meta name="msapplication-tap-highlight" content="no"> <meta name="msapplication-tap-highlight" content="no">
<meta name="msapplication-TileColor" content="#5e72e4"> <meta name="msapplication-TileColor" content="<%=bar_color%>">
<meta name="application-name" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI"> <meta name="application-name" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
<meta name="apple-mobile-web-app-title" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI"> <meta name="apple-mobile-web-app-title" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
<link rel="shortcut icon" type="image/png" href="<%=media%>/icon/favicon.png"> <link rel="apple-touch-icon" sizes="60x60" href="<%=media%>/icon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="<%=media%>/icon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="144x144" href="<%=media%>/icon/apple-icon-144x144.png">
<link rel="icon" type="image/png" sizes="192x192" href="<%=media%>/icon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="<%=media%>/icon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="<%=media%>/icon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="<%=media%>/icon/favicon-16x16.png">
<link rel="manifest" href="<%=media%>/icon/manifest.json"> <link rel="manifest" href="<%=media%>/icon/manifest.json">
<meta name="msapplication-TileColor" content="#5e72e4"> <meta name="msapplication-TileColor" content="<%=bar_color%>">
<meta name="theme-color" content="#5e72e4"> <meta name="msapplication-TileImage" content="<%=media%>/icon/ms-icon-144x144.png">
<meta name="theme-color" content="<%=bar_color%>">
<link rel="stylesheet" href="<%=media%>/css/cascade.css?v=<%=math.random(1,100000)%>"> <link rel="stylesheet" href="<%=media%>/css/cascade.css?v=<%=math.random(1,100000)%>">
<% if nixio.fs.access("/etc/dark") then %> <style title="text/css">
<link rel="stylesheet" href="<%=media%>/css/dark.css?v=<%=math.random(1,100000)%>"> <% if mode == 'normal' then %>
@media (prefers-color-scheme: dark) {
<%=dark_css%>
}
<% elseif mode == 'dark' then %>
<%=dark_css%>
<% end -%> <% end -%>
<% if fs.access('/etc/config/argon') then %>
:root {
--primary: <%=primary%>;
--dark-primary: <%=dark_primary%>;
--blur-radius:<%=blur_radius%>px;
--blur-opacity:<%=blur_opacity%>;
--blur-radius-dark:<%=blur_radius_dark%>px;
--blur-opacity-dark:<%=blur_opacity_dark%>;
}
<% end -%>
</style>
<link rel="shortcut icon" href="<%=media%>/favicon.ico">
<% if node and node.css then %> <% if node and node.css then %>
<link rel="stylesheet" href="<%=resource%>/<%=node.css%>"> <link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
<% end -%> <% end -%>
@ -69,131 +114,105 @@
<%=css %> <%=css %>
</style> </style>
<% end -%> <% end -%>
<script src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script> <script src="<%=media%>/js/polyfill.min.js"></script>
<script src="<%=resource%>/cbi.js<%# ?v=PKG_VERSION %>"></script> <script src="<%=url('admin/translations', luci.i18n.context.lang)%>?v=2.2.4"></script>
<script src="<%=resource%>/luci.js<%# ?v=PKG_VERSION %>"></script> <script src="<%=resource%>/cbi.js?v=2.2.4"></script>
<script src="<%=media%>/js/jquery.min.js<%# ?v=PKG_VERSION %>"></script> <script src="<%=resource%>/luci.js?v=2.2.4"></script>
<script src="<%=media%>/js/jquery.min.js?v=2.2.4"></script>
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
function EF() { return L.dom.create.apply(L.dom, arguments) }
(function() { (function() {
function get_children(node) { function get_children(node) {
var children = []; var children = [];
for (var k in node.children) { for (var k in node.children) {
if (!node.children.hasOwnProperty(k)) if (!node.children.hasOwnProperty(k))
continue; continue;
if (!node.children[k].satisfied) if (!node.children[k].satisfied)
continue; continue;
if (!node.children[k].hasOwnProperty('title')) if (!node.children[k].hasOwnProperty('title'))
continue; continue;
children.push(Object.assign(node.children[k], { name: k })); children.push(Object.assign(node.children[k], { name: k }));
} }
return children.sort(function(a, b) { return children.sort(function(a, b) {
return ((a.order || 1000) - (b.order || 1000)); return ((a.order || 1000) - (b.order || 1000));
}); });
} }
function render_mainmenu(tree, url, level) { function render_mainmenu(tree, url, level) {
var l = (level || 0) + 1, var l = (level || 0) + 1,
ul = E('ul', { 'class': level ? 'slide-menu' : 'nav' }), ul = EF('ul', { 'class': level ? 'slide-menu' : 'nav' }),
children = get_children(tree); children = get_children(tree);
if (children.length == 0 || l > 2) if (children.length == 0 || l > 2)
return E([]); return EF([]);
for (var i = 0; i < children.length; i++) { for (var i = 0; i < children.length; i++) {
var submenu = render_mainmenu(children[i], url + '/' + children[i].name, l), var submenu = render_mainmenu(children[i], url + '/' + children[i].name, l),
hasChildren = submenu.children.length; hasChildren = submenu.children.length;
isLogout = (children[i].name == 'logout'); ul.appendChild(EF('li', { 'class': hasChildren ? 'slide' : null }, [
ul.appendChild(E('li', { 'class': hasChildren ? 'slide' : isLogout ? 'lg' : null }, [ EF('a', {
E('a', {
'href': hasChildren ? '#' : L.url(url, children[i].name), 'href': hasChildren ? '#' : L.url(url, children[i].name),
'class': hasChildren ? 'menu' : isLogout ? "logout" : null, 'class': hasChildren ? 'menu' : null,
'data-title': children[i].title.replace(" ", "_"), 'data-title': hasChildren ? children[i].title.replace(" ", "_") : children[i].title.replace(" ", "_"),
}, [ _(children[i].title) ]), }, [ _(children[i].title) ]),
submenu submenu
])); ]));
} }
if (l == 1) { if (l == 1) {
var container = document.querySelector('#mainmenu'); var container = document.querySelector('#mainmenu');
container.appendChild(ul); container.appendChild(ul);
container.style.display = ''; container.style.display = '';
} }
return ul; return ul;
} }
function render_modemenu(tree) { function render_modemenu(tree) {
var ul = document.querySelector('#modemenu'), var ul = document.querySelector('#modemenu'),
children = get_children(tree); children = get_children(tree);
for (var i = 0; i < children.length; i++) { for (var i = 0; i < children.length; i++) {
var isActive = (L.env.requestpath.length ? children[i].name == L.env.requestpath[0] : i == 0); var isActive = (L.env.requestpath.length ? children[i].name == L.env.requestpath[0] : i == 0);
ul.appendChild(EF('li', {}, [
ul.appendChild(E('li', {}, [ EF('a', {
E('a', {
'href': L.url(children[i].name), 'href': L.url(children[i].name),
'class': isActive ? 'active' : null 'class': isActive ? 'active' : null
}, [ _(children[i].title) ]) }, [ _(children[i].title) ])
])); ]));
if (isActive) if (isActive)
render_mainmenu(children[i], children[i].name); render_mainmenu(children[i], children[i].name);
} }
if (ul.children.length > 1) if (ul.children.length > 1)
ul.style.display = ''; ul.style.display = '';
} }
function render_tabmenu(tree, url, level) { function render_tabmenu(tree, url, level) {
var container = document.querySelector('#tabmenu'), var container = document.querySelector('#tabmenu'),
l = (level || 0) + 1, l = (level || 0) + 1,
ul = E('ul', { 'class': 'tabs' }), ul = EF('ul', { 'class': 'tabs' }),
children = get_children(tree), children = get_children(tree),
activeNode = null; activeNode = null;
if (children.length == 0) if (children.length == 0)
return E([]); return EF([]);
for (var i = 0; i < children.length; i++) { for (var i = 0; i < children.length; i++) {
var isActive = (L.env.dispatchpath[l + 2] == children[i].name), var isActive = (L.env.dispatchpath[l + 2] == children[i].name),
activeClass = isActive ? ' active' : '', activeClass = isActive ? ' active' : '',
className = 'tabmenu-item-%s %s'.format(children[i].name, activeClass); className = 'tabmenu-item-%s %s'.format(children[i].name, activeClass);
ul.appendChild(EF('li', { 'class': className }, [
ul.appendChild(E('li', { 'class': className }, [ EF('a', { 'href': L.url(url, children[i].name) }, [ _(children[i].title) ] )
E('a', { 'href': L.url(url, children[i].name) }, [_(children[i].title)])
])); ]));
if (isActive) if (isActive)
activeNode = children[i]; activeNode = children[i];
} }
container.appendChild(ul); container.appendChild(ul);
container.style.display = ''; container.style.display = '';
if (activeNode) if (activeNode)
container.appendChild(render_tabmenu(activeNode, url + '/' + activeNode.name, l)); container.appendChild(render_tabmenu(activeNode, url + '/' + activeNode.name, l));
return ul; return ul;
} }
document.addEventListener('luci-loaded', function(ev) { document.addEventListener('luci-loaded', function(ev) {
var tree = <%= luci.http.write_json(luci.dispatcher.menu_json() or {}) %>, var tree = <%= luci.http.write_json(luci.dispatcher.menu_json() or {}) %>,
node = tree, node = tree,
url = ''; url = '';
render_modemenu(tree); render_modemenu(tree);
if (L.env.dispatchpath.length >= 3) { if (L.env.dispatchpath.length >= 3) {
for (var i = 0; i < 3 && node; i++) { for (var i = 0; i < 3 && node; i++) {
node = node.children[L.env.dispatchpath[i]]; node = node.children[L.env.dispatchpath[i]];
url = url + (url ? '/' : '') + L.env.dispatchpath[i]; url = url + (url ? '/' : '') + L.env.dispatchpath[i];
} }
if (node) if (node)
render_tabmenu(node, url); render_tabmenu(node, url);
} }
@ -209,7 +228,7 @@
<div class="main"> <div class="main">
<div class="main-left" id="mainmenu" style="display:none"> <div class="main-left" id="mainmenu" style="display:none">
<div class="sidenav-header d-flex align-items-center"> <div class="sidenav-header d-flex align-items-center">
<a class="brand" href="#"><%=boardinfo.hostname or "?"%></a> <a class="brand" href="#"><%=brand_name%></a>
<div class="ml-auto"> <div class="ml-auto">
<!-- Sidenav toggler --> <!-- Sidenav toggler -->
<div class="sidenav-toggler d-none d-xl-block active" data-action="sidenav-unpin" <div class="sidenav-toggler d-none d-xl-block active" data-action="sidenav-unpin"
@ -228,7 +247,7 @@
<div class="fill"> <div class="fill">
<div class="container"> <div class="container">
<a class="showSide"></a> <a class="showSide"></a>
<a class="brand" href="#"><%=boardinfo.hostname or "?"%> ™</a> <a class="brand" href="#"><%=brand_name%></a>
<div class="status" id="indicators"> <div class="status" id="indicators">
<span id="xhr_poll_status" style="display:none" onclick="XHR.running() ? XHR.halt() : XHR.run()"> <span id="xhr_poll_status" style="display:none" onclick="XHR.running() ? XHR.halt() : XHR.run()">
<span class="label success" id="xhr_poll_status_on"><span class="mobile-hide"><%:Auto Refresh%></span> <%:on%></span> <span class="label success" id="xhr_poll_status_on"><span class="mobile-hide"><%:Auto Refresh%></span> <%:on%></span>
@ -244,7 +263,7 @@
<%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%> <%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
<div class="alert-message error"> <div class="alert-message error">
<h4><%:No password set!%></h4> <h4><%:No password set!%></h4>
<p><%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%> <p><%:There is no password set on this router. Please configure a root password to protect the web interface.%>
</p> </p>
<% if disp.lookup("admin/system/admin") then %> <% if disp.lookup("admin/system/admin") then %>
<div class="right"><a class="btn" <div class="right"><a class="btn"

View file

@ -1,17 +1,17 @@
<%# <%#
edge is a clean HTML5 theme for LuCI. It is based on luci-theme-material edge Template Argon is a clean HTML5 theme for LuCI. It is based on luci-theme-material Argon Template
luci-theme-edge luci-theme-argon
Copyright 2020 Jerrykuku <jerrykuku@qq.com> Copyright 2020 Jerrykuku <jerrykuku@qq.com>
Have a bug? Please create an issue here on GitHub! Have a bug? Please create an issue here on GitHub!
https://github.com/jerrykuku/luci-theme-edge/issues https://github.com/jerrykuku/luci-theme-argon/issues
luci-theme-material: luci-theme-material:
Copyright 2015 Lutty Yang <lutty@wcan.in> Copyright 2015 Lutty Yang <lutty@wcan.in>
Agron Theme Argon Theme
https://demos.creative-tim.com/edge-dashboard/index.html https://demos.creative-tim.com/argon-dashboard/index.html
Licensed to the public under the Apache License 2.0 Licensed to the public under the Apache License 2.0
-%> -%>
@ -23,14 +23,33 @@
local disp = require "luci.dispatcher" local disp = require "luci.dispatcher"
local boardinfo = util.ubus("system", "board") local boardinfo = util.ubus("system", "board")
local node = disp.context.dispatched local node = disp.context.dispatched
local fs = require "nixio.fs" local fs = require "nixio.fs"
local nutil = require "nixio.util" local nutil = require "nixio.util"
local uci = require 'luci.model.uci'.cursor()
-- send as HTML5 -- send as HTML5
http.prepare_content("text/html") http.prepare_content("text/html")
math.randomseed(tonumber(tostring(os.time()):reverse():sub(1, 9))) math.randomseed(tonumber(tostring(os.time()):reverse():sub(1, 9)))
-- Custom settings
local mode = 'normal'
local dark_css = fs.readfile('/www/luci-static/argon/css/dark.css')
local bar_color = '#5e72e4'
local primary, dark_primary, blur_radius, blur_radius_dark, blur_opacity
if fs.access('/etc/config/argon') then
primary = uci:get_first('argon', 'global', 'primary')
dark_primary = uci:get_first('argon', 'global', 'dark_primary')
blur_radius = uci:get_first('argon', 'global', 'blur')
blur_radius_dark = uci:get_first('argon', 'global', 'blur_dark')
blur_opacity = uci:get_first('argon', 'global', 'transparency')
blur_opacity_dark = uci:get_first('argon', 'global', 'transparency_dark')
mode = uci:get_first('argon', 'global', 'mode')
bar_color = mode == 'dark' and dark_primary or primary
end
-%> -%>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<%=luci.i18n.context.lang%>"> <html lang="<%=luci.i18n.context.lang%>">
@ -49,17 +68,41 @@
<meta name="x5-page-mode" content="app"> <meta name="x5-page-mode" content="app">
<meta name="browsermode" content="application"> <meta name="browsermode" content="application">
<meta name="msapplication-tap-highlight" content="no"> <meta name="msapplication-tap-highlight" content="no">
<meta name="msapplication-TileColor" content="#5e72e4"> <meta name="msapplication-TileColor" content="<%=bar_color%>">
<meta name="application-name" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI"> <meta name="application-name" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
<meta name="apple-mobile-web-app-title" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI"> <meta name="apple-mobile-web-app-title" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
<link rel="shortcut icon" type="image/png" href="<%=media%>/icon/favicon.png"> <link rel="apple-touch-icon" sizes="60x60" href="<%=media%>/icon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="<%=media%>/icon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="144x144" href="<%=media%>/icon/apple-icon-144x144.png">
<link rel="icon" type="image/png" sizes="192x192" href="<%=media%>/icon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="<%=media%>/icon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="<%=media%>/icon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="<%=media%>/icon/favicon-16x16.png">
<link rel="manifest" href="<%=media%>/icon/manifest.json"> <link rel="manifest" href="<%=media%>/icon/manifest.json">
<meta name="msapplication-TileColor" content="#5e72e4"> <meta name="msapplication-TileColor" content="<%=bar_color%>">
<meta name="theme-color" content="#5e72e4"> <meta name="msapplication-TileImage" content="<%=media%>/icon/ms-icon-144x144.png">
<meta name="theme-color" content="<%=bar_color%>">
<link rel="stylesheet" href="<%=media%>/css/cascade.css?v=<%=math.random(1,100000)%>"> <link rel="stylesheet" href="<%=media%>/css/cascade.css?v=<%=math.random(1,100000)%>">
<% if nixio.fs.access("/etc/dark") then %> <style title="text/css">
<link rel="stylesheet" href="<%=media%>/css/dark.css?v=<%=math.random(1,100000)%>"> <% if mode == 'normal' then %>
@media (prefers-color-scheme: dark) {
<%=dark_css%>
}
<% elseif mode == 'dark' then %>
<%=dark_css%>
<% end -%> <% end -%>
<% if fs.access('/etc/config/argon') then %>
:root {
--primary: <%=primary%>;
--dark-primary: <%=dark_primary%>;
--blur-radius:<%=blur_radius%>px;
--blur-opacity:<%=blur_opacity%>;
--blur-radius-dark:<%=blur_radius_dark%>px;
--blur-opacity-dark:<%=blur_opacity_dark%>;
}
<% end -%>
</style>
<link rel="shortcut icon" href="<%=media%>/favicon.ico">
<% if node and node.css then %> <% if node and node.css then %>
<link rel="stylesheet" href="<%=resource%>/<%=node.css%>"> <link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
<% end -%> <% end -%>
@ -78,4 +121,3 @@
<body <body
class="lang_<%=luci.i18n.context.lang%> <% if node then %><%= striptags( node.title ) %><% end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %>" class="lang_<%=luci.i18n.context.lang%> <% if node then %><%= striptags( node.title ) %><% end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %>"
data-page="<%= table.concat(disp.context.requestpath, "-") %>"> data-page="<%= table.concat(disp.context.requestpath, "-") %>">

View file

@ -0,0 +1,27 @@
<%#
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008-2019 Jo-Philipp Wich <jo@mein.io>
Licensed to the public under the Apache License 2.0.
-%>
<%
local is_rollback_pending, rollback_time_remaining, rollback_session, rollback_token = luci.model.uci:rollback_pending()
if is_rollback_pending or trigger_apply or trigger_revert then
%>
<script type="text/javascript">
document.addEventListener("luci-loaded", function() {
<% if trigger_apply then -%>
L.ui.changes.apply(true);
<%- elseif trigger_revert then -%>
L.ui.changes.revert();
<%- else -%>
L.ui.changes.confirm(true, Date.now() + <%=rollback_time_remaining%> * 1000, <%=luci.http.write_json(rollback_token)%>);
<%- end %>
});
</script>
<%
end
include("themes/" .. theme .. "/footer_login")
%>

View file

@ -13,8 +13,8 @@
local applyconf = luci.config and luci.config.apply local applyconf = luci.config and luci.config.apply
%> %>
<script type="text/javascript" src="<%=resource%>/promis.min.js?v=git-20.186.82389-282dbf8"></script> <script type="text/javascript" src="<%=resource%>/promis.min.js"></script>
<script type="text/javascript" src="<%=resource%>/luci.js?v=git-20.186.82389-282dbf8"></script> <script type="text/javascript" src="<%=resource%>/luci.js"></script>
<script type="text/javascript"> <script type="text/javascript">
L = new LuCI(<%= luci.http.write_json({ L = new LuCI(<%= luci.http.write_json({
token = token, token = token,
@ -29,7 +29,7 @@
ubuspath = luci.config.main.ubuspath or '/ubus/', ubuspath = luci.config.main.ubuspath or '/ubus/',
sessionid = luci.dispatcher.context.authsession, sessionid = luci.dispatcher.context.authsession,
nodespec = luci.dispatcher.context.dispatched, nodespec = luci.dispatcher.context.dispatched,
apply_rollback = math.max(applyconf and applyconf.rollback or 30, 30), apply_rollback = math.max(applyconf and applyconf.rollback or 90, 90),
apply_holdoff = math.max(applyconf and applyconf.holdoff or 4, 1), apply_holdoff = math.max(applyconf and applyconf.holdoff or 4, 1),
apply_timeout = math.max(applyconf and applyconf.timeout or 5, 1), apply_timeout = math.max(applyconf and applyconf.timeout or 5, 1),
apply_display = math.max(applyconf and applyconf.display or 1.5, 1), apply_display = math.max(applyconf and applyconf.display or 1.5, 1),

View file

@ -15,13 +15,13 @@
MUI: MUI:
https://github.com/muicss/mui https://github.com/muicss/mui
Agron Theme Argon Theme
https://demos.creative-tim.com/argon-dashboard/index.html https://demos.creative-tim.com/argon-dashboard/index.html
Licensed to the public under the Apache License 2.0 Licensed to the public under the Apache License 2.0
-%> -%>
<%+header_login%> <%+themes/argon/out_header_login%>
<% <%
local util = require "luci.util" local util = require "luci.util"
local boardinfo = util.ubus("system", "board") local boardinfo = util.ubus("system", "board")
@ -82,25 +82,23 @@
} }
}) })
</script> </script>
<% else %> <% 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 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") local bing = "123"
if (bgcount == 0 ) then
local sys = require "luci.sys"
local json = require "luci.jsonc"
local remote_bg_url="http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US"
--bing = sys.httpget(remote_bg_url)
bing = sys.exec("wget --timeout=0.5 -qO- '%s'" %remote_bg_url)
if (bing and bing ~= '') then if (bing and bing ~= '') then
local bingjson = json.parse(bing) bg_url = "https://www.bing.com" .. json.parse(bing).images[1].url
bg_url = "https://www.bing.com" .. bingjson.images[1].url end
elseif (bgcount > 0 and currentBg["type"] ~= "mp4") then
bg_url = currentBg.url
end end
%> %>
style="background-image:url(<%=bg_url%>)" <div class="main-bg" id="main-bg" style="background-image:url(<%=bg_url%>)"></div>
<% elseif (bgcount > 0 and currentBg["type"] ~= "mp4") then %>
style="background-image:url(<%=currentBg.url%>)"
<% end %>
></div>
<% end %> <% end %>
<div class="login-container"> <div class="login-container">
<div class="login-form"> <div class="login-form">
@ -156,4 +154,4 @@
} }
//]]></script> //]]></script>
<% end %> <% end %>
<%+footer%> <%+themes/argon/out_footer_login%>

View file

@ -1,9 +1,12 @@
#!/bin/sh #!/bin/sh
if [ "$PKG_UPGRADE" != 1 ]; then
uci get luci.themes.Argon >/dev/null 2>&1 || \
uci batch <<-EOF uci batch <<-EOF
set luci.themes.Argon=/luci-static/argon set luci.themes.Argon=/luci-static/argon
set luci.main.mediaurlbase=/luci-static/argon
commit luci commit luci
EOF EOF
[ -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 fi
rm -Rf /var/luci-modulecache
rm -Rf /var/luci-indexcache
exit 0 exit 0

View file

@ -0,0 +1,14 @@
#
# Copyright (C) 2020 Jo-Philipp Wich <jo@mein.io>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI modern OpenWrt theme
LUCI_DEPENDS:=
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

File diff suppressed because it is too large Load diff

View file

Before

Width:  |  Height:  |  Size: 535 B

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="132 132 264 264">
<defs>
<radialGradient id="g" cx="0%" cy="0%" r="60%">
<stop offset=".8" style="stop-opacity:1" />
<stop offset="1" style="stop-opacity:.5" />
</radialGradient>
</defs>
<g>
<path style="fill:url(#g)" d="M 264 132 A 132 132 0 0 0 132 264 A 132 132 0 0 0 264 396 A 132 132 0 0 0 396 264 A 132 132 0 0 0 264 132 z M 264 170 A 94 94 0 0 1 359 264 A 94 94 0 0 1 264 359 A 94 94 0 0 1 170 264 A 94 94 0 0 1 264 170 z " />
</g>
</svg>

After

Width:  |  Height:  |  Size: 582 B

View file

@ -0,0 +1,147 @@
'use strict';
'require baseclass';
'require ui';
return baseclass.extend({
__init__: function() {
ui.menu.load().then(L.bind(this.render, this));
},
render: function(tree) {
var node = tree,
url = '';
this.renderModeMenu(node);
if (L.env.dispatchpath.length >= 3) {
for (var i = 0; i < 3 && node; i++) {
node = node.children[L.env.dispatchpath[i]];
url = url + (url ? '/' : '') + L.env.dispatchpath[i];
}
if (node)
this.renderTabMenu(node, url);
}
document.querySelector('#menubar > .navigation')
.addEventListener('click', ui.createHandlerFn(this, 'handleSidebarToggle'));
},
handleMenuExpand: function(ev) {
var a = ev.target, ul1 = a.parentNode.parentNode, ul2 = a.nextElementSibling;
document.querySelectorAll('ul.mainmenu.l1 > li.active').forEach(function(li) {
if (li !== a.parentNode)
li.classList.remove('active');
});
if (!ul2)
return;
if (ul2.parentNode.offsetLeft + ul2.offsetWidth <= ul1.offsetLeft + ul1.offsetWidth)
ul2.classList.add('align-left');
ul1.classList.add('active');
a.parentNode.classList.add('active');
a.blur();
ev.preventDefault();
ev.stopPropagation();
},
renderMainMenu: function(tree, url, level) {
var l = (level || 0) + 1,
ul = E('ul', { 'class': 'mainmenu l%d'.format(l) }),
children = ui.menu.getChildren(tree);
if (children.length == 0 || l > 2)
return E([]);
for (var i = 0; i < children.length; i++) {
var isActive = (L.env.dispatchpath[l] == children[i].name),
isReadonly = children[i].readonly,
activeClass = 'mainmenu-item-%s%s'.format(children[i].name, isActive ? ' selected' : '');
ul.appendChild(E('li', { 'class': activeClass }, [
E('a', {
'href': L.url(url, children[i].name),
'click': (l == 1) ? ui.createHandlerFn(this, 'handleMenuExpand') : null
}, [ _(children[i].title) ]),
this.renderMainMenu(children[i], url + '/' + children[i].name, l)
]));
}
if (l == 1)
document.querySelector('#mainmenu').appendChild(E('div', [ ul ]));
return ul;
},
renderModeMenu: function(tree) {
var menu = document.querySelector('#modemenu'),
children = ui.menu.getChildren(tree);
for (var i = 0; i < children.length; i++) {
var isActive = (L.env.requestpath.length ? children[i].name == L.env.requestpath[0] : i == 0);
if (i > 0)
menu.appendChild(E([], ['\u00a0|\u00a0']));
menu.appendChild(E('div', { 'class': isActive ? 'active' : null }, [
E('a', { 'href': L.url(children[i].name) }, [ _(children[i].title) ])
]));
if (isActive)
this.renderMainMenu(children[i], children[i].name);
}
if (menu.children.length > 1)
menu.style.display = '';
},
renderTabMenu: function(tree, url, level) {
var container = document.querySelector('#tabmenu'),
l = (level || 0) + 1,
ul = E('ul', { 'class': 'cbi-tabmenu' }),
children = ui.menu.getChildren(tree),
activeNode = null;
if (children.length == 0)
return E([]);
for (var i = 0; i < children.length; i++) {
var isActive = (L.env.dispatchpath[l + 2] == children[i].name),
activeClass = isActive ? ' cbi-tab' : '',
className = 'tabmenu-item-%s %s'.format(children[i].name, activeClass);
ul.appendChild(E('li', { 'class': className }, [
E('a', { 'href': L.url(url, children[i].name) }, [ _(children[i].title) ] )
]));
if (isActive)
activeNode = children[i];
}
container.appendChild(ul);
container.style.display = '';
if (activeNode)
container.appendChild(this.renderTabMenu(activeNode, url + '/' + activeNode.name, l));
return ul;
},
handleSidebarToggle: function(ev) {
var btn = ev.currentTarget,
bar = document.querySelector('#mainmenu');
if (btn.classList.contains('active')) {
btn.classList.remove('active');
bar.classList.remove('active');
}
else {
btn.classList.add('active');
bar.classList.add('active');
}
}
});

View file

@ -0,0 +1,17 @@
<%#
Copyright 2020 Jo-Philipp Wich <jo@mein.io>
Licensed to the public under the Apache License 2.0.
-%>
</div>
</div>
<p class="luci">
<% local ver = require "luci.version" -%>
Powered by <%= ver.luciname %> (<%= ver.luciversion %>)
</p>
<script type="text/javascript">L.require('menu-openwrt2020')</script>
</body>
</html>

View file

@ -0,0 +1,63 @@
<%#
Copyright 2020 Jo-Philipp Wich <jo@mein.io>
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"
local ver = require "luci.version"
local boardinfo = util.ubus("system", "board") or { }
local node = disp.context.dispatched
local path = table.concat(disp.context.path, "-")
http.prepare_content("text/html; charset=UTF-8")
-%>
<!DOCTYPE html>
<html lang="<%=luci.i18n.context.lang%>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/cascade.css" />
<link rel="icon" href="<%=media%>/favicon.png" type="image/svg+xml" />
<script type="text/javascript" src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
<title><%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI</title>
</head>
<body class="lang_<%=luci.i18n.context.lang%>" data-page="<%= pcdata(path) %>">
<p class="skiplink">
<span id="skiplink1"><a href="#navigation"><%:Skip to navigation%></a></span>
<span id="skiplink2"><a href="#content"><%:Skip to content%></a></span>
</p>
<div id="menubar">
<h2 class="navigation"><a id="navigation" name="navigation"><%:Navigation%></a></h2>
<span class="hostname"><a href="/"><%=(boardinfo.hostname or "?")%></a></span>
<span class="distversion"><%=ver.distversion%></span>
<span id="indicators"></span>
</div>
<div id="modemenu" style="display:none"></div>
<div id="maincontainer">
<div id="mainmenu"></div>
<div id="maincontent">
<%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") and category ~= "failsafe" and path ~= "admin-system-admin-password" then -%>
<div class="alert-message warning">
<h4><%:No password set!%></h4>
<p><%:There is no password set on this router. Please configure a root password to protect the web interface.%></p>
<% if disp.lookup("admin/system/admin") then %>
<div class="right"><a class="btn" href="<%=url("admin/system/admin")%>"><%:Go to password configuration...%></a></div>
<% end %>
</div>
<%- end -%>
<div id="tabmenu" style="display:none"></div>

View file

@ -0,0 +1,12 @@
#!/bin/sh
if [ "$PKG_UPGRADE" != 1 ]; then
uci get luci.themes.OpenWrt2020 >/dev/null 2>&1 || \
uci batch <<-EOF
set luci.themes.OpenWrt2020=/luci-static/openwrt2020
set luci.main.mediaurlbase=/luci-static/openwrt2020
commit luci
EOF
fi
exit 0

View file

@ -131,7 +131,7 @@ interface_multipath_settings() {
uci -q set openmptcprouter.${config}.multipath="$mode" uci -q set openmptcprouter.${config}.multipath="$mode"
config_get macaddr "$config" macaddr "" config_get macaddr "$config" macaddr ""
[ -n "$maccaddr" ] && { [ -n "$macaddr" ] && {
nbmac=0 nbmac=0
config_foreach interface_macaddr_count interface $macaddr config_foreach interface_macaddr_count interface $macaddr
[ "$nbmac" != "1" ] && { [ "$nbmac" != "1" ] && {

View file

@ -739,8 +739,10 @@ if [ "$OMR_TRACKER_INTERFACE" = "glorytun" ] || [ "$OMR_TRACKER_INTERFACE" = "om
if ([ "$default_gw" != "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$default_gw" = "" ]) && [ "$OMR_TRACKER_DEVICE_GATEWAY" != "" ]; then if ([ "$default_gw" != "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$default_gw" = "" ]) && [ "$OMR_TRACKER_DEVICE_GATEWAY" != "" ]; then
_log "Tunnel up : Replace default route by $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE" _log "Tunnel up : Replace default route by $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE"
ip route replace default scope global nexthop via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE ip route replace default scope global nexthop via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE
if [ "$(pgrep openmptcprouter-vps)" = "" ]; then
/etc/init.d/openmptcprouter-vps restart >/dev/null 2>&1 /etc/init.d/openmptcprouter-vps restart >/dev/null 2>&1
fi fi
fi
if [ "$(uci -q get shadowsocks-libev.sss0.disabled)" != "1" ] && [ "$(uci -q get shadowsocks-libev.ss_rules.redir_udp)" = "hi1" ]; then if [ "$(uci -q get shadowsocks-libev.sss0.disabled)" != "1" ] && [ "$(uci -q get shadowsocks-libev.ss_rules.redir_udp)" = "hi1" ]; then
_log "Tunnel up disable use of ShadowSocks for UDP" _log "Tunnel up disable use of ShadowSocks for UDP"
uci -q delete shadowsocks-libev.ss_rules.redir_udp uci -q delete shadowsocks-libev.ss_rules.redir_udp
@ -901,7 +903,7 @@ if [ "$multipath_config" = "master" ]; then
ip -6 route replace default via $OMR_TRACKER_DEVICE_GATEWAY6 dev $OMR_TRACKER_DEVICE table 991337 ip -6 route replace default via $OMR_TRACKER_DEVICE_GATEWAY6 dev $OMR_TRACKER_DEVICE table 991337
fi fi
if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(date +"%s") + $((10 + RANDOM % 31)) - $(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc))) -gt 3600 ] || [ "$(uci -q show openmptcprouter | grep get_config=\'1\')" != "" ] || [ "$(uci -q show openmptcprouter | grep admin_error=\'1\')" != "" ]; then if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(date +"%s") + $((10 + RANDOM % 31)) - $(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc))) -gt 3600 ] || [ "$(uci -q show openmptcprouter | grep get_config=\'1\')" != "" ] || [ "$(uci -q show openmptcprouter | grep admin_error=\'1\')" != "" ]; then
/etc/init.d/openmptcprouter-vps restart >/dev/null 2>&1 [ "$(pgrep openmptcprouter-vps)" = "" ] && /etc/init.d/openmptcprouter-vps restart >/dev/null 2>&1
fi fi
multipath_config="on" multipath_config="on"
fi fi

View file

@ -55,7 +55,12 @@ if [ "$(uci -q get omr-tracker.proxy.hosts | grep '103.224.182.242')" != "" ]; t
del_list omr-tracker.proxy.hosts='103.224.182.242' del_list omr-tracker.proxy.hosts='103.224.182.242'
del_list omr-tracker.proxy.hosts='198.191.250.176' del_list omr-tracker.proxy.hosts='198.191.250.176'
add_list omr-tracker.proxy.hosts='74.82.42.42' add_list omr-tracker.proxy.hosts='74.82.42.42'
add_list omr-tracker.proxy.hosts='176.103.130.130' commit omr-tracker
EOF
fi
if [ "$(uci -q get omr-tracker.proxy.hosts | grep '176.103.130.130')" != "" ]; then
uci -q batch <<-EOF >/dev/null
del_list omr-tracker.proxy.hosts='176.103.130.130'
commit omr-tracker commit omr-tracker
EOF EOF
fi fi

View file

@ -15,6 +15,21 @@ if [ "$(uci -q get firewall.@zone[2].name)" = "vpn" ]; then
EOF EOF
fi fi
if [ "$(uci -q get firewall.@zone[1].name)" = "wan" ]; then
uci -q batch <<-EOF >/dev/null
rename firewall.@zone[1]="zone_wan"
del_list firewall.zone_wan.network="wan"
del_list firewall.zone_wan.network="wan6"
commit firewall
EOF
fi
if [ "$(uci -q get firewall.@zone[0].name)" = "lan" ]; then
uci -q batch <<-EOF >/dev/null
rename firewall.@zone[0]="zone_lan"
commit firewall
EOF
fi
if [ "$(uci -q get firewall.zone_vpn)" = "" ]; then if [ "$(uci -q get firewall.zone_vpn)" = "" ]; then
uci -q batch <<-EOF >/dev/null uci -q batch <<-EOF >/dev/null
set firewall.zone_vpn=zone set firewall.zone_vpn=zone
@ -91,12 +106,12 @@ if [ "$(uci -q show firewall | grep ICMPv6-Lan-to-OMR)" = "" ]; then
EOF EOF
fi fi
uci -q batch <<-EOF >/dev/null uci -q batch <<-EOF >/dev/null
del_list firewall.wan.masq_dest='!10.0.0.0/8' del_list firewall.zone_wan.masq_dest='!10.0.0.0/8'
del_list firewall.wan.masq_dest='!172.16.0.0/12' del_list firewall.zone_wan.masq_dest='!172.16.0.0/12'
del_list firewall.wan.masq_dest='!192.168.0.0/16' del_list firewall.zone_wan.masq_dest='!192.168.0.0/16'
add_list firewall.wan.masq_dest='!10.0.0.0/8' add_list firewall.zone_wan.masq_dest='!10.0.0.0/8'
add_list firewall.wan.masq_dest='!172.16.0.0/12' add_list firewall.zone_wan.masq_dest='!172.16.0.0/12'
add_list firewall.wan.masq_dest='!192.168.0.0/16' add_list firewall.zone_wan.masq_dest='!192.168.0.0/16'
EOF EOF
if [ "$(ubus call system board | jsonfilter -e '@.board_name')" = "bananapi,bpi-r2" ] || [ "$(ubus call system board | jsonfilter -e '@.board_name' | grep -i wrt)" != "" ]; then if [ "$(ubus call system board | jsonfilter -e '@.board_name')" = "bananapi,bpi-r2" ] || [ "$(ubus call system board | jsonfilter -e '@.board_name' | grep -i wrt)" != "" ]; then
uci -q batch <<-EOF >/dev/null uci -q batch <<-EOF >/dev/null
@ -124,7 +139,7 @@ if [ "$(uci -q get firewall.gre_tunnel)" = "" ]; then
fi fi
if [ "$(uci -q get firewall.fwlantovpn)" = "" ]; then if [ "$(uci -q get firewall.fwlantovpn)" = "" ]; then
uci -q batch <<-EOF >/dev/null uci -q batch <<-EOF >/dev/null
set firewall.@zone[0].auto_helper='0' set firewall.zone_lan.auto_helper='0'
set firewall.fwlantovpn=forwarding set firewall.fwlantovpn=forwarding
set firewall.fwlantovpn.src='lan' set firewall.fwlantovpn.src='lan'
set firewall.fwlantovpn.dest='vpn' set firewall.fwlantovpn.dest='vpn'
@ -187,10 +202,10 @@ if [ "$(uci -q get firewall.allowdhcpv6546)" = "" ]; then
fi fi
# Fix firewall config from some old config # Fix firewall config from some old config
allintf=$(uci -q get firewall.@zone[1].network) allintf=$(uci -q get firewall.zone_wan.network)
uci -q del firewall.@zone[1].network uci -q del firewall.zone_wan.network
for intf in $allintf; do for intf in $allintf; do
uci -q add_list firewall.@zone[1].network=$intf uci -q add_list firewall.zone_wan.network=$intf
done done
allintf=$(uci -q get firewall.zone_vpn.network) allintf=$(uci -q get firewall.zone_vpn.network)
uci -q del firewall.zone_vpn.network uci -q del firewall.zone_vpn.network
@ -199,8 +214,9 @@ for intf in $allintf; do
done done
uci -q batch <<-EOF >/dev/null uci -q batch <<-EOF >/dev/null
set firewall.@zone[0].mtu_fix='1' set firewall.zone_lan.mtu_fix='1'
set firewall.zone_vpn.mtu_fix='1' set firewall.zone_vpn.mtu_fix='1'
set firewall.@include[0].reload='1'
commit firewall commit firewall
EOF EOF

View file

@ -9,12 +9,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=v2ray-core PKG_NAME:=v2ray-core
PKG_VERSION:=4.31.0 PKG_VERSION:=4.34.0
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/v2ray/v2ray-core/tar.gz/v$(PKG_VERSION)? PKG_SOURCE_URL:=https://github.com/v2fly/v2ray-core/archive/v$(PKG_VERSION)
PKG_HASH:=4e475c700863320b92689cb36ef993133e9c799375bbfc4a2811da2283c3673f PKG_HASH:=b250f569cb0369f394f63184e748f1df0c90500feb8a1bf2276257c4c8b81bee
PKG_LICENSE:=MIT PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE PKG_LICENSE_FILES:=LICENSE