diff --git a/README.md b/README.md index 8b66d5ae36..9ce2321977 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,8 @@ luci-lib-docker source: [lisaac/luci-lib-docker](https://github.com/lisaac/luci- openwrt-iptvhelper source: [riverscn/openwrt-iptvhelper](https://github.com/riverscn/openwrt-iptvhelper).
luci-app-autoipsetadder source: [rufengsuixing/luci-app-autoipsetadder](https://github.com/rufengsuixing/luci-app-autoipsetadder).
luci-app-adguardhome source: [rufengsuixing/luci-app-adguardhome](https://github.com/rufengsuixing/luci-app-adguardhome).
-Rclone-OpenWrt source:[ElonH/Rclone-OpenWrt](https://github.com/ElonH/Rclone-OpenWrt). +Rclone-OpenWrt source: [ElonH/Rclone-OpenWrt](https://github.com/ElonH/Rclone-OpenWrt).
+luci-app-usb3disable source: [rufengsuixing/luci-app-usb3disable](https://github.com/rufengsuixing/luci-app-usb3disable). # License ### [GPL v3](https://www.gnu.org/licenses/gpl-3.0.html). diff --git a/package/ctcgfw/luci-app-ssr-plus-Jo/Makefile b/package/ctcgfw/luci-app-ssr-plus-Jo/Makefile index 0ad9e8bc2e..baddda2bc6 100644 --- a/package/ctcgfw/luci-app-ssr-plus-Jo/Makefile +++ b/package/ctcgfw/luci-app-ssr-plus-Jo/Makefile @@ -67,7 +67,7 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_dnsforwarder default n config PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS - bool "chinadns" + bool "chiandns" default n config PACKAGE_$(PKG_NAME)_INCLUDE_haproxy diff --git a/package/ctcgfw/luci-app-ssr-plus-Jo/luasrc/view/shadowsocksr/myip.htm b/package/ctcgfw/luci-app-ssr-plus-Jo/luasrc/view/shadowsocksr/myip.htm index d62f5bb9c7..0b3d5c8e8b 100644 --- a/package/ctcgfw/luci-app-ssr-plus-Jo/luasrc/view/shadowsocksr/myip.htm +++ b/package/ctcgfw/luci-app-ssr-plus-Jo/luasrc/view/shadowsocksr/myip.htm @@ -163,7 +163,7 @@ url2='https://ip.skk.moe'; window.open(url2); } - const $$ = document; + const $$ = document; $$.getElementById('ip-webrtc').innerHTML = '查询中...'; $$.getElementById('ip-pcol').innerHTML = '查询中...'; $$.getElementById('ip-ipify').innerHTML = '查询中...'; @@ -194,8 +194,7 @@ throw error; }), parseIPIpip: (ip, elID) => { - - IP.get(`https://api.skk.moe/network/parseIp/ipip/v3/${ip}`, 'json') + IP.get(`https://api.skk.moe/network/parseIp/ipip/v3/${ip}`, 'json') .then(resp => { let x = ''; for (let i of resp.data) { @@ -261,14 +260,17 @@ img.onerror = img.onload = null; $$.getElementById(cbElID).innerHTML = '连接超时' }, 5000); + img.onerror = () => { clearTimeout(timeout); $$.getElementById(cbElID).innerHTML = '无法访问' } + img.onload = () => { clearTimeout(timeout); $$.getElementById(cbElID).innerHTML = '连接正常' } + img.src = `https://${domain}/favicon.ico?${+(new Date)}` }, runcheck: () => { @@ -279,6 +281,7 @@ HTTP.checker('www.youtube.com', 'http-youtube'); } }; + HTTP.runcheck(); IP.getIpipnetIP(); IP.getIpifyIP(); @@ -290,9 +293,10 @@ $$.getElementById('ip-pcol-ipip').innerHTML = `${data.pro} ${data.city} ${data.region} ${pcisp[1]}`; }; function getIpsbIP(data){ - $$.getElementById('ip-ipsb').innerHTML = data.address; - $$.getElementById('ip-ipsb-geo').innerHTML = `${data.country} ${data.province} ${data.city} ${data.isp.name}` + $$.getElementById('ip-ipsb').innerHTML = data.ip; + IP.parseIPIpip(data.ip, 'ip-ipsb-geo'); }; + window.onload=myip_Load(); function myip_Load() @@ -306,7 +310,7 @@ var sbip = document.getElementsByTagName('HEAD').item(0); var sbipScript= document.createElement("script"); sbipScript.defer = "defer"; - sbipScript.src='https://ip.sb/addrinfo?callback=getIpsbIP'; + sbipScript.src='https://api-ipv4.ip.sb/jsonip?callback=getIpsbIP'; sbip.appendChild(sbipScript); const $$ = document; @@ -322,14 +326,15 @@ $$.getElementById('ip-pcol-ipip').innerHTML = `${data.pro} ${data.city} ${data.region} ${pcisp[1]}`; }; function getIpsbIP(data){ - $$.getElementById('ip-ipsb').innerHTML = data.address; - $$.getElementById('ip-ipsb-geo').innerHTML = `${data.country} ${data.province} ${data.city} ${data.isp.name}` + $$.getElementById('ip-ipsb').innerHTML = data.ip; + IP.parseIPIpip(data.ip, 'ip-ipsb-geo'); }; + setTimeout("myip_Load()",1000*10); } + - + - diff --git a/package/ctcgfw/luci-app-usb3disable/Makefile b/package/ctcgfw/luci-app-usb3disable/Makefile new file mode 100644 index 0000000000..d722b88e62 --- /dev/null +++ b/package/ctcgfw/luci-app-usb3disable/Makefile @@ -0,0 +1,31 @@ +# Copyright (C) 2016 Openwrt.org +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=LuCI support disable usb3 +LUCI_DEPENDS:= +LUCI_PKGARCH:=all +PKG_NAME:=luci-app-usb3disable +PKG_VERSION:=1.0 +PKG_RELEASE:=1 + +define Package/luci-app-usb3disable/install + $(INSTALL_DIR) $(1)/usr/lib/lua/luci + cp -pR ./luasrc/* $(1)/usr/lib/lua/luci + $(INSTALL_DIR) $(1)/ + cp -pR ./root/* $(1)/ +endef + +define Package/luci-app-usb3disable/postinst +#!/bin/sh + rm -f /tmp/luci-indexcache + rm -f /tmp/luci-modulecache/* +exit 0 +endef +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature + diff --git a/package/ctcgfw/luci-app-usb3disable/luasrc/controller/usb3disable.lua b/package/ctcgfw/luci-app-usb3disable/luasrc/controller/usb3disable.lua new file mode 100644 index 0000000000..4c5fd59b90 --- /dev/null +++ b/package/ctcgfw/luci-app-usb3disable/luasrc/controller/usb3disable.lua @@ -0,0 +1,6 @@ +module("luci.controller.usb3disable",package.seeall) +nixio=require"nixio" +function index() +entry({"admin","system","usb3disable"},alias("admin","system","usb3disable","usb3disable"),_("usb3disable")) +entry({"admin","system","usb3disable","usb3disable"},cbi("usb3disable"),_("usb3disable"),1) +end \ No newline at end of file diff --git a/package/ctcgfw/luci-app-usb3disable/luasrc/model/cbi/usb3disable.lua b/package/ctcgfw/luci-app-usb3disable/luasrc/model/cbi/usb3disable.lua new file mode 100644 index 0000000000..1b3126dbe3 --- /dev/null +++ b/package/ctcgfw/luci-app-usb3disable/luasrc/model/cbi/usb3disable.lua @@ -0,0 +1,45 @@ +local sys=require("luci.sys") +local m,s,o,d,e,p +m=Map("usb3disable","usb3disable") + +s=m:section(TypedSection,"usb3disable") +s.anonymous=true +s.addremove=false +e=sys.exec("cat /etc/modules.d/$(ls /etc/modules.d | grep usb3) >/tmp/run/usb3module ; lsmod | awk '{gsub(\"_\",\"-\",$1);print $1}' >>/tmp/run/usb3module ; sort /tmp/run/usb3module | uniq -d | sort -n ; rm /tmp/run/usb3module") +if e=="" then + o=s:option(Button,"enabled",translate("enable now")) + o.optional=false + o.inputtitle=translate("enable") + o.write=function() + sys.exec("cat /etc/modules.d/$(ls /etc/modules.d | grep usb3) | awk '{print \"insmod \"$0}' >/var/run/usb3module ; sh /var/run/usb3module; rm /var/run/usb3module") + luci.http.redirect(luci.dispatcher.build_url("admin","system","usb3disable")) + end +else + o=s:option(Button,"disabled",translate("disable now")) + o.optional=false + o.inputtitle=translate("Disable") + o.write=function() + sys.exec("cat /etc/modules.d/$(ls /etc/modules.d | grep usb3) | sed -n '1!G;h;$p' | awk '{print \"rmmod \"$0}' >/var/run/usb3module ; sh /var/run/usb3module; rm /var/run/usb3module") + luci.http.redirect(luci.dispatcher.build_url("admin","system","usb3disable")) + end +end +d=sys.exec("ls /etc/modules-boot.d | grep usb3") +if d=="" then + o=s:option(Button,"enabledstartup",translate("enable on boot")) + o.optional=false + o.inputtitle=translate("Enable") + o.write=function() + sys.exec("ln -s /etc/modules.d/*usb3 /etc/modules-boot.d/") + luci.http.redirect(luci.dispatcher.build_url("admin","system","usb3disable")) + end +else +o=s:option(Button,"disabledstartup",translate("disable on boot")) + o.optional=false + o.inputtitle=translate("Disable") + o.write=function() + sys.exec("rm /etc/modules-boot.d/*-usb3") + luci.http.redirect(luci.dispatcher.build_url("admin","system","usb3disable")) + end + +end +return m \ No newline at end of file diff --git a/package/ctcgfw/luci-app-usb3disable/root/etc/config/usb3disable b/package/ctcgfw/luci-app-usb3disable/root/etc/config/usb3disable new file mode 100644 index 0000000000..02ecf5d222 --- /dev/null +++ b/package/ctcgfw/luci-app-usb3disable/root/etc/config/usb3disable @@ -0,0 +1,2 @@ + +config usb3disable 'usb3disable'