update 2023-03-18 19:56:03

This commit is contained in:
github-actions[bot] 2023-03-18 19:56:03 +08:00
parent 4ac457e454
commit 6292620f01
9 changed files with 349 additions and 50 deletions

View File

@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=Design Theme
LUCI_DEPENDS:=
PKG_VERSION:=5.5.0
PKG_RELEASE:=20230317
PKG_VERSION:=5.5.1
PKG_RELEASE:=20230318
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -2416,7 +2416,6 @@ header > .container > .pull-right > * {
border-radius: 10px;
z-index: 10;
top: 22px;
margin-right: 30px;
}
#refresh_on, #refresh_off {

View File

@ -0,0 +1,241 @@
/*
* xhr.js - XMLHttpRequest helper class
* (c) 2008-2010 Jo-Philipp Wich
*/
XHR = function()
{
this.reinit = function()
{
if (window.XMLHttpRequest) {
this._xmlHttp = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
this._xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else {
alert("xhr.js: XMLHttpRequest is not supported by this browser!");
}
}
this.busy = function() {
if (!this._xmlHttp)
return false;
switch (this._xmlHttp.readyState)
{
case 1:
case 2:
case 3:
return true;
default:
return false;
}
}
this.abort = function() {
if (this.busy())
this._xmlHttp.abort();
}
this.get = function(url,data,callback)
{
this.reinit();
var xhr = this._xmlHttp;
var code = this._encode(data);
url = location.protocol + '//' + location.host + url;
if (code)
if (url.substr(url.length-1,1) == '&')
url += code;
else
url += '?' + code;
xhr.open('GET', url, true);
xhr.onreadystatechange = function()
{
if (xhr.readyState == 4) {
var json = null;
if (xhr.getResponseHeader("Content-Type") == "application/json") {
try {
json = eval('(' + xhr.responseText + ')');
}
catch(e) {
json = null;
}
}
callback(xhr, json);
}
}
xhr.send(null);
}
this.post = function(url,data,callback)
{
this.reinit();
var xhr = this._xmlHttp;
var code = this._encode(data);
xhr.onreadystatechange = function()
{
if (xhr.readyState == 4)
callback(xhr);
}
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr.send(code);
}
this.cancel = function()
{
this._xmlHttp.onreadystatechange = function(){};
this._xmlHttp.abort();
}
this.send_form = function(form,callback,extra_values)
{
var code = '';
for (var i = 0; i < form.elements.length; i++)
{
var e = form.elements[i];
if (e.options)
{
code += (code ? '&' : '') +
form.elements[i].name + '=' + encodeURIComponent(
e.options[e.selectedIndex].value
);
}
else if (e.length)
{
for (var j = 0; j < e.length; j++)
if (e[j].name) {
code += (code ? '&' : '') +
e[j].name + '=' + encodeURIComponent(e[j].value);
}
}
else
{
code += (code ? '&' : '') +
e.name + '=' + encodeURIComponent(e.value);
}
}
if (typeof extra_values == 'object')
for (var key in extra_values)
code += (code ? '&' : '') +
key + '=' + encodeURIComponent(extra_values[key]);
return(
(form.method == 'get')
? this.get(form.getAttribute('action'), code, callback)
: this.post(form.getAttribute('action'), code, callback)
);
}
this._encode = function(obj)
{
obj = obj ? obj : { };
obj['_'] = Math.random();
if (typeof obj == 'object')
{
var code = '';
var self = this;
for (var k in obj)
code += (code ? '&' : '') +
k + '=' + encodeURIComponent(obj[k]);
return code;
}
return obj;
}
}
XHR.get = function(url, data, callback)
{
(new XHR()).get(url, data, callback);
}
XHR.poll = function(interval, url, data, callback)
{
if (isNaN(interval) || interval < 1)
interval = 5;
if (!XHR._q)
{
XHR._t = 0;
XHR._q = [ ];
XHR._r = function() {
for (var i = 0, e = XHR._q[0]; i < XHR._q.length; e = XHR._q[++i])
{
if (!(XHR._t % e.interval) && !e.xhr.busy())
e.xhr.get(e.url, e.data, e.callback);
}
XHR._t++;
};
}
XHR._q.push({
interval: interval,
callback: callback,
url: url,
data: data,
xhr: new XHR()
});
XHR.run();
}
XHR.halt = function()
{
if (XHR._i)
{
/* show & set poll indicator */
try {
document.getElementById('xhr_poll_status').style.display = '';
document.getElementById('xhr_poll_status_on').style.display = 'none';
document.getElementById('xhr_poll_status_off').style.display = '';
document.getElementById('notice_status').style.marginRight = '30px'
} catch(e) { }
window.clearInterval(XHR._i);
XHR._i = null;
}
}
XHR.run = function()
{
if (XHR._r && !XHR._i)
{
/* show & set poll indicator */
try {
document.getElementById('xhr_poll_status').style.display = '';
document.getElementById('xhr_poll_status_on').style.display = '';
document.getElementById('xhr_poll_status_off').style.display = 'none';
document.getElementById('notice_status').style.marginRight = '30px'
} catch(e) { }
/* kick first round manually to prevent one second lag when setting up
* the poll interval */
XHR._r();
XHR._i = window.setInterval(XHR._r, 1000);
}
}
XHR.running = function()
{
return !!(XHR._r && XHR._i);
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,68 @@
XHR=function()
{this.reinit=function()
{if(window.XMLHttpRequest){this._xmlHttp=new XMLHttpRequest();}
else if(window.ActiveXObject){this._xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
else{alert("xhr.js: XMLHttpRequest is not supported by this browser!");}}
this.busy=function(){if(!this._xmlHttp)
return false;switch(this._xmlHttp.readyState)
{case 1:case 2:case 3:return true;default:return false;}}
this.abort=function(){if(this.busy())
this._xmlHttp.abort();}
this.get=function(url,data,callback)
{this.reinit();var xhr=this._xmlHttp;var code=this._encode(data);url=location.protocol+'//'+location.host+url;if(code)
if(url.substr(url.length-1,1)=='&')
url+=code;else
url+='?'+code;xhr.open('GET',url,true);xhr.onreadystatechange=function()
{if(xhr.readyState==4){var json=null;if(xhr.getResponseHeader("Content-Type")=="application/json"){try{json=eval('('+xhr.responseText+')');}
catch(e){json=null;}}
callback(xhr,json);}}
xhr.send(null);}
this.post=function(url,data,callback)
{this.reinit();var xhr=this._xmlHttp;var code=this._encode(data);xhr.onreadystatechange=function()
{if(xhr.readyState==4)
callback(xhr);}
xhr.open('POST',url,true);xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');xhr.send(code);}
this.cancel=function()
{this._xmlHttp.onreadystatechange=function(){};this._xmlHttp.abort();}
this.send_form=function(form,callback,extra_values)
{var code='';for(var i=0;i<form.elements.length;i++)
{var e=form.elements[i];if(e.options)
{code+=(code?'&':'')+
form.elements[i].name+'='+encodeURIComponent(e.options[e.selectedIndex].value);}
else if(e.length)
{for(var j=0;j<e.length;j++)
if(e[j].name){code+=(code?'&':'')+
e[j].name+'='+encodeURIComponent(e[j].value);}}
else
{code+=(code?'&':'')+
e.name+'='+encodeURIComponent(e.value);}}
if(typeof extra_values=='object')
for(var key in extra_values)
code+=(code?'&':'')+
key+'='+encodeURIComponent(extra_values[key]);return((form.method=='get')?this.get(form.getAttribute('action'),code,callback):this.post(form.getAttribute('action'),code,callback));}
this._encode=function(obj)
{obj=obj?obj:{};obj['_']=Math.random();if(typeof obj=='object')
{var code='';var self=this;for(var k in obj)
code+=(code?'&':'')+
k+'='+encodeURIComponent(obj[k]);return code;}
return obj;}}
XHR.get=function(url,data,callback)
{(new XHR()).get(url,data,callback);}
XHR.poll=function(interval,url,data,callback)
{if(isNaN(interval)||interval<1)
interval=5;if(!XHR._q)
{XHR._t=0;XHR._q=[];XHR._r=function(){for(var i=0,e=XHR._q[0];i<XHR._q.length;e=XHR._q[++i])
{if(!(XHR._t%e.interval)&&!e.xhr.busy())
e.xhr.get(e.url,e.data,e.callback);}
XHR._t++;};}
XHR._q.push({interval:interval,callback:callback,url:url,data:data,xhr:new XHR()});XHR.run();}
XHR.halt=function()
{if(XHR._i)
{try{document.getElementById('xhr_poll_status').style.display='';document.getElementById('xhr_poll_status_on').style.display='none';document.getElementById('xhr_poll_status_off').style.display='';document.getElementById('notice_status').style.marginRight='30px'}catch(e){}
window.clearInterval(XHR._i);XHR._i=null;}}
XHR.run=function()
{if(XHR._r&&!XHR._i)
{try{document.getElementById('xhr_poll_status').style.display='';document.getElementById('xhr_poll_status_on').style.display='';document.getElementById('xhr_poll_status_off').style.display='none';document.getElementById('notice_status').style.marginRight='30px'}catch(e){}
XHR._r();XHR._i=window.setInterval(XHR._r,1000);}}
XHR.running=function()
{return!!(XHR._r&&XHR._i);}

View File

@ -161,7 +161,7 @@
<%-= css %>
</style>
<% end -%>
<script src="<%=resource%>/xhr.js?<%= ver.luciversion %>"></script>
<script src="<%=media%>/js/xhr.js?v=<%= ver.luciversion %>"></script>
<style title="text/css" id="global-scroll">
::-webkit-scrollbar {
width: 4px
@ -180,16 +180,16 @@
>
<header>
<script>
<% if mode == 'normal' then %>
let color_scheme = window.matchMedia('(prefers-color-scheme: dark)');
document.body.setAttribute('data-theme', color_scheme.matches? 'dark' : 'light');
window.matchMedia && color_scheme.addEventListener('change', (event) => {
document.body.setAttribute('data-theme', event.matches? 'dark' : 'light');
})
<script>
function setTheme() {
let color_scheme = window.matchMedia('(prefers-color-scheme: dark)');
document.body.setAttribute('data-theme', color_scheme.matches && 'dark');
}
setTheme();
window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', setTheme);
</script>
<% end -%>
</script>
<% if navbar == 'display' then %>
<style>
@ -235,34 +235,12 @@
end
%>
<% if ucichanges > 0 then %>
<a class="label notice" style="margin-right: 30px;" href="<%=url(category, 'uci/changes')%>?redir=<%=http.urlencode(http.formvalue('redir') or table.concat(disp.context.request, "/"))%>"><%=translate('Unsaved Changes')%>: <%=ucichanges%></a>
<a id="notice_status" class="label notice" href="<%=url(category, 'uci/changes')%>?redir=<%=http.urlencode(http.formvalue('redir') or table.concat(disp.context.request, "/"))%>"><%=translate('Unsaved Changes')%>: <%=ucichanges%></a>
<% end %>
<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 id="refresh_on" class="mobile-hide"></span></span>
<span class="label" id="xhr_poll_status_off" style="display:none"><span id="refresh_off" class="mobile-hide"></span></span>
</span>
<script>
const pollStatus = document.querySelector('#xhr_poll_status');
const notice = document.querySelector('.notice');
function updateMarginRight() {
const style = notice.style; // 缓存样式对象
if (pollStatus.style.display === '') {
style.setProperty('margin-right', '30px', 'important');
} else if (pollStatus.style.display === 'none') {
style.setProperty('margin-right', '0', 'important');
}
}
const observer = new MutationObserver(function(mutationsList) {
for (let mutation of mutationsList) {
if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
updateMarginRight();
}
}
});
const config = { attributes: true, attributeFilter: ['style'] };
observer.observe(pollStatus, config);
updateMarginRight();
</script>
<% end %>
</div>
</div>

View File

@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=naiveproxy
PKG_VERSION:=111.0.5563.64-1
PKG_RELEASE:=1
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/klzgrad/naiveproxy/tar.gz/v$(PKG_VERSION)?
@ -16,12 +16,12 @@ PKG_LICENSE:=BSD 3-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
PKG_BUILD_DEPENDS:=gn/host
ifneq ($(wildcard $(TOPDIR)/feeds/packages/devel/ninja/ninja.mk),)
PKG_BUILD_DEPENDS+= ninja/host
endif
PKG_BUILD_PARALLEL:=1
NINJA ?= ninja
PKG_USE_MIPS16:=0
PKG_BUILD_PARALLEL:=1
ifneq ($(CONFIG_CPU_TYPE)," ")
CPU_TYPE:=$(word 1, $(subst +," ,$(CONFIG_CPU_TYPE)))
@ -58,22 +58,31 @@ ifneq ($(CONFIG_CCACHE),)
export naive_ccache_flags=cc_wrapper="$(CCACHE)"
endif
CLANG_VER:=16-init-17653-g39da55e8-2
CLANG_VER:=16-init-8697-g60809cd2-1
CLANG_FILE:=clang-llvmorg-$(CLANG_VER).tgz
define Download/CLANG
URL:=https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64
URL_FILE:=$(CLANG_FILE)
FILE:=$(CLANG_FILE)
HASH:=b4afdf625aa4b72c5d188ed28a13dd352a881a2a4149542f0c903698d0498017
HASH:=5ae35f85e0d32136795c6b223bf64263d46678dd4a24fea4e9039e58a32670de
endef
PGO_VER:=5563-1677886924-aa8d450a18b4f7f1cd41619f60bc5da6beb3c1d0
GN_VER:=1c4151ff5c1d6fbf7fa800b8d4bb34d3abc03a41
GN_FILE:=gn-git_revision-$(GN_VER).zip
define Download/GN_TOOL
URL:=https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+
URL_FILE:=git_revision:$(GN_VER)
FILE:=$(GN_FILE)
HASH:=7195291488d08f3a10e85b85d8c4816e077015f1c5f196f770003a97aa42caf8
endef
PGO_VER:=5414-1672766927-26b17aa1745606599e619feccfe46371e879e7c4
PGO_FILE:=chrome-linux-$(PGO_VER).profdata
define Download/PGO_PROF
URL:=https://storage.googleapis.com/chromium-optimization-profiles/pgo_profiles
URL_FILE:=$(PGO_FILE)
FILE:=$(PGO_FILE)
HASH:=eb16e7be414614c215ba90538f70f431cf444b9985865ad20d8743b707a235a6
HASH:=e9a52f7a60d46fd6e682b0e908b1363faeb6f96bc2e95d5d95095b33fa67e34a
endef
define Build/Prepare
@ -86,6 +95,8 @@ define Build/Prepare
mkdir -p "third_party/llvm-build/Release+Asserts" ; \
$(TAR) -xzf "$(DL_DIR)/$(CLANG_FILE)" -C "third_party/llvm-build/Release+Asserts" ; \
echo -e "llvmorg-$(CLANG_VER)" > "third_party/llvm-build/Release+Asserts/cr_build_revision" ; \
mkdir -p "gn/out" ; \
unzip -o "$(DL_DIR)/$(GN_FILE)" -d "gn/out" ; \
popd ; \
)
endef
@ -96,13 +107,13 @@ define Build/Configure
. ../init_env.sh "$(ARCH)" $(CPU_TYPE) $(CPU_SUBTYPE) "$(TOOLCHAIN_DIR)" ; \
export naive_flags+=" $$$${naive_ccache_flags}" ; \
mkdir -p "out" ; \
gn gen "out/Release" --args="$$$${naive_flags}" --script-executable="$(PYTHON)" ; \
./gn/out/gn gen "out/Release" --args="$$$${naive_flags}" --script-executable="$(PYTHON)" ; \
popd ; \
)
endef
define Build/Compile
ninja -C "$(PKG_BUILD_DIR)/src/out/Release" naive
+$(NINJA) -C "$(PKG_BUILD_DIR)/src/out/Release" naive
endef
define Package/naiveproxy/install
@ -111,6 +122,7 @@ define Package/naiveproxy/install
endef
$(eval $(call Download,CLANG))
$(eval $(call Download,GN_TOOL))
$(eval $(call Download,PGO_PROF))
$(eval $(call BuildPackage,naiveproxy))

View File

@ -3,7 +3,7 @@
@@ -18,22 +18,25 @@
#define PR_GET_TAGGED_ADDR_CTRL 56
#define PR_TAGGED_ADDR_ENABLE (1UL << 0)
-#if BUILDFLAG(IS_LINUX)
-#include <linux/version.h>
-

View File

@ -71,7 +71,6 @@ target_sysroot=\"${toolchain_dir}\""
case "${target_arch}" in
"arm")
naive_flags+=" arm_version=0 arm_cpu=\"${cpu_type}\""
case "${cpu_type}" in "arm1176jzf-s"|"arm926ej-s"|"mpcore"|"xscale") naive_flags+=" arm_use_thumb=false" ;; esac
if [ -n "${cpu_subtype}" ]; then
if grep -q "neon" <<< "${cpu_subtype}"; then
neon_flag="arm_use_neon=true"
@ -82,9 +81,11 @@ case "${target_arch}" in
else
naive_flags+=" arm_float_abi=\"soft\" arm_use_neon=false"
fi
;;
"arm64")
[ -n "${cpu_type}" ] && naive_flags+=" arm_cpu=\"${cpu_type}\""
case "${cpu_type}" in
"arm1176jzf-s"|"arm926ej-s"|"mpcore"|"xscale")
naive_flags+=" arm_use_thumb=false"
;;
esac
;;
"mipsel"|"mips64el")
naive_flags+=" use_thin_lto=false chrome_pgo_phase=0 mips_arch_variant=\"r2\""