From 7f8a0b4025e40dab0fe44b014e2892f79d4f3e6b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 23:39:24 +0800 Subject: [PATCH] update 2023-03-20 23:39:24 --- ddnsgo/Makefile | 8 +- luci-theme-design/Makefile | 2 +- luci-theme-design/dev/design.js | 88 +++++++------------ luci-theme-design/dev/script.js | 30 +++++-- .../htdocs/luci-static/design/js/design.js | 6 +- .../htdocs/luci-static/design/js/script.js | 9 +- 6 files changed, 68 insertions(+), 75 deletions(-) diff --git a/ddnsgo/Makefile b/ddnsgo/Makefile index 1c89dbcc9..30bcf026f 100644 --- a/ddnsgo/Makefile +++ b/ddnsgo/Makefile @@ -1,5 +1,3 @@ - - # SPDX-License-Identifier: GPL-3.0-only # # Copyright (C) 2021-2022 sirpdboy https://github.com/sirpdboy/luci-app-ddnsgo @@ -10,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ddnsgo -PKG_VERSION:=4.5.7 +PKG_VERSION:=5.0.3 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/jeessy2/ddns-go.git -PKG_SOURCE_VERSION:=46c21f6710dc9d5a932a437816486296c9c61f1c -PKG_MIRROR_HASH:=277fb153983d0fb5f0cba633e89943e451e0da141ca76773af2d6b97d871c8e6 +PKG_SOURCE_VERSION:=962dee0ba4907058b7e64e6565662d6c4aa939a6 +PKG_MIRROR_HASH:=f716694f8e9cefdafd2e6236ef2a110a9a418462710cdf716e7d322acff85006 PKG_LICENSE:=AGPL-3.0-only PKG_LICENSE_FILES:=LICENSE diff --git a/luci-theme-design/Makefile b/luci-theme-design/Makefile index 3e7ea18bf..a81439bdd 100644 --- a/luci-theme-design/Makefile +++ b/luci-theme-design/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=Design Theme LUCI_DEPENDS:= -PKG_VERSION:=5.5.3 +PKG_VERSION:=5.5.4 PKG_RELEASE:=20230320 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/luci-theme-design/dev/design.js b/luci-theme-design/dev/design.js index b770f4a26..03aca4fe6 100644 --- a/luci-theme-design/dev/design.js +++ b/luci-theme-design/dev/design.js @@ -1,67 +1,43 @@ (function ($) { - + const global = $('head #global-scroll'); + const isMobile = /phone|pad|pod|iPhone|iPod|ios|iOS|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test(navigator.userAgent); + function settingGlobalScroll() { - const global = $('head #global-scroll'); - const isMobile = /phone|pad|pod|iPhone|iPod|ios|iOS|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test(navigator.userAgent); - - if (!isMobile && global.length === 0) { - const style = document.createElement('style'); - style.id = 'global-scroll'; - style.textContent = '::-webkit-scrollbar { width: 4px; } ::-webkit-scrollbar-thumb { background: var(--scrollbarColor); border-radius: 2px; }'; - $('head').append(style); - } else if (isMobile && global.length > 0) { - global.remove(); - } + if (!isMobile && global.length === 0) { + const style = document.createElement('style'); + style.id = 'global-scroll'; + style.textContent = `::-webkit-scrollbar { width: 4px; } ::-webkit-scrollbar-thumb { background: var(--scrollbarColor); border-radius: 2px; }`; + $('head').append(style); + } else if (isMobile && global.length > 0) { + global.remove(); + } } + + const nodeStatusRealtime = $('.node-status-realtime'); $(document).ready(() => { // Fixed scrollbar styles for browsers on different platforms settingGlobalScroll(); + // .node-status-realtime embed[src="/luci-static/resources/bandwidth.svg"] + div + br + table // .node-status-realtime embed[src="/luci-static/resources/wifirate.svg"] + div + br + table // .node-status-realtime embed[src="/luci-static/resources/wireless.svg"] + div + br + table - if ($('.node-status-realtime').length != 0) { - const selectorValues = ["bandwidth", "wifirate", "wireless"]; - selectorValues.forEach(value => { - const target = $(`.node-status-realtime embed[src="/luci-static/resources/${value}.svg"] + div + br + table`); - if (target.length) { - const div = document.createElement("div"); - div.style.overflowX = "auto"; - target.before(div); - const newTarget = target.clone(); - target.remove(); - div.appendChild(newTarget.get(0)); - } - }); - } - - // Fixed luci-app-passwall/luci-app-ddns menu expand - const path = self.location.pathname - if (($(".node-services-passwall").length === 1 || $(".node-services-ddns").length ===1 ) && (path === "/cgi-bin/luci/admin/services/passwall" || path === "/cgi-bin/luci/admin/services/ddns")) { - var slide = $(".main > .main-left > .nav > .slide"); - slide.each(function () { - var ul = $(this).children("ul"); - ul.each(function () { - var liActive = $(this).children("li.active"); - liActive.each(function () { - var aTags = $(this).children("a"); - aTags.each(function () { - var href = $(this).attr("href"); - if (href === "/cgi-bin/luci/admin/services/passwall2" || href === "/cgi-bin/luci/admin/services/ddnsto") { - $(this).parent("li").removeClass("active"); - $(this).closest(".slide").find(".menu").first().click(); - } - }); - }); - }); - }); - } - - }); - - // Fixed scrollbar styles for browsers on different platforms - $(window).resize(function () { + const selectorValues = ['bandwidth', 'wifirate', 'wireless']; + selectorValues.forEach(value => { + const target = nodeStatusRealtime.find(`embed[src="/luci-static/resources/${value}.svg"] + div + br + table`); + if (target.length) { + const div = document.createElement('div'); + div.style.overflowX = 'auto'; + target.before(div); + const newTarget = target.clone(); + target.remove(); + div.appendChild(newTarget[0]); + } + }); + }); + + // Fixed scrollbar styles for browsers on different platforms + $(window).resize(() => { settingGlobalScroll(); - }); - -})(jQuery); \ No newline at end of file + }); + })(jQuery); \ No newline at end of file diff --git a/luci-theme-design/dev/script.js b/luci-theme-design/dev/script.js index 4640f4361..8797cefa5 100644 --- a/luci-theme-design/dev/script.js +++ b/luci-theme-design/dev/script.js @@ -1,8 +1,8 @@ /** * Material is a clean HTML5 theme for LuCI. It is based on luci-theme-bootstrap and MUI * - * luci-theme-material - * Copyright 2015 Lutty Yang + * luci-theme-argon + * Copyright 2023 gngpp * * Have a bug? Please create an issue here on GitHub! * https://github.com/LuttyYang/luci-theme-material/issues @@ -14,11 +14,17 @@ * * MUI: * https://github.com/muicss/mui + * + * luci-theme-material: + * https://github.com/LuttyYang/luci-theme-material/ + * * * Licensed to the public under the Apache License 2.0 */ (function ($) { + $(".main > .loading").fadeOut(); + /** * trim text, Remove spaces, wrap * @param text @@ -57,14 +63,16 @@ luciLocation = ["Main", "Login"]; return true; } - + $(".main > .main-left > .nav > .slide > .active").next(".slide-menu").stop(true).slideUp("fast"); + $(".main > .main-left > .nav > .slide > .menu").removeClass("active"); $(".main > .main-left > .nav > .slide > .menu").each(function () { var ulNode = $(this); + ulNode.next().find("a").each(function () { var that = $(this); var href = that.attr("href"); - if (href.indexOf(nodeUrl) != -1) { + if (new RegExp(nodeUrl + "$").test(href)) { ulNode.click(); ulNode.next(".slide-menu").stop(true, true); lastNode = that.parent(); @@ -101,11 +109,19 @@ } }); + if ($("#cbi-dhcp-lan-ignore").length > 0) { + observer.observe(document.getElementById("cbi-dhcp-lan-ignore"), { + subtree: true, + attributes: true + }); + } + /** * hook menu click and add the hash */ $(".main > .main-left > .nav > .slide > .slide-menu > li > a").click(function () { - if (lastNode != undefined) lastNode.removeClass("active"); + if (lastNode != undefined) + lastNode.removeClass("active"); $(this).parent().addClass("active"); $(".main > .loading").fadeIn("fast"); return true; @@ -115,7 +131,8 @@ * fix menu click */ $(".main > .main-left > .nav > .slide > .slide-menu > li").click(function () { - if (lastNode != undefined) lastNode.removeClass("active"); + if (lastNode != undefined) + lastNode.removeClass("active"); $(this).addClass("active"); $(".main > .loading").fadeIn("fast"); window.location = $($(this).find("a")[0]).attr("href"); @@ -130,6 +147,7 @@ mainNodeName = mainNodeName.replace(/[ \t\n\r\/]+/g, "_").toLowerCase(); $("body").addClass(mainNodeName); } + $(".cbi-button-up").val(""); $(".cbi-button-down").val(""); diff --git a/luci-theme-design/htdocs/luci-static/design/js/design.js b/luci-theme-design/htdocs/luci-static/design/js/design.js index a32ca43f6..eec80dbde 100644 --- a/luci-theme-design/htdocs/luci-static/design/js/design.js +++ b/luci-theme-design/htdocs/luci-static/design/js/design.js @@ -1,4 +1,2 @@ -(function($){function settingGlobalScroll(){const global=$('head #global-scroll');const isMobile=/phone|pad|pod|iPhone|iPod|ios|iOS|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test(navigator.userAgent);if(!isMobile&&global.length===0){const style=document.createElement('style');style.id='global-scroll';style.textContent='::-webkit-scrollbar { width: 4px; } ::-webkit-scrollbar-thumb { background: var(--scrollbarColor); border-radius: 2px; }';$('head').append(style);}else if(isMobile&&global.length>0){global.remove();}} -$(document).ready(()=>{settingGlobalScroll();if($('.node-status-realtime').length!=0){const selectorValues=["bandwidth","wifirate","wireless"];selectorValues.forEach(value=>{const target=$(`.node-status-realtime embed[src="/luci-static/resources/${value}.svg"] + div + br + table`);if(target.length){const div=document.createElement("div");div.style.overflowX="auto";target.before(div);const newTarget=target.clone();target.remove();div.appendChild(newTarget.get(0));}});} -const path=self.location.pathname -if(($(".node-services-passwall").length===1||$(".node-services-ddns").length===1)&&(path==="/cgi-bin/luci/admin/services/passwall"||path==="/cgi-bin/luci/admin/services/ddns")){var slide=$(".main > .main-left > .nav > .slide");slide.each(function(){var ul=$(this).children("ul");ul.each(function(){var liActive=$(this).children("li.active");liActive.each(function(){var aTags=$(this).children("a");aTags.each(function(){var href=$(this).attr("href");if(href==="/cgi-bin/luci/admin/services/passwall2"||href==="/cgi-bin/luci/admin/services/ddnsto"){$(this).parent("li").removeClass("active");$(this).closest(".slide").find(".menu").first().click();}});});});});}});$(window).resize(function(){settingGlobalScroll();});})(jQuery); +(function($){const global=$('head #global-scroll');const isMobile=/phone|pad|pod|iPhone|iPod|ios|iOS|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test(navigator.userAgent);function settingGlobalScroll(){if(!isMobile&&global.length===0){const style=document.createElement('style');style.id='global-scroll';style.textContent=`::-webkit-scrollbar { width: 4px; } ::-webkit-scrollbar-thumb { background: var(--scrollbarColor); border-radius: 2px; }`;$('head').append(style);}else if(isMobile&&global.length>0){global.remove();}} +const nodeStatusRealtime=$('.node-status-realtime');$(document).ready(()=>{settingGlobalScroll();const selectorValues=['bandwidth','wifirate','wireless'];selectorValues.forEach(value=>{const target=nodeStatusRealtime.find(`embed[src="/luci-static/resources/${value}.svg"] + div + br + table`);if(target.length){const div=document.createElement('div');div.style.overflowX='auto';target.before(div);const newTarget=target.clone();target.remove();div.appendChild(newTarget[0]);}});});$(window).resize(()=>{settingGlobalScroll();});})(jQuery); diff --git a/luci-theme-design/htdocs/luci-static/design/js/script.js b/luci-theme-design/htdocs/luci-static/design/js/script.js index 64076812d..232b89db2 100644 --- a/luci-theme-design/htdocs/luci-static/design/js/script.js +++ b/luci-theme-design/htdocs/luci-static/design/js/script.js @@ -1,8 +1,11 @@ -(function($){function trimText(text){return text.replace(/[ \t\n\r]+/g," ");} +(function($){$(".main > .loading").fadeOut();function trimText(text){return text.replace(/[ \t\n\r]+/g," ");} var lastNode=undefined;var mainNodeName=undefined;var nodeUrl="";(function(node){if(node[0]=="admin"){luciLocation=[node[1],node[2]];}else{luciLocation=node;} for(var i in luciLocation){nodeUrl+=luciLocation[i];if(i!=luciLocation.length-1){nodeUrl+="/";}}})(luciLocation);function getCurrentNodeByUrl(){var ret=false;if(!$('body').hasClass('logged-in')){luciLocation=["Main","Login"];return true;} -$(".main > .main-left > .nav > .slide > .menu").each(function(){var ulNode=$(this);ulNode.next().find("a").each(function(){var that=$(this);var href=that.attr("href");if(href.indexOf(nodeUrl)!=-1){ulNode.click();ulNode.next(".slide-menu").stop(true,true);lastNode=that.parent();lastNode.addClass("active");ret=true;return true;}});});return ret;} +$(".main > .main-left > .nav > .slide > .active").next(".slide-menu").stop(true).slideUp("fast");$(".main > .main-left > .nav > .slide > .menu").removeClass("active");$(".main > .main-left > .nav > .slide > .menu").each(function(){var ulNode=$(this);ulNode.next().find("a").each(function(){var that=$(this);var href=that.attr("href");if(new RegExp(nodeUrl+"$").test(href)){ulNode.click();ulNode.next(".slide-menu").stop(true,true);lastNode=that.parent();lastNode.addClass("active");ret=true;return true;}});});return ret;} $(".main > .main-left > .nav > .slide > .menu").click(function(){var ul=$(this).next(".slide-menu");var menu=$(this);if(!menu.hasClass("exit")){$(".main > .main-left > .nav > .slide > .active").next(".slide-menu").stop(true).slideUp("fast");$(".main > .main-left > .nav > .slide > .menu").removeClass("active");if(!ul.is(":visible")){menu.addClass("active");ul.addClass("active");ul.stop(true).slideDown("fast");}else{ul.stop(true).slideUp("fast",function(){menu.removeClass("active");ul.removeClass("active");});} -return false;}});$(".main > .main-left > .nav > .slide > .slide-menu > li > a").click(function(){if(lastNode!=undefined)lastNode.removeClass("active");$(this).parent().addClass("active");$(".main > .loading").fadeIn("fast");return true;});$(".main > .main-left > .nav > .slide > .slide-menu > li").click(function(){if(lastNode!=undefined)lastNode.removeClass("active");$(this).addClass("active");$(".main > .loading").fadeIn("fast");window.location=$($(this).find("a")[0]).attr("href");return false;});if(getCurrentNodeByUrl()){mainNodeName="node-"+luciLocation[0]+"-"+luciLocation[1];mainNodeName=mainNodeName.replace(/[ \t\n\r\/]+/g,"_").toLowerCase();$("body").addClass(mainNodeName);} +return false;}});if($("#cbi-dhcp-lan-ignore").length>0){observer.observe(document.getElementById("cbi-dhcp-lan-ignore"),{subtree:true,attributes:true});} +$(".main > .main-left > .nav > .slide > .slide-menu > li > a").click(function(){if(lastNode!=undefined) +lastNode.removeClass("active");$(this).parent().addClass("active");$(".main > .loading").fadeIn("fast");return true;});$(".main > .main-left > .nav > .slide > .slide-menu > li").click(function(){if(lastNode!=undefined) +lastNode.removeClass("active");$(this).addClass("active");$(".main > .loading").fadeIn("fast");window.location=$($(this).find("a")[0]).attr("href");return false;});if(getCurrentNodeByUrl()){mainNodeName="node-"+luciLocation[0]+"-"+luciLocation[1];mainNodeName=mainNodeName.replace(/[ \t\n\r\/]+/g,"_").toLowerCase();$("body").addClass(mainNodeName);} $(".cbi-button-up").val("");$(".cbi-button-down").val("");$("#maincontent > .container").find("a").each(function(){var that=$(this);var onclick=that.attr("onclick");if(onclick==undefined||onclick==""){that.click(function(){var href=that.attr("href");if(href.indexOf("#")==-1){$(".main > .loading").fadeIn("fast");return true;}});}});var showSide=false;$(".showSide").click(function(){if(showSide){$(".darkMask").stop(true).fadeOut("fast");$(".main-left").stop(true).animate({width:"0"},"fast");$(".main-right").css("overflow-y","auto");showSide=false;}else{$(".darkMask").stop(true).fadeIn("fast");$(".main-left").stop(true).animate({width:"17rem"},"fast");$(".main-right").css("overflow-y","hidden");$(".showSide").css("display","none");$("header").css("box-shadow","17rem 2px 4px rgb(0 0 0 / 8%)") showSide=true;}});$(".darkMask").click(function(){if(showSide){showSide=false;$(".darkMask").stop(true).fadeOut("fast");$(".main-left").stop(true).animate({width:"0"},"fast");$(".main-right").css("overflow-y","auto");$(".showSide").css("display","");$("header").css("box-shadow","0 2px 4px rgb(0 0 0 / 8%)")}});$(window).resize(function(){if($(window).width()>992){$(".showSide").css("display","");$(".main-left").css("width","");$(".darkMask").stop(true);$(".darkMask").css("display","none");showSide=false;$("header").css("box-shadow","17rem 2px 4px rgb(0 0 0 / 8%)")}else{$("header").css("box-shadow","0 2px 4px rgb(0 0 0 / 8%)")}});$("legend").each(function(){var that=$(this);that.after(""+that.text()+"");});$(".main-right").focus();$(".main-right").blur();$("input").attr("size","0");if(mainNodeName!=undefined){switch(mainNodeName){case "node-status-system_log":case "node-status-kernel_log":$("#syslog").focus(function(){$("#syslog").blur();$(".main-right").focus();$(".main-right").blur();});break;case "node-status-firewall":var button=$(".node-status-firewall > .main fieldset li > a");button.addClass("cbi-button cbi-button-reset a-to-btn");break;case "node-system-reboot":var button=$(".node-system-reboot > .main > .main-right p > a");button.addClass("cbi-button cbi-input-reset a-to-btn");break;}}})(jQuery);