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
option direction 'both'
option proto 'icmp'
option class 'cs5'
option class 'cs7'
option comment 'ICMP'
config classify
option direction 'both'
option proto 'udp'
option class 'cs5'
option class 'cs4'
option src_port '53,123,5353'
option comment 'DNS udp and NTP'
config classify
option direction 'both'
option proto 'tcp'
option class 'cs5'
option class 'cs4'
option src_port '53,5353'
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
option direction 'both'
option proto 'tcp'
option class 'cs6'
option dest_port '65001,65301,65011'
option dest_port '65001,65301,65401,65011'
option comment 'OMR vpn'
config classify
@ -32,6 +39,13 @@ config classify
option dest_port '65001,65301'
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
option name 'googlevideo.com'
option class 'cs4'

View file

@ -38,10 +38,10 @@ function wizard_add()
local gostatus = true
-- Force WAN zone firewall members to be a list
local fwwan = sys.exec("uci -q get firewall.@zone[1].network")
luci.sys.call("uci -q delete firewall.@zone[1].network")
local fwwan = sys.exec("uci -q get firewall.zone_wan.network")
luci.sys.call("uci -q delete firewall.zone_wan.network")
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
ucic:save("firewall")
@ -185,7 +185,7 @@ function wizard_add()
luci.sys.call("uci -q commit vnstat")
-- 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("/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)
end
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")
gostatus = false
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_state = mArray.wans[i].multipath_state;
var duplicateif = mArray.wans[i].duplicateif;
var duplicatemac = mArray.wans[i].duplicatemac;
// Generate template
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 == '')
{
statusMessage += '<%:No gateway defined%>' + '<br />';
} else if(gw_ping == 'DOWN')
} else if(gateway != '' && gw_ping == 'DOWN')
{
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')
{
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 />';
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 />';
statusMessageClass = "error";
@ -595,6 +596,11 @@ local statuslogo = ucic:get("openmptcprouter","settings","statuslogo") or "openm
statusMessage += '<%:Network interface duplicated%>' + '<br />';
statusMessageClass = "error";
}
if(duplicatemac)
{
statusMessage += '<%:Network interface MAC address duplicated%>' + '<br />';
statusMessageClass = "error";
}
if(ipv6_discover == 'DETECTED')
{
statusMessage += '<%:IPv6 route received%>' + '<br />'

View file

@ -372,7 +372,7 @@
<%
for _, iface in ipairs(net:get_networks()) do
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
%>
<h3><%=ifname%></h3>
@ -475,7 +475,7 @@
<%
for _, iface in ipairs(net:get_networks()) do
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
-- local multipath = uci:get("network",ifname,"multipath")
@ -943,9 +943,10 @@
</div>
</fieldset>
</div>
<div class="cbi-page-actions">
<div class="cbi-page-actions control-group">
<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>
</form>
<script type="text/javascript">cbi_init();</script>

View file

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

View file

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

View file

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

View file

@ -8,18 +8,9 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=Argon Theme
LUCI_DEPENDS:=
PKG_VERSION:=2.2.4
PKG_RELEASE:=20200821
PKG_VERSION:=2.2.6
PKG_RELEASE:=20210215
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
[2]: /LICENSE
[3]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
[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]
<a href="/LICENSE">
<img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="">
</a>
![](/Screenshots/screenshot_pc.jpg)
![](/Screenshots/screenshot_phone.jpg)
<a href="https://github.com/jerrykuku/luci-theme-argon/pulls">
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="">
</a>
<a href="https://github.com/jerrykuku/luci-theme-argon/issues/new">
<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>
A new Luci theme for LEDE/OpenWRT
Argon is a clean HTML5 theme for LuCI. It is based on luci-theme-material and Argon Template
<br>English | [简体中文](README_ZH.md)
## 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.
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】Remove the dependency of luasocket.
- 【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
```
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
```
### 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
```
![](/Screenshots/screenshot_pc.jpg)
![](/Screenshots/screenshot_phone.jpg)
## Thanks to

View file

@ -5,7 +5,7 @@
[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?
[7]: https://img.shields.io/badge/release-v2.2.5-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
@ -23,14 +23,21 @@
全新的 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 稳定版固件进行移植适配。
v2.x.x 适配主线快照版本。
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】取消 luasocket 的依赖,无需再担心依赖问题。
- 【v2.2.3】修正了在暗色模式下,固件刷写弹窗内的显示错误。
@ -78,14 +85,14 @@ make -j1 V=s
### 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
```
### 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
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 KiB

View file

@ -1,2 +1,2 @@
Drop background here!
accept jpg png gif and mp4
accept jpg png gif and mp4

File diff suppressed because it is too large Load diff

View file

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

View file

@ -24,7 +24,7 @@
* Login background
* https://unsplash.com/
*
* Licensed to the public under the Apache License 2.0
* Licensed to the public under the Apache License 2.0
*/
@ -183,4 +183,4 @@
.icon-app:before {
content: "\e915";
}
}

File diff suppressed because one or more lines are too long

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

File diff suppressed because one or more lines are too long

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

@ -7,7 +7,7 @@
* Have a bug? Please create an issue here on GitHub!
* https://github.com/jerrykuku/luci-theme-argon/issues
*
* luci-theme-material:
* luci-theme-material:
* Copyright 2015 Lutty Yang <lutty@wcan.in>
* https://github.com/LuttyYang/luci-theme-material/
*
@ -89,6 +89,11 @@ document.addEventListener('luci-loaded', function(ev) {
$(".main > .main-left > .nav > .slide > .menu").click(function () {
var ul = $(this).next(".slide-menu");
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")) {
menu.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
*
@ -24,7 +25,7 @@
* Login background
* https://unsplash.com/
*
* Licensed to the public under the Apache License 2.0
* Licensed to the public under the Apache License 2.0
*/
body {
@ -61,11 +62,12 @@ body {
}
.cbi-button-apply {
background-image: linear-gradient(-135deg, #6c61ab 0%, #594ca9 100%);
background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
&:hover,
&: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 {
background-color: darkslateblue !important;
background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
color: #cccccc !important;
a::after {
@ -128,7 +131,8 @@ header::after {
}
a:hover {
background-color: darkslateblue !important;
background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
color: #cccccc !important;
}
}
@ -163,7 +167,8 @@ h3 {
a:-webkit-any-link {
color: -webkit-link;
cursor: pointer;
color: darkslateblue;
color: #483d8b;
color: var(--dark-primary);
}
@ -175,8 +180,10 @@ input:-webkit-autofill {
.cbi-button-apply,
.cbi-button-edit {
color: #fff !important;
background-color: darkslateblue !important;
border-color: darkslateblue !important;
background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
border-color: #483d8b !important;
border-color: var(--dark-primary) !important;
}
@ -316,7 +323,8 @@ h4 {
.cbi-button {
color: #ccc !important;
background-color: darkslateblue;
background-color: #483d8b;
background-color: var(--dark-primary);
}
.cbi-section-node {
@ -361,7 +369,8 @@ div>.table>.tbody>.tr:nth-of-type(2n) {
.tabs>li[class~="active"],
.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;
background-color: #181819;
}
@ -410,7 +419,8 @@ input {
select:not([multiple="multiple"]):focus,
input:focus {
border-color: darkslateblue !important;
border-color: #483d8b !important;
border-color: var(--dark-primary) !important;
outline: 0;
}
@ -515,7 +525,8 @@ td.cbi-value-field var {
}
.node-services-vssr .cbi-section-table-row.fast {
background: darkslateblue !important;
background: #483d8b !important;
background: var(--dark-primary) !important;
color: #fff;
}
@ -535,7 +546,8 @@ td.cbi-value-field var {
}
.notice {
background-color: darkslateblue !important;
background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
}
.cbi-input-find,
@ -563,7 +575,8 @@ td.cbi-value-field var {
.cbi-button-apply.important,
.cbi-button-reload.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"],
@ -575,8 +588,8 @@ td.cbi-value-field var {
.cbi-button-neutral[value="Disable"] {
font-weight: normal;
color: #fff;
border: thin solid darkorange!important;
background-color: darkorange!important;
border: thin solid darkorange !important;
background-color: darkorange !important;
}
fieldset[id^="cbi-apply-"] {
@ -619,7 +632,8 @@ header .fill .status span[data-style="active"] {
td>.ifacebadge,
.td>.ifacebadge {
background-color: darkslateblue;
background-color: #483d8b;
background-color: var(--dark-primary);
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 {
background-color: darkslateblue !important;
background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
}
.btn,
@ -722,7 +737,8 @@ input,
}
.cbi-dropdown[open] {
border-color: darkslateblue !important;
border-color: #483d8b !important;
border-color: var(--dark-primary) !important;
}
.cbi-dropdown[open]>ul.dropdown {
@ -740,12 +756,14 @@ input,
}
.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;
}
.cbi-dropdown[open]>ul.dropdown>li.focus {
background: darkslateblue;
background: #483d8b;
background: var(--dark-primary);
outline: none;
}
@ -767,7 +785,8 @@ input,
.cbi-button[value="Upload"],
.cbi-button[value$="Apply"],
.cbi-button[onclick="addKey(event)"] {
background: darkslateblue !important;
background: #483d8b !important;
background: var(--dark-primary) !important;
}
.btn.primary,
@ -781,7 +800,8 @@ input,
.cbi-button[value="Scan"],
.cbi-button[value^="Back"],
.cbi-button-neutral[onclick="handleConfig(event)"] {
background: darkslateblue;
background: #483d8b;
background: var(--dark-primary);
}
[data-page="admin-system-opkg"] h2 {
@ -805,4 +825,4 @@ input,
}
}
}

View file

@ -7,13 +7,13 @@
Have a bug? Please create an issue here on GitHub!
https://github.com/jerrykuku/luci-theme-argon/issues
luci-theme-material:
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
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" %>
@ -43,4 +43,4 @@
</script>
<script src="<%=media%>/js/script.js"></script>
</body>
</html>
</html>

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

@ -5,19 +5,19 @@
Copyright 2020 Jerrykuku <jerrykuku@qq.com>
Have a bug? Please create an issue here on GitHub!
https://github.com/jerrykuku/luci-theme-argon/issues
https://github.com/jerrykuku/luci-theme-argon/issues
luci-theme-material:
luci-theme-material:
Copyright 2015 Lutty Yang <lutty@wcan.in>
Agron Theme
https://demos.creative-tim.com/argon-dashboard/index.html
Argon Theme
https://demos.creative-tim.com/argon-dashboard/index.html
Licensed to the public under the Apache License 2.0
-%>
<%
local sys = require "luci.sys"
local sys = require "luci.sys"
local util = require "luci.util"
local http = require "luci.http"
local disp = require "luci.dispatcher"
@ -25,42 +25,87 @@
local boardinfo = util.ubus("system", "board")
local node = disp.context.dispatched
local fs = require "nixio.fs"
local fs = require "nixio.fs"
local nutil = require "nixio.util"
local uci = require 'luci.model.uci'.cursor()
-- send as HTML5
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>
<html lang="<%=luci.i18n.context.lang%>">
<head>
<meta charset="utf-8">
<title>
<%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %>
- LuCI</title>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<meta name="format-detection" content="telephone=no, email=no" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="x5-fullscreen" content="true">
<meta name="full-screen" content="yes">
<meta name="x5-page-mode" content="app">
<meta name="browsermode" content="application">
<meta name="msapplication-tap-highlight" content="no">
<meta name="msapplication-TileColor" content="#5e72e4">
<meta name="application-name" 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="manifest" href="<%=media%>/icon/manifest.json">
<meta name="msapplication-TileColor" content="#5e72e4">
<meta name="theme-color" content="#5e72e4">
<link rel="stylesheet" href="<%=media%>/css/cascade.css?v=<%=math.random(1,100000)%>">
<% if nixio.fs.access("/etc/dark") then %>
<link rel="stylesheet" href="<%=media%>/css/dark.css?v=<%=math.random(1,100000)%>">
<% end -%>
<meta charset="utf-8">
<title>
<%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %>
- LuCI</title>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<meta name="format-detection" content="telephone=no, email=no" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="x5-fullscreen" content="true">
<meta name="full-screen" content="yes">
<meta name="x5-page-mode" content="app">
<meta name="browsermode" content="application">
<meta name="msapplication-tap-highlight" content="no">
<meta name="msapplication-TileColor" content="<%=bar_color%>">
<meta name="application-name" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
<meta name="apple-mobile-web-app-title" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
<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">
<meta name="msapplication-TileColor" content="<%=bar_color%>">
<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)%>">
<style title="text/css">
<% if mode == 'normal' then %>
@media (prefers-color-scheme: dark) {
<%=dark_css%>
}
<% elseif mode == 'dark' then %>
<%=dark_css%>
<% 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 %>
<link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
<% end -%>
@ -69,136 +114,110 @@
<%=css %>
</style>
<% end -%>
<script src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
<script src="<%=resource%>/cbi.js<%# ?v=PKG_VERSION %>"></script>
<script src="<%=resource%>/luci.js<%# ?v=PKG_VERSION %>"></script>
<script src="<%=media%>/js/jquery.min.js<%# ?v=PKG_VERSION %>"></script>
<script type="text/javascript">//<![CDATA[
(function () {
<script src="<%=media%>/js/polyfill.min.js"></script>
<script src="<%=url('admin/translations', luci.i18n.context.lang)%>?v=2.2.4"></script>
<script src="<%=resource%>/cbi.js?v=2.2.4"></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[
function EF() { return L.dom.create.apply(L.dom, arguments) }
(function() {
function get_children(node) {
var children = [];
for (var k in node.children) {
if (!node.children.hasOwnProperty(k))
continue;
if (!node.children[k].satisfied)
continue;
if (!node.children[k].hasOwnProperty('title'))
continue;
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));
});
}
function render_mainmenu(tree, url, level) {
var l = (level || 0) + 1,
ul = E('ul', { 'class': level ? 'slide-menu' : 'nav' }),
children = get_children(tree);
ul = EF('ul', { 'class': level ? 'slide-menu' : 'nav' }),
children = get_children(tree);
if (children.length == 0 || l > 2)
return E([]);
return EF([]);
for (var i = 0; i < children.length; i++) {
var submenu = render_mainmenu(children[i], url + '/' + children[i].name, l),
hasChildren = submenu.children.length;
isLogout = (children[i].name == 'logout');
ul.appendChild(E('li', { 'class': hasChildren ? 'slide' : isLogout ? 'lg' : null }, [
E('a', {
hasChildren = submenu.children.length;
ul.appendChild(EF('li', { 'class': hasChildren ? 'slide' : null }, [
EF('a', {
'href': hasChildren ? '#' : L.url(url, children[i].name),
'class': hasChildren ? 'menu' : isLogout ? "logout" : null,
'data-title': children[i].title.replace(" ", "_"),
}, [_(children[i].title)]),
'class': hasChildren ? 'menu' : null,
'data-title': hasChildren ? children[i].title.replace(" ", "_") : children[i].title.replace(" ", "_"),
}, [ _(children[i].title) ]),
submenu
]));
}
if (l == 1) {
var container = document.querySelector('#mainmenu');
container.appendChild(ul);
container.style.display = '';
}
return ul;
}
function render_modemenu(tree) {
var ul = document.querySelector('#modemenu'),
children = get_children(tree);
children = get_children(tree);
for (var i = 0; i < children.length; i++) {
var isActive = (L.env.requestpath.length ? children[i].name == L.env.requestpath[0] : i == 0);
ul.appendChild(E('li', {}, [
E('a', {
ul.appendChild(EF('li', {}, [
EF('a', {
'href': L.url(children[i].name),
'class': isActive ? 'active' : null
}, [_(children[i].title)])
}, [ _(children[i].title) ])
]));
if (isActive)
render_mainmenu(children[i], children[i].name);
}
if (ul.children.length > 1)
ul.style.display = '';
}
function render_tabmenu(tree, url, level) {
var container = document.querySelector('#tabmenu'),
l = (level || 0) + 1,
ul = E('ul', { 'class': 'tabs' }),
children = get_children(tree),
activeNode = null;
l = (level || 0) + 1,
ul = EF('ul', { 'class': 'tabs' }),
children = get_children(tree),
activeNode = null;
if (children.length == 0)
return E([]);
return EF([]);
for (var i = 0; i < children.length; i++) {
var isActive = (L.env.dispatchpath[l + 2] == children[i].name),
activeClass = isActive ? ' active' : '',
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)])
activeClass = isActive ? ' active' : '',
className = 'tabmenu-item-%s %s'.format(children[i].name, activeClass);
ul.appendChild(EF('li', { 'class': className }, [
EF('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(render_tabmenu(activeNode, url + '/' + activeNode.name, l));
return ul;
}
document.addEventListener('luci-loaded', function (ev) {
var tree = <%= luci.http.write_json(luci.dispatcher.menu_json() or { }) %>,
node = tree,
url = '';
render_modemenu(tree);
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];
document.addEventListener('luci-loaded', function(ev) {
var tree = <%= luci.http.write_json(luci.dispatcher.menu_json() or {}) %>,
node = tree,
url = '';
render_modemenu(tree);
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)
render_tabmenu(node, url);
}
if (node)
render_tabmenu(node, url);
}
});
}) ();
});
})();
//]]></script>
</head>
@ -209,7 +228,7 @@
<div class="main">
<div class="main-left" id="mainmenu" style="display:none">
<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">
<!-- Sidenav toggler -->
<div class="sidenav-toggler d-none d-xl-block active" data-action="sidenav-unpin"
@ -228,7 +247,7 @@
<div class="fill">
<div class="container">
<a class="showSide"></a>
<a class="brand" href="#"><%=boardinfo.hostname or "?"%> ™</a>
<a class="brand" href="#"><%=brand_name%></a>
<div class="status" id="indicators">
<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>
@ -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 -%>
<div class="alert-message error">
<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>
<% if disp.lookup("admin/system/admin") then %>
<div class="right"><a class="btn"

View file

@ -1,36 +1,55 @@
<%#
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>
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>
Agron Theme
https://demos.creative-tim.com/edge-dashboard/index.html
Argon Theme
https://demos.creative-tim.com/argon-dashboard/index.html
Licensed to the public under the Apache License 2.0
-%>
<%
local sys = require "luci.sys"
local sys = require "luci.sys"
local util = require "luci.util"
local http = require "luci.http"
local disp = require "luci.dispatcher"
local boardinfo = util.ubus("system", "board")
local node = disp.context.dispatched
local fs = require "nixio.fs"
local fs = require "nixio.fs"
local nutil = require "nixio.util"
local uci = require 'luci.model.uci'.cursor()
-- send as HTML5
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>
<html lang="<%=luci.i18n.context.lang%>">
@ -49,17 +68,41 @@
<meta name="x5-page-mode" content="app">
<meta name="browsermode" content="application">
<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="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">
<meta name="msapplication-TileColor" content="#5e72e4">
<meta name="theme-color" content="#5e72e4">
<meta name="msapplication-TileColor" content="<%=bar_color%>">
<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)%>">
<% if nixio.fs.access("/etc/dark") then %>
<link rel="stylesheet" href="<%=media%>/css/dark.css?v=<%=math.random(1,100000)%>">
<% end -%>
<style title="text/css">
<% if mode == 'normal' then %>
@media (prefers-color-scheme: dark) {
<%=dark_css%>
}
<% elseif mode == 'dark' then %>
<%=dark_css%>
<% 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 %>
<link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
<% end -%>
@ -72,10 +115,9 @@
<script src="<%=resource%>/cbi.js<%# ?v=PKG_VERSION %>"></script>
<script src="<%=resource%>/xhr.js<%# ?v=PKG_VERSION %>"></script>
<script src="<%=media%>/js/jquery.min.js<%# ?v=PKG_VERSION %>"></script>
</head>
<body
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, "-") %>">

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
%>
<script type="text/javascript" src="<%=resource%>/promis.min.js?v=git-20.186.82389-282dbf8"></script>
<script type="text/javascript" src="<%=resource%>/luci.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"></script>
<script type="text/javascript">
L = new LuCI(<%= luci.http.write_json({
token = token,
@ -29,7 +29,7 @@
ubuspath = luci.config.main.ubuspath or '/ubus/',
sessionid = luci.dispatcher.context.authsession,
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_timeout = math.max(applyconf and applyconf.timeout or 5, 1),
apply_display = math.max(applyconf and applyconf.display or 1.5, 1),

View file

@ -14,18 +14,18 @@
MUI:
https://github.com/muicss/mui
Agron Theme
Argon Theme
https://demos.creative-tim.com/argon-dashboard/index.html
Licensed to the public under the Apache License 2.0
-%>
<%+header_login%>
<%+themes/argon/out_header_login%>
<%
local util = require "luci.util"
local boardinfo = util.ubus("system", "board")
local fs = require "nixio.fs"
local fs = require "nixio.fs"
local nutil = require "nixio.util"
function glob(...)
@ -60,7 +60,7 @@
end
if bgcount > 0 then
currentBg = bgs[math.random(1,bgcount)]
currentBg = bgs[math.random(1,bgcount)]
end
%>
<div class="login-page">
@ -82,25 +82,23 @@
}
})
</script>
<% else %>
<div class="main-bg" id="main-bg"
<%
<% else
local bg_url = media .. "/img/bg1.jpg"
local bing = "123"
if (bgcount == 0 ) then
local http = require "luci.sys"
local sys = 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")
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
local bingjson = json.parse(bing)
bg_url = "https://www.bing.com" .. bingjson.images[1].url
bg_url = "https://www.bing.com" .. json.parse(bing).images[1].url
end
elseif (bgcount > 0 and currentBg["type"] ~= "mp4") then
bg_url = currentBg.url
end
%>
style="background-image:url(<%=bg_url%>)"
<% elseif (bgcount > 0 and currentBg["type"] ~= "mp4") then %>
style="background-image:url(<%=currentBg.url%>)"
<% end %>
></div>
<div class="main-bg" id="main-bg" style="background-image:url(<%=bg_url%>)"></div>
<% end %>
<div class="login-container">
<div class="login-form">
@ -156,4 +154,4 @@
}
//]]></script>
<% end %>
<%+footer%>
<%+themes/argon/out_footer_login%>

View file

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

View file

@ -739,7 +739,9 @@ if [ "$OMR_TRACKER_INTERFACE" = "glorytun" ] || [ "$OMR_TRACKER_INTERFACE" = "om
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"
ip route replace default scope global nexthop via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE
/etc/init.d/openmptcprouter-vps restart >/dev/null 2>&1
if [ "$(pgrep openmptcprouter-vps)" = "" ]; then
/etc/init.d/openmptcprouter-vps restart >/dev/null 2>&1
fi
fi
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"
@ -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
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
/etc/init.d/openmptcprouter-vps restart >/dev/null 2>&1
[ "$(pgrep openmptcprouter-vps)" = "" ] && /etc/init.d/openmptcprouter-vps restart >/dev/null 2>&1
fi
multipath_config="on"
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='198.191.250.176'
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
EOF
fi

View file

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

View file

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