mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-31 15:35:13 +08:00
🛸 Sync 2026-03-06 21:46:52
This commit is contained in:
1 parent
d2b3dc89ad
commit
be24daa5d4
4 files changed
+70
-42
No files matched your search
@@ -8,8 +8,8 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=docker-lan-bridge
|
PKG_NAME:=docker-lan-bridge
|
||||||
PKG_VERSION:=1.0.1
|
PKG_VERSION:=1.0.2
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_MAINTAINER:=jjm2473 <jjm2473@gmail.com>
|
PKG_MAINTAINER:=jjm2473 <jjm2473@gmail.com>
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ define Package/$(PKG_NAME)/install
|
|||||||
$(INSTALL_DIR) $(1)/etc/uci-defaults $(1)/etc/init.d $(1)/etc/hotplug.d/net
|
$(INSTALL_DIR) $(1)/etc/uci-defaults $(1)/etc/init.d $(1)/etc/hotplug.d/net
|
||||||
$(INSTALL_CONF) ./files/docker-lan.uci $(1)/etc/uci-defaults/docker-lan
|
$(INSTALL_CONF) ./files/docker-lan.uci $(1)/etc/uci-defaults/docker-lan
|
||||||
$(INSTALL_BIN) ./files/docker-lan.init $(1)/etc/init.d/docker-lan
|
$(INSTALL_BIN) ./files/docker-lan.init $(1)/etc/init.d/docker-lan
|
||||||
$(INSTALL_DATA) ./files/docker-lan.hotplug $(1)/etc/hotplug.d/net/11-docker-lan
|
$(INSTALL_DATA) ./files/docker-lan.hotplug $(1)/etc/hotplug.d/net/80-docker-lan
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,docker-lan-bridge))
|
$(eval $(call BuildPackage,docker-lan-bridge))
|
||||||
@@ -1,2 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
[ "$ACTION" = add -a "$DEVICENAME" = br-lan ] && ip link set docker-lan-d master docker-lan
|
[ "$ACTION" = add -a "$DEVICENAME" = br-lan ] || exit 0
|
||||||
|
sleep 1
|
||||||
|
ip link set docker-lan-d master docker-lan
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-passwall
|
PKG_NAME:=luci-app-passwall
|
||||||
PKG_VERSION:=26.3.2
|
PKG_VERSION:=26.3.6
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_PO_VERSION:=$(PKG_VERSION)
|
PKG_PO_VERSION:=$(PKG_VERSION)
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,11 @@ table td, .table .td {
|
|||||||
background: #5e72e445 !important;
|
background: #5e72e445 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ping a:hover{
|
.ping a,
|
||||||
text-decoration : underline;
|
.ping_value a,
|
||||||
|
.tcping_value a {
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
@@ -553,11 +556,10 @@ table td, .table .td {
|
|||||||
text = "<%:Timeout%>";
|
text = "<%:Timeout%>";
|
||||||
} else {
|
} else {
|
||||||
let use_time = parseInt(result.use_time);
|
let use_time = parseInt(result.use_time);
|
||||||
if (use_time < 1000) {
|
if (use_time < 1000)
|
||||||
color = "green";
|
color = "green";
|
||||||
} else if (use_time < 2000) {
|
else if (use_time < 2000)
|
||||||
color = "#fb9a05";
|
color = "#fb9a05";
|
||||||
}
|
|
||||||
text = use_time + " ms";
|
text = use_time + " ms";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -569,9 +571,11 @@ table td, .table .td {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ping_node(cbi_id, dom, type) {
|
function ping_node(cbi_id, dom, type) {
|
||||||
var full = get_address_full(cbi_id);
|
if (dom.dataset.busy == "1" || !cbi_id) return;
|
||||||
|
const full = get_address_full(cbi_id);
|
||||||
if ((type == "icmp" && full.address != "" ) || (type == "tcping" && full.address != "" && full.port != "")) {
|
if ((type == "icmp" && full.address != "" ) || (type == "tcping" && full.address != "" && full.port != "")) {
|
||||||
dom.onclick = null
|
dom.dataset.busy = "1";
|
||||||
|
dom.style.color = "";
|
||||||
dom.innerText = "<%:Check...%>";
|
dom.innerText = "<%:Check...%>";
|
||||||
XHR.get('<%=api.url("ping_node")%>', {
|
XHR.get('<%=api.url("ping_node")%>', {
|
||||||
address: full.address,
|
address: full.address,
|
||||||
@@ -579,19 +583,23 @@ table td, .table .td {
|
|||||||
type: type
|
type: type
|
||||||
},
|
},
|
||||||
function(x, result) {
|
function(x, result) {
|
||||||
|
let color = "red";
|
||||||
|
let text = "<%:Error%>";
|
||||||
if(x && x.status == 200) {
|
if(x && x.status == 200) {
|
||||||
if (result.ping == null || result.ping.trim() == "") {
|
if (result.ping == null || result.ping.trim() == "") {
|
||||||
dom.outerHTML = "<font style='color:red'><%:Timeout%></font>";
|
text = "<%:Timeout%>";
|
||||||
} else {
|
} else {
|
||||||
var ping = parseInt(result.ping);
|
var ping = parseInt(result.ping);
|
||||||
if (ping < 100)
|
if (ping < 100)
|
||||||
dom.outerHTML = "<font style='color:green'>" + result.ping + " ms" + "</font>";
|
color = "green";
|
||||||
else if (ping < 200)
|
else if (ping < 200)
|
||||||
dom.outerHTML = "<font style='color:#fb9a05'>" + result.ping + " ms" + "</font>";
|
color = "#fb9a05";
|
||||||
else if (ping >= 200)
|
text = result.ping + " ms";
|
||||||
dom.outerHTML = "<font style='color:red'>" + result.ping + " ms" + "</font>";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
dom.innerText = text;
|
||||||
|
dom.style.color = color;
|
||||||
|
dom.dataset.busy = "0";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -601,15 +609,15 @@ table td, .table .td {
|
|||||||
function pingAllNodes() {
|
function pingAllNodes() {
|
||||||
if (auto_detection_time == "icmp" || auto_detection_time == "tcping") {
|
if (auto_detection_time == "icmp" || auto_detection_time == "tcping") {
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
var nodes = [];
|
const nodes = [];
|
||||||
const ping_value = document.getElementsByClassName(auto_detection_time == "tcping" ? 'tcping_value' : 'ping_value');
|
const ping_value = document.getElementsByClassName(auto_detection_time == "tcping" ? 'tcping_value' : 'ping_value');
|
||||||
for (var i = 0; i < ping_value.length; i++) {
|
for (let i = 0; i < ping_value.length; i++) {
|
||||||
var cbi_id = ping_value[i].getAttribute("cbiid");
|
const cbi_id = ping_value[i].getAttribute("cbiid");
|
||||||
var full = get_address_full(cbi_id);
|
const full = get_address_full(cbi_id);
|
||||||
if ((auto_detection_time == "icmp" && full.address != "" ) || (auto_detection_time == "tcping" && full.address != "" && full.port != "")) {
|
if ((auto_detection_time == "icmp" && full.address != "" ) || (auto_detection_time == "tcping" && full.address != "" && full.port != "")) {
|
||||||
var flag = false;
|
let flag = false;
|
||||||
// Merge duplicates
|
// Merge duplicates
|
||||||
for (var j = 0; j < nodes.length; j++) {
|
for (let j = 0; j < nodes.length; j++) {
|
||||||
if (nodes[j].address == full.address && nodes[j].port == full.port) {
|
if (nodes[j].address == full.address && nodes[j].port == full.port) {
|
||||||
nodes[j].indexs = nodes[j].indexs + "," + i;
|
nodes[j].indexs = nodes[j].indexs + "," + i;
|
||||||
flag = true;
|
flag = true;
|
||||||
@@ -621,12 +629,17 @@ table td, .table .td {
|
|||||||
|
|
||||||
const cacheData = JSON.parse(localStorage.getItem(auto_detection_time + ":" + full.address + ":" + full.port));
|
const cacheData = JSON.parse(localStorage.getItem(auto_detection_time + ":" + full.address + ":" + full.port));
|
||||||
if (cacheData && cacheData.savetime && (now - cacheData.timestamp) < cacheData.savetime) {
|
if (cacheData && cacheData.savetime && (now - cacheData.timestamp) < cacheData.savetime) {
|
||||||
|
const a = ping_value[i].firstElementChild;
|
||||||
|
let color = "red";
|
||||||
if (cacheData.value < 100)
|
if (cacheData.value < 100)
|
||||||
ping_value[i].innerHTML = "<font style='color:green'>" + cacheData.value + " ms" + "</font>";
|
color = "green";
|
||||||
else if (cacheData.value < 200)
|
else if (cacheData.value < 200)
|
||||||
ping_value[i].innerHTML = "<font style='color:#fb9a05'>" + cacheData.value + " ms" + "</font>";
|
color = "#fb9a05";
|
||||||
else if (cacheData.value >= 200)
|
a.innerText = cacheData.value + " ms";
|
||||||
ping_value[i].innerHTML = "<font style='color:red'>" + cacheData.value + " ms" + "</font>";
|
a.style.color = color;
|
||||||
|
a.onclick = function () {
|
||||||
|
ping_node(cbi_id, this, auto_detection_time);
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
localStorage.removeItem(auto_detection_time + ":" + full.address + ":" + full.port);
|
localStorage.removeItem(auto_detection_time + ":" + full.address + ":" + full.port);
|
||||||
nodes.push({
|
nodes.push({
|
||||||
@@ -650,12 +663,14 @@ table td, .table .td {
|
|||||||
},
|
},
|
||||||
function(x, result) {
|
function(x, result) {
|
||||||
if (x && x.status == 200) {
|
if (x && x.status == 200) {
|
||||||
var strs = dom.indexs.split(",");
|
let strs = dom.indexs.split(",");
|
||||||
for (var i = 0; i < strs.length; i++) {
|
for (let i = 0; i < strs.length; i++) {
|
||||||
if (result.ping == null || result.ping.trim() == "") {
|
const a = ping_value[strs[i]].firstElementChild;
|
||||||
ping_value[strs[i]].innerHTML = "<font style='color:red'><%:Timeout%></font>";
|
const cbi_id = ping_value[strs[i]].getAttribute("cbiid");
|
||||||
} else {
|
let color = "red";
|
||||||
var ping = parseInt(result.ping);
|
let text = "<%:Timeout%>";
|
||||||
|
if (result.ping !== null && result.ping.trim() !== "") {
|
||||||
|
let ping = parseInt(result.ping);
|
||||||
//save to cache
|
//save to cache
|
||||||
const cache_data = {
|
const cache_data = {
|
||||||
dom_id: strs[i],
|
dom_id: strs[i],
|
||||||
@@ -663,23 +678,33 @@ table td, .table .td {
|
|||||||
savetime: 60 * 1000,
|
savetime: 60 * 1000,
|
||||||
value: ping
|
value: ping
|
||||||
};
|
};
|
||||||
|
text = result.ping + " ms";
|
||||||
localStorage.setItem(auto_detection_time + ":" + dom.address + ":" + dom.port, JSON.stringify(cache_data));
|
localStorage.setItem(auto_detection_time + ":" + dom.address + ":" + dom.port, JSON.stringify(cache_data));
|
||||||
if (ping < 100)
|
if (ping < 100)
|
||||||
ping_value[strs[i]].innerHTML = "<font style='color:green'>" + result.ping + " ms" + "</font>";
|
color = "green";
|
||||||
else if (ping < 200)
|
else if (ping < 200)
|
||||||
ping_value[strs[i]].innerHTML = "<font style='color:#fb9a05'>" + result.ping + " ms" + "</font>";
|
color = "#fb9a05";
|
||||||
else if (ping >= 200)
|
|
||||||
ping_value[strs[i]].innerHTML = "<font style='color:red'>" + result.ping + " ms" + "</font>";
|
|
||||||
}
|
}
|
||||||
|
a.innerText = text;
|
||||||
|
a.style.color = color;
|
||||||
|
a.onclick = function () {
|
||||||
|
ping_node(cbi_id, this, auto_detection_time);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
res();
|
res();
|
||||||
},
|
},
|
||||||
5000,
|
5000,
|
||||||
function(x) {
|
function(x) {
|
||||||
var strs = dom.indexs.split(",");
|
let strs = dom.indexs.split(",");
|
||||||
for (var i = 0; i < strs.length; i++) {
|
for (let i = 0; i < strs.length; i++) {
|
||||||
ping_value[strs[i]].innerHTML = "<font style='color:red'><%:Timeout%></font>";
|
const a = ping_value[strs[i]].firstElementChild;
|
||||||
|
const cbi_id = ping_value[strs[i]].getAttribute("cbiid");
|
||||||
|
a.innerText = "<%:Timeout%>";
|
||||||
|
a.style.color = "red";
|
||||||
|
a.onclick = function () {
|
||||||
|
ping_node(cbi_id, this, auto_detection_time);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
res();
|
res();
|
||||||
}
|
}
|
||||||
@@ -926,12 +951,12 @@ table td, .table .td {
|
|||||||
if (auto_detection_time != "icmp" && o["address"] && o["port"]) {
|
if (auto_detection_time != "icmp" && o["address"] && o["port"]) {
|
||||||
innerHTML = innerHTML.split("{{ping}}").join('<span class="ping"><a href="javascript:void(0)" onclick="javascript:ping_node(\'{{id}}\', this, \'icmp\')"><%:Test%></a></span>');
|
innerHTML = innerHTML.split("{{ping}}").join('<span class="ping"><a href="javascript:void(0)" onclick="javascript:ping_node(\'{{id}}\', this, \'icmp\')"><%:Test%></a></span>');
|
||||||
} else {
|
} else {
|
||||||
innerHTML = innerHTML.split("{{ping}}").join('<span class="ping_value" cbiid="{{id}}">---</span>');
|
innerHTML = innerHTML.split("{{ping}}").join('<span class="ping_value" cbiid="{{id}}"><a href="javascript:void(0)" style="color:inherit">---</a></span>');
|
||||||
}
|
}
|
||||||
if (auto_detection_time != "tcping" && o["address"] && o["port"]) {
|
if (auto_detection_time != "tcping" && o["address"] && o["port"]) {
|
||||||
innerHTML = innerHTML.split("{{tcping}}").join('<span class="ping"><a href="javascript:void(0)" onclick="javascript:ping_node(\'{{id}}\', this, \'tcping\')"><%:Test%></a></span>');
|
innerHTML = innerHTML.split("{{tcping}}").join('<span class="ping"><a href="javascript:void(0)" onclick="javascript:ping_node(\'{{id}}\', this, \'tcping\')"><%:Test%></a></span>');
|
||||||
} else {
|
} else {
|
||||||
innerHTML = innerHTML.split("{{tcping}}").join('<span class="tcping_value" cbiid="{{id}}">---</span>');
|
innerHTML = innerHTML.split("{{tcping}}").join('<span class="tcping_value" cbiid="{{id}}"><a href="javascript:void(0)" style="color:inherit">---</a></span>');
|
||||||
}
|
}
|
||||||
innerHTML = innerHTML.split("{{url_test}}").join('<span class="ping"><a href="javascript:void(0)" onclick="javascript:urltest_node(\'{{id}}\', this)" title="<%:TLS handshake test, latency for reference only%>"><%:Test%></a></span>');
|
innerHTML = innerHTML.split("{{url_test}}").join('<span class="ping"><a href="javascript:void(0)" onclick="javascript:urltest_node(\'{{id}}\', this)" title="<%:TLS handshake test, latency for reference only%>"><%:Test%></a></span>');
|
||||||
innerHTML = innerHTML.split("{{id}}").join(o[".name"]);
|
innerHTML = innerHTML.split("{{id}}").join(o[".name"]);
|
||||||
|
|||||||
Reference in new issue
Block a user