diff --git a/Makefile b/Makefile index 1f786223..3727e8d9 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,9 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=Argon Theme LUCI_DEPENDS:= -PKG_VERSION:=2.2.6 -PKG_RELEASE:=20210215 +PKG_VERSION:=2.2.7 +PKG_RELEASE:=20210318 include $(TOPDIR)/feeds/luci/luci.mk -# call BuildPackage - OpenWrt buildroot signature +# call BuildPackage - OpenWrt buildroot signature \ No newline at end of file diff --git a/htdocs/luci-static/argon/css/cascade.css b/htdocs/luci-static/argon/css/cascade.css index d5441cb8..8ebe0a27 100644 --- a/htdocs/luci-static/argon/css/cascade.css +++ b/htdocs/luci-static/argon/css/cascade.css @@ -883,6 +883,9 @@ div[style="width:100%;height:300px;border:1px solid #000;background:#fff"] { background-color: var(--primary); transition: all 0.2s; } +.main .main-left .nav li.slide ul.active { + display: block; +} .main .main-left .nav li.slide .slide-menu .active:hover { background: none; } diff --git a/htdocs/luci-static/argon/less/cascade.less b/htdocs/luci-static/argon/less/cascade.less index 54969b3b..5d5329d2 100644 --- a/htdocs/luci-static/argon/less/cascade.less +++ b/htdocs/luci-static/argon/less/cascade.less @@ -1,4 +1,4 @@ -// out: ../css/cascade.css, compress: false , sourceMap: false +// out: ../css/cascade.css, compress: true , sourceMap: false /** * Argon is a clean HTML5 theme for LuCI. It is based on luci-theme-material and Argon Template * @@ -8,7 +8,7 @@ * Have a bug? Please create an issue here on GitHub! * https://github.com/jerrykuku/luci-theme-argon/issues * - * luci-theme-material: + * luci-theme-material: * Copyright 2015 Lutty Yang * https://github.com/LuttyYang/luci-theme-material/ * @@ -780,12 +780,11 @@ header { right: 1.25rem; float: right; - span[data-indicator] { - display: inline-block; + span[data-indicator="poll-status"] { + display: block; font-size: 0.8rem; font-weight: bold; padding: 0.3rem 0.8rem; - margin: 0 0.5rem; white-space: nowrap; text-decoration: none; text-transform: uppercase; @@ -2417,8 +2416,8 @@ body:not(.Interfaces) .cbi-rowstyle-2:first-child { width: 0; height: 100%; transition: width .25s ease-in; - background: #5e72e4; - background: var(--primary); + background: #5bc0de; + background: var(--bar-bg); } .cbi-progressbar::after { @@ -3814,7 +3813,7 @@ pre.command-output { display: inline-block; } - + .main>.main-left>.nav>.slide>.slide-menu>li>a { font-size: 0.8rem; diff --git a/htdocs/luci-static/resources/menu.js b/htdocs/luci-static/resources/menu.js new file mode 100644 index 00000000..8cebe70f --- /dev/null +++ b/htdocs/luci-static/resources/menu.js @@ -0,0 +1,156 @@ +'use strict'; +'require baseclass'; +'require ui'; + +return baseclass.extend({ + __init__: function () { + ui.menu.load().then(L.bind(this.render, this)); + }, + + render: function (tree) { + var node = tree, + url = ''; + + this.renderModeMenu(node); + + if (L.env.dispatchpath.length >= 3) { + for (var i = 0; i < 3 && node; i++) { + node = node.children[L.env.dispatchpath[i]]; + url = url + (url ? '/' : '') + L.env.dispatchpath[i]; + } + + if (node) + this.renderTabMenu(node, url); + } + + document.querySelector('a.showSide') + .addEventListener('click', ui.createHandlerFn(this, 'handleSidebarToggle')); + }, + + handleMenuExpand: function (ev) { + var a = ev.target, slide = a.parentNode, slide_menu = a.nextElementSibling; + + document.querySelectorAll('.main .main-left .nav > li >ul.active').forEach(function (ul) { + if (ul !== slide) { + ul.classList.remove('active'); + } + + }); + + if (!slide_menu) + return; + + slide_menu.classList.add('active'); + a.blur(); + ev.preventDefault(); + ev.stopPropagation(); + }, + + renderMainMenu: function (tree, url, level) { + var l = (level || 0) + 1, + ul = E('ul', { 'class': level ? 'slide-menu' : 'nav' }), + children = ui.menu.getChildren(tree); + + if (children.length == 0 || l > 2) + return E([]); + + for (var i = 0; i < children.length; i++) { + var isActive = ((L.env.dispatchpath[l] == children[i].name) && (L.env.dispatchpath[l - 1] == tree.name)), + submenu = this.renderMainMenu(children[i], url + '/' + children[i].name, l), + hasChildren = submenu.children.length, + activeClass = hasChildren ? 'slide' : null; + if (isActive) { + ul.classList.add('active'); + activeClass += " active"; + } + + ul.appendChild(E('li', { 'class': activeClass }, [ + E('a', { + 'href': L.url(url, children[i].name), + 'click': (l == 1) ? ui.createHandlerFn(this, 'handleMenuExpand') : null, + 'class': hasChildren ? 'menu' : null, + 'data-title': hasChildren ? children[i].title.replace(" ", "_") : children[i].title.replace(" ", "_"), + }, [_(children[i].title)]), + submenu + ])); + } + + if (l == 1) { + document.querySelector('#mainmenu').appendChild(ul); + document.querySelector('#mainmenu').style.display = ''; + + } + return ul; + }, + + renderModeMenu: function (tree) { + var menu = document.querySelector('#modemenu'), + children = ui.menu.getChildren(tree); + + for (var i = 0; i < children.length; i++) { + var isActive = (L.env.requestpath.length ? children[i].name == L.env.requestpath[0] : i == 0); + + if (i > 0) + menu.appendChild(E([], ['\u00a0|\u00a0'])); + + menu.appendChild(E('li', {}, [ + E('a', { + 'href': L.url(children[i].name), + 'class': isActive ? 'active' : null + }, [_(children[i].title)]) + ])); + + if (isActive) + this.renderMainMenu(children[i], children[i].name); + } + + if (menu.children.length > 1) + menu.style.display = ''; + }, + + renderTabMenu: function (tree, url, level) { + var container = document.querySelector('#tabmenu'), + l = (level || 0) + 1, + ul = E('ul', { 'class': 'tabs' }), + children = ui.menu.getChildren(tree), + activeNode = null; + + if (children.length == 0) + return E([]); + + for (var i = 0; i < children.length; i++) { + var isActive = (L.env.dispatchpath[l + 2] == children[i].name), + activeClass = isActive ? ' active' : '', + className = 'tabmenu-item-%s %s'.format(children[i].name, activeClass); + + ul.appendChild(E('li', { 'class': className }, [ + E('a', { 'href': L.url(url, children[i].name) }, [_(children[i].title)]) + ])); + + if (isActive) + activeNode = children[i]; + } + + container.appendChild(ul); + container.style.display = ''; + + if (activeNode) + container.appendChild(this.renderTabMenu(activeNode, url + '/' + activeNode.name, l)); + + return ul; + }, + + handleSidebarToggle: function (ev) { + var btn = ev.currentTarget, + bar = document.querySelector('#mainmenu'); + + if (btn.classList.contains('active')) { + btn.classList.remove('active'); + bar.classList.remove('active'); + } + else { + btn.classList.add('active'); + bar.classList.add('active'); + } + } +}); diff --git a/luasrc/view/themes/argon/footer.htm b/luasrc/view/themes/argon/footer.htm index a4e1df4b..47ad644a 100644 --- a/luasrc/view/themes/argon/footer.htm +++ b/luasrc/view/themes/argon/footer.htm @@ -7,13 +7,13 @@ Have a bug? Please create an issue here on GitHub! https://github.com/jerrykuku/luci-theme-argon/issues - luci-theme-material: + luci-theme-material: Copyright 2015 Lutty Yang - + Agron Theme - https://demos.creative-tim.com/argon-dashboard/index.html + https://demos.creative-tim.com/argon-dashboard/index.html - Licensed to the public under the Apache License 2.0 + Licensed to the public under the Apache License 2.0 -%> <% local ver = require "luci.version" %> @@ -41,6 +41,6 @@ } }) - + diff --git a/luasrc/view/themes/argon/header.htm b/luasrc/view/themes/argon/header.htm index 1da2486b..f25fa2bc 100644 --- a/luasrc/view/themes/argon/header.htm +++ b/luasrc/view/themes/argon/header.htm @@ -119,106 +119,6 @@ -