From 25e77239454f54986acb94af26e2aa3c18a27ea3 Mon Sep 17 00:00:00 2001 From: Bard Date: Sun, 24 Mar 2024 11:04:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20openwrt-23.05.3=20?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=A1=B5=E9=9D=A2=E6=BB=9A=E5=8A=A8=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../luci-static/resources/menu-argon.js | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/luci-theme-argon/htdocs/luci-static/resources/menu-argon.js b/luci-theme-argon/htdocs/luci-static/resources/menu-argon.js index cc4d4b6..ae9d3fa 100644 --- a/luci-theme-argon/htdocs/luci-static/resources/menu-argon.js +++ b/luci-theme-argon/htdocs/luci-static/resources/menu-argon.js @@ -2,6 +2,36 @@ 'require baseclass'; 'require ui'; +// 获取当前页面的 URL +var currentUrl = window.location.href; + +// 定义正则表达式模式 +var pattern = /\/cgi-bin\/luci\/admin\/status\/logs.*/; + +// 检查 URL 是否匹配日志页面 +if (pattern.test(currentUrl)) { + + // 动态注入 overflow-x 和 overflow-y 样式的值为 visible + // max-width > 1280px + var mainElement = document.querySelector(".main"); + mainElement.style.overflowY = "visible"; + + // max-width <= 1280px + var mainRightElement = document.querySelector(".main-right"); + mainRightElement.style.overflowX = "visible"; + mainRightElement.style.overflowY = "visible"; + + // 延时 500 毫秒执行 + setTimeout(function() { + // 获取页面滚动高度 + var pageHeight = document.body.scrollHeight; + + // 将 .main-left (左侧菜单)元素的高度设置为当前页面滚动高度 + var mainLeftElement = document.querySelector(".main-left"); + mainLeftElement.style.height = pageHeight + "px"; + }, 500); +} + return baseclass.extend({ __init__: function () { ui.menu.load().then(L.bind(this.render, this));