diff --git a/luci-theme-ezengreen/Makefile b/luci-theme-ezengreen/Makefile old mode 100644 new mode 100755 index 9930ce2c4..ee17e224f --- a/luci-theme-ezengreen/Makefile +++ b/luci-theme-ezengreen/Makefile @@ -1,16 +1,16 @@ # # Copyright (C) 2008-2014 The LuCI Team +# Copyright (C) 2018-2019 Ycarus (Yannick Chabanois) # # This is free software, licensed under the Apache License, Version 2.0 . # include $(TOPDIR)/rules.mk -LUCI_TITLE:=Ezengreen Theme +LUCI_TITLE:=ezengreen Theme (default) LUCI_DEPENDS:= -PKG_LICENSE:=Apache-2.0 - +#include ../luci/luci.mk include $(TOPDIR)/feeds/luci/luci.mk # call BuildPackage - OpenWrt buildroot signature diff --git a/luci-theme-ezengreen/htdocs/luci-static/ezengreen/cascade.css b/luci-theme-ezengreen/htdocs/luci-static/openmptcprouter/cascade.css similarity index 100% rename from luci-theme-ezengreen/htdocs/luci-static/ezengreen/cascade.css rename to luci-theme-ezengreen/htdocs/luci-static/openmptcprouter/cascade.css diff --git a/luci-theme-ezengreen/htdocs/luci-static/openmptcprouter/favicon.png b/luci-theme-ezengreen/htdocs/luci-static/openmptcprouter/favicon.png new file mode 100755 index 000000000..7ee777910 Binary files /dev/null and b/luci-theme-ezengreen/htdocs/luci-static/openmptcprouter/favicon.png differ diff --git a/luci-theme-ezengreen/htdocs/luci-static/openmptcprouter/html5.js b/luci-theme-ezengreen/htdocs/luci-static/openmptcprouter/html5.js new file mode 100755 index 000000000..1ec510f2a --- /dev/null +++ b/luci-theme-ezengreen/htdocs/luci-static/openmptcprouter/html5.js @@ -0,0 +1,3 @@ +// HTML5 Shiv v3 | @jon_neal @afarkas @rem | MIT/GPL2 Licensed +// Uncompressed source: https://github.com/aFarkas/html5shiv +(function(a,b){function f(a){var c,d,e,f;b.documentMode>7?(c=b.createElement("font"),c.setAttribute("data-html5shiv",a.nodeName.toLowerCase())):c=b.createElement("shiv:"+a.nodeName);while(a.firstChild)c.appendChild(a.childNodes[0]);for(d=a.attributes,e=d.length,f=0;f7?e[g][e[g].length-1]=e[g][e[g].length-1].replace(d,'$1font[data-html5shiv="$2"]'):e[g][e[g].length-1]=e[g][e[g].length-1].replace(d,"$1shiv\\:$2"),e[g]=e[g].join("}");return e.join("{")}var c=function(a){return a.innerHTML="",a.childNodes.length===1}(b.createElement("a")),d=function(a,b,c){return b.appendChild(a),(c=(c?c(a):a.currentStyle).display)&&b.removeChild(a)&&c==="block"}(b.createElement("nav"),b.documentElement,a.getComputedStyle),e={elements:"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),shivDocument:function(a){a=a||b;if(a.documentShived)return;a.documentShived=!0;var f=a.createElement,g=a.createDocumentFragment,h=a.getElementsByTagName("head")[0],i=function(a){f(a)};c||(e.elements.join(" ").replace(/\w+/g,i),a.createElement=function(a){var b=f(a);return b.canHaveChildren&&e.shivDocument(b.document),b},a.createDocumentFragment=function(){return e.shivDocument(g())});if(!d&&h){var j=f("div");j.innerHTML=["x"].join(""),h.insertBefore(j.lastChild,h.firstChild)}return a}};e.shivDocument(b),a.html5=e;if(c||!a.attachEvent)return;a.attachEvent("onbeforeprint",function(){if(a.html5.supportsXElement||!b.namespaces)return;b.namespaces.shiv||b.namespaces.add("shiv");var c=-1,d=new RegExp("^("+a.html5.elements.join("|")+")$","i"),e=b.getElementsByTagName("*"),g=e.length,j,k=i(h(function(a,b){var c=[],d=a.length;while(d)c.unshift(a[--d]);d=b.length;while(d)c.unshift(b[--d]);c.sort(function(a,b){return a.sourceIndex-b.sourceIndex}),d=c.length;while(d)c[--d]=c[d].styleSheet;return c}(b.getElementsByTagName("style"),b.getElementsByTagName("link"))));while(++c= 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.addEventListener('poll-start', this.handleBodyMargin); + document.addEventListener('poll-stop', this.handleBodyMargin); + document.addEventListener('uci-new-changes', this.handleBodyMargin); + document.addEventListener('uci-clear-changes', this.handleBodyMargin); + window.addEventListener('resize', this.handleBodyMargin); + + this.handleBodyMargin(); + }, + + renderTabMenu: function(tree, url, level) { + var container = document.querySelector('#tabmenu'), + ul = E('ul', { 'class': 'tabs' }), + children = ui.menu.getChildren(tree), + activeNode = null; + + for (var i = 0; i < children.length; i++) { + var isActive = (L.env.dispatchpath[3 + (level || 0)] == 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]; + } + + if (ul.children.length == 0) + return E([]); + + container.appendChild(ul); + container.style.display = ''; + + if (activeNode) + this.renderTabMenu(activeNode, url + '/' + activeNode.name, (level || 0) + 1); + + return ul; + }, + + renderMainMenu: function(tree, url, level) { + var ul = level ? E('ul', { 'class': 'dropdown-menu' }) : document.querySelector('#topmenu'), + children = ui.menu.getChildren(tree); + + if (children.length == 0 || level > 1) + return E([]); + + for (var i = 0; i < children.length; i++) { + var submenu = this.renderMainMenu(children[i], url + '/' + children[i].name, (level || 0) + 1), + subclass = (!level && submenu.firstElementChild) ? 'dropdown' : null, + linkclass = (!level && submenu.firstElementChild) ? 'menu' : null, + linkurl = submenu.firstElementChild ? '#' : L.url(url, children[i].name); + + var li = E('li', { 'class': subclass }, [ + E('a', { 'class': linkclass, 'href': linkurl }, [ _(children[i].title) ]), + submenu + ]); + + ul.appendChild(li); + } + + ul.style.display = ''; + + return ul; + }, + + renderModeMenu: function(tree) { + var ul = 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); + + ul.appendChild(E('li', { 'class': isActive ? 'active' : null }, [ + E('a', { 'href': L.url(children[i].name) }, [ _(children[i].title) ]), + ' ', + E('span', { 'class': 'divider' }, [ '|' ]) + ])); + + if (isActive) + this.renderMainMenu(children[i], children[i].name); + } + + if (ul.children.length > 1) + ul.style.display = ''; + }, + + handleBodyMargin: function(ev) { + var body = document.querySelector('body'), + head = document.querySelector('header'); + + body.style.marginTop = head.offsetHeight + 'px'; + } +}); diff --git a/luci-theme-lamatel/htdocs/luci-static/lamatel/cascade.css b/luci-theme-ezengreen/htdocs/luci-static/resources/openmptcprouter/images/cascade.css similarity index 98% rename from luci-theme-lamatel/htdocs/luci-static/lamatel/cascade.css rename to luci-theme-ezengreen/htdocs/luci-static/resources/openmptcprouter/images/cascade.css index 26bc66806..740adc320 100755 --- a/luci-theme-lamatel/htdocs/luci-static/lamatel/cascade.css +++ b/luci-theme-ezengreen/htdocs/luci-static/resources/openmptcprouter/images/cascade.css @@ -192,7 +192,7 @@ body { } a { - color: #f6943e; + color: #215e21; text-decoration: none; line-height: inherit; font-weight: inherit; @@ -745,11 +745,13 @@ header { } header a { - color: #3f3f45; + color: #c4c4c4; } header h3 a:hover, header .brand:hover, header ul .active > a { - background-color: #fff; + background-color: #333; + background-color: rgba(0, 0, 0, 0.33); + color: #fff; text-decoration: none; } @@ -762,9 +764,9 @@ header h3 a, header .brand { display: block; padding: 16px 20px 16px; margin-left: -20px; - color: #3f3f45; + color: #fff; font-size: 24px; - font-weight: 440; + font-weight: 333; line-height: 1; } @@ -774,9 +776,9 @@ header p { } header .fill { - background-color: #e5e5e6; + background-color: #215e21; background-repeat: repeat-x; - box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.33), inset 0 -1px 0 rgba(0, 0, 0, 0.1); padding: 0 5px; } @@ -804,11 +806,13 @@ header div > ul a, .nav a { } header div > ul a:hover, .nav a:hover { + color: #fff; text-decoration: none; } header div > ul .active > a, .nav .active > a { - background-color: #fff; + background-color: #222; + background-color: rgba(0, 0, 0, 0.33); } header div > ul.secondary-nav, .nav.secondary-nav { @@ -833,14 +837,15 @@ header div > ul .dropdown-toggle:hover, .nav .dropdown-toggle:hover, header div > ul .dropdown.open .dropdown-toggle, .nav .dropdown.open .dropdown-toggle { - background: #fff; + background: #444; + background: rgba(0, 0, 0, 0.3); } header div > ul .menu-dropdown, .nav .menu-dropdown, header div > ul .dropdown-menu, .nav .dropdown-menu { - background-color: #bebec0; + background-color: #003300; } header div > ul .menu-dropdown a.menu, @@ -870,16 +875,16 @@ header div > ul .menu-dropdown li a, .nav .menu-dropdown li a, header div > ul .dropdown-menu li a, .nav .dropdown-menu li a { - color: #3f3f45; + color: #bfbfbf; } header div > ul .menu-dropdown li a:hover, .nav .menu-dropdown li a:hover, header div > ul .dropdown-menu li a:hover, .nav .dropdown-menu li a:hover { - background-color: #e5e5e6; + background-color: #215e21; background-repeat: repeat-x; - color: #3f3f45; + color: #fff; } header div > ul .menu-dropdown .active a, @@ -957,7 +962,7 @@ header .dropdown-menu a.hover, background-repeat: repeat-x; color: #404040; text-decoration: none; - box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0), inset 0 1px rgba(0, 0, 0, 0); + box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.025), inset 0 -1px rgba(0, 0, 0, 0.025); } .open .menu, @@ -1227,8 +1232,8 @@ footer { .cbi-button-apply, .cbi-button-reload, .cbi-button-edit { - border-color: #f6943e; - color: #f6943e; + border-color: #4aa44b; + color: #4aa44b; } .cbi-button-negative, @@ -1255,7 +1260,7 @@ footer { .cbi-page-actions .cbi-button-apply, .cbi-section-actions .cbi-button-edit { color: #fff; - background: #f6943e; + background: #4aa44b; } .cbi-button-positive.important, @@ -1287,7 +1292,7 @@ footer { } .cbi-dropdown:focus { - outline: 2px solid #f6943e; + outline: 2px solid #4b6e9b; } .cbi-dropdown > ul { @@ -1630,7 +1635,7 @@ a.label:hover { } .label.success { - background-color: #f6943e; + background-color: #46a546; } .label.notice { @@ -1920,7 +1925,7 @@ table table td, div.cbi-value var, .td.cbi-value-field var { font-style: italic; - color: #f6943e; + color: #215e21; } .uci-change-list { diff --git a/luci-theme-ezengreen/htdocs/luci-static/ezengreen/ezenlink.png b/luci-theme-ezengreen/htdocs/luci-static/resources/openmptcprouter/images/ezenlink.png similarity index 100% rename from luci-theme-ezengreen/htdocs/luci-static/ezengreen/ezenlink.png rename to luci-theme-ezengreen/htdocs/luci-static/resources/openmptcprouter/images/ezenlink.png diff --git a/luci-theme-ezengreen/htdocs/luci-static/ezengreen/favicon.ico b/luci-theme-ezengreen/htdocs/luci-static/resources/openmptcprouter/images/favicon.ico similarity index 100% rename from luci-theme-ezengreen/htdocs/luci-static/ezengreen/favicon.ico rename to luci-theme-ezengreen/htdocs/luci-static/resources/openmptcprouter/images/favicon.ico diff --git a/luci-theme-ezengreen/htdocs/luci-static/ezengreen/footer.png b/luci-theme-ezengreen/htdocs/luci-static/resources/openmptcprouter/images/footer.png similarity index 100% rename from luci-theme-ezengreen/htdocs/luci-static/ezengreen/footer.png rename to luci-theme-ezengreen/htdocs/luci-static/resources/openmptcprouter/images/footer.png diff --git a/luci-theme-lamatel/htdocs/luci-static/lamatel/mobile.css b/luci-theme-ezengreen/htdocs/luci-static/resources/openmptcprouter/images/mobile.css similarity index 100% rename from luci-theme-lamatel/htdocs/luci-static/lamatel/mobile.css rename to luci-theme-ezengreen/htdocs/luci-static/resources/openmptcprouter/images/mobile.css diff --git a/luci-theme-ezengreen/htdocs/luci-static/resources/openmptcprouter/images/omr-logo.png b/luci-theme-ezengreen/htdocs/luci-static/resources/openmptcprouter/images/omr-logo.png new file mode 100755 index 000000000..3d532aec0 Binary files /dev/null and b/luci-theme-ezengreen/htdocs/luci-static/resources/openmptcprouter/images/omr-logo.png differ diff --git a/luci-theme-ezengreen/htdocs/luci-static/ezengreen/outdoorrouter.png b/luci-theme-ezengreen/htdocs/luci-static/resources/openmptcprouter/images/outdoorrouter.png similarity index 100% rename from luci-theme-ezengreen/htdocs/luci-static/ezengreen/outdoorrouter.png rename to luci-theme-ezengreen/htdocs/luci-static/resources/openmptcprouter/images/outdoorrouter.png diff --git a/luci-theme-ezengreen/luasrc/view/themes/ezengreen/footer.htm b/luci-theme-ezengreen/luasrc/view/themes/ezengreen/footer.htm deleted file mode 100644 index 47f467f03..000000000 --- a/luci-theme-ezengreen/luasrc/view/themes/ezengreen/footer.htm +++ /dev/null @@ -1,29 +0,0 @@ -<%# - Copyright 2008 Steven Barth - Copyright 2008 Jo-Philipp Wich - Copyright 2012 David Menting - Licensed to the public under the Apache License 2.0. --%> - -<% - local ver = require "luci.version" - local disp = require "luci.dispatcher" - local request = disp.context.path - local category = request[1] - local tree = disp.node() - local categories = disp.node_childs(tree) -%> - - - - - diff --git a/luci-theme-ezengreen/luasrc/view/themes/ezengreen/header.htm b/luci-theme-ezengreen/luasrc/view/themes/ezengreen/header.htm deleted file mode 100644 index e4a3d9cfd..000000000 --- a/luci-theme-ezengreen/luasrc/view/themes/ezengreen/header.htm +++ /dev/null @@ -1,72 +0,0 @@ -<%# - Copyright 2008 Steven Barth - Copyright 2008-2016 Jo-Philipp Wich - Copyright 2012 David Menting - Licensed to the public under the Apache License 2.0. --%> -<% - local sys = require "luci.sys" - local util = require "luci.util" - local http = require "luci.http" - local disp = require "luci.dispatcher" - local ver = require "luci.version" - - local boardinfo = util.ubus("system", "board") or { } - - local node = disp.context.dispatched - local path = table.concat(disp.context.path, "-") - - http.prepare_content("text/html; charset=UTF-8") --%> - - - - - <%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI - - - - - <% if node and node.css then %> - - <% end -%> - <% if css then %> - - <% end -%> - - - - - -
-
-
- <%=boardinfo.hostname or "?"%> - <% render_topmenu() %> -
- -
-
-
-
- -
- <%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%> -
-

<%:No password set!%>

-

<%:You are using the default router password. Please custom your router password to protect the web interface and enable SSH.%>

- -
- <%- end -%> - - - - <% if category then render_tabmenu(category, cattree) end %> diff --git a/luci-theme-ezengreen/luasrc/view/themes/openmptcprouter/footer.htm b/luci-theme-ezengreen/luasrc/view/themes/openmptcprouter/footer.htm new file mode 100755 index 000000000..0fdd0e4d3 --- /dev/null +++ b/luci-theme-ezengreen/luasrc/view/themes/openmptcprouter/footer.htm @@ -0,0 +1,19 @@ +<%# + Copyright 2008 Steven Barth + Copyright 2008 Jo-Philipp Wich + Copyright 2012 David Menting + Licensed to the public under the Apache License 2.0. +-%> + +<% local ver = require "luci.version" %> + + +
+ + + + diff --git a/luci-theme-ezengreen/luasrc/view/themes/openmptcprouter/header.htm b/luci-theme-ezengreen/luasrc/view/themes/openmptcprouter/header.htm new file mode 100755 index 000000000..932764c24 --- /dev/null +++ b/luci-theme-ezengreen/luasrc/view/themes/openmptcprouter/header.htm @@ -0,0 +1,90 @@ +<%# + Copyright 2008 Steven Barth + Copyright 2008-2016 Jo-Philipp Wich + Copyright 2012 David Menting + Licensed to the public under the Apache License 2.0. +-%> + +<% + local sys = require "luci.sys" + local util = require "luci.util" + local http = require "luci.http" + local disp = require "luci.dispatcher" + + local boardinfo = util.ubus("system", "board") + + local node = disp.context.dispatched + + -- send as HTML5 + http.prepare_content("text/html") + + -- Get current and latest OMR version + local current_omr_version = luci.model.uci.cursor():get("openmptcprouter","settings","version") or "" + local latest_omr_version = luci.model.uci.cursor():get("openmptcprouter","latest_versions","omr") or "" + +-%> + + + + + <%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - system + + + + + + + + + <% if node and node.css then %> + + <% end -%> + <% if css then %> + + <% end -%> + + + + + "> +
+
+
+ openmptcprouter businessOpenMPTCProuter + +
+
+
+
+ +
+ <%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%> +
+

<%:No password set!%>

+

<%:There is no password set on this router. Please configure a root password to protect the web interface.%>

+ <% if disp.lookup("admin/system/admin") then %> + + <% end %> +
+ <%- end -%> + <%- if current_omr_version ~= "" and latest_omr_version ~= "" and current_omr_version < latest_omr_version then -%> +
+

<%=translatef("你的蚂蚁聚合openmptcprouter of china商业版 版本号 %s 最新 版本号 %s 现在可以升级",current_omr_version,latest_omr_version)%>

+ +
+ <%- end -%> +
+ + +
+ + + + diff --git a/luci-theme-ezengreen/root/etc/uci-defaults/30_luci-theme-ezengreen b/luci-theme-ezengreen/root/etc/uci-defaults/luci-theme-ezengreen similarity index 65% rename from luci-theme-ezengreen/root/etc/uci-defaults/30_luci-theme-ezengreen rename to luci-theme-ezengreen/root/etc/uci-defaults/luci-theme-ezengreen index 3b96c4239..e1c8313d2 100755 --- a/luci-theme-ezengreen/root/etc/uci-defaults/30_luci-theme-ezengreen +++ b/luci-theme-ezengreen/root/etc/uci-defaults/luci-theme-ezengreen @@ -1,12 +1,10 @@ #!/bin/sh -if [ "$PKG_UPGRADE" != 1 ]; then - uci get luci.themes.ezengreen >/dev/null 2>&1 || \ +if [ "$(uci -q get luci.themes.ezengreen)" = "" ]; then uci batch <<-EOF set luci.themes.ezengreen=/luci-static/ezengreen set luci.main.mediaurlbase=/luci-static/ezengreen commit luci EOF fi - exit 0 diff --git a/luci-theme-lamatel/Makefile b/luci-theme-lamatel/Makefile deleted file mode 100644 index 988e850c7..000000000 --- a/luci-theme-lamatel/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (C) 2008-2014 The LuCI Team -# -# This is free software, licensed under the Apache License, Version 2.0 . -# - -include $(TOPDIR)/rules.mk - -LUCI_TITLE:=Lamatel Theme -LUCI_DEPENDS:= - -PKG_LICENSE:=Apache-2.0 - -include $(TOPDIR)/feeds/luci/luci.mk - -# call BuildPackage - OpenWrt buildroot signature diff --git a/luci-theme-lamatel/htdocs/luci-static/lamatel/ezenlink.png b/luci-theme-lamatel/htdocs/luci-static/lamatel/ezenlink.png deleted file mode 100755 index 070a12b7d..000000000 Binary files a/luci-theme-lamatel/htdocs/luci-static/lamatel/ezenlink.png and /dev/null differ diff --git a/luci-theme-lamatel/htdocs/luci-static/lamatel/favicon.ico b/luci-theme-lamatel/htdocs/luci-static/lamatel/favicon.ico deleted file mode 100755 index 674d8e5d0..000000000 Binary files a/luci-theme-lamatel/htdocs/luci-static/lamatel/favicon.ico and /dev/null differ diff --git a/luci-theme-lamatel/htdocs/luci-static/lamatel/footer.png b/luci-theme-lamatel/htdocs/luci-static/lamatel/footer.png deleted file mode 100755 index ef3914007..000000000 Binary files a/luci-theme-lamatel/htdocs/luci-static/lamatel/footer.png and /dev/null differ diff --git a/luci-theme-lamatel/htdocs/luci-static/lamatel/logo.png b/luci-theme-lamatel/htdocs/luci-static/lamatel/logo.png deleted file mode 100755 index 2b7dd1c51..000000000 Binary files a/luci-theme-lamatel/htdocs/luci-static/lamatel/logo.png and /dev/null differ diff --git a/luci-theme-lamatel/luasrc/view/themes/lamatel/footer.htm b/luci-theme-lamatel/luasrc/view/themes/lamatel/footer.htm deleted file mode 100644 index eb0994f74..000000000 --- a/luci-theme-lamatel/luasrc/view/themes/lamatel/footer.htm +++ /dev/null @@ -1,29 +0,0 @@ -<%# - Copyright 2008 Steven Barth - Copyright 2008 Jo-Philipp Wich - Copyright 2012 David Menting - Licensed to the public under the Apache License 2.0. --%> - -<% - local ver = require "luci.version" - local disp = require "luci.dispatcher" - local request = disp.context.path - local category = request[1] - local tree = disp.node() - local categories = disp.node_childs(tree) -%> - -
- - - diff --git a/luci-theme-lamatel/luasrc/view/themes/lamatel/header.htm b/luci-theme-lamatel/luasrc/view/themes/lamatel/header.htm deleted file mode 100644 index cf042bb8c..000000000 --- a/luci-theme-lamatel/luasrc/view/themes/lamatel/header.htm +++ /dev/null @@ -1,206 +0,0 @@ -<%# - Copyright 2008 Steven Barth - Copyright 2008-2016 Jo-Philipp Wich - Copyright 2012 David Menting - Licensed to the public under the Apache License 2.0. --%> - -<% - local sys = require "luci.sys" - local util = require "luci.util" - local http = require "luci.http" - local disp = require "luci.dispatcher" - - local boardinfo = util.ubus("system", "board") - - local request = disp.context.path - local request2 = disp.context.request - - local category = request[1] - local cattree = category and disp.node(category) - - local leaf = request2[#request2] - - local tree = disp.node() - local node = disp.context.dispatched - - local categories = disp.node_childs(tree) - - local c = tree - local i, r - - -- tag all nodes leading to this page - for i, r in ipairs(request) do - if c.nodes and c.nodes[r] then - c = c.nodes[r] - c._menu_selected = true - end - end - - -- send as HTML5 - http.prepare_content("text/html") - - local function nodeurl(prefix, name, query) - local u = url(prefix, name) - if query then - u = u .. http.build_querystring(query) - end - return pcdata(u) - end - - local function render_tabmenu(prefix, node, level) - if not level then - level = 1 - end - - local childs = disp.node_childs(node) - if #childs > 0 then - if level > 2 then - write('
    ') - end - - local selected_node - local selected_name - local i, v - - for i, v in ipairs(childs) do - local nnode = node.nodes[v] - if nnode._menu_selected then - selected_node = nnode - selected_name = v - end - - if level > 2 then - write('
  • %s
  • ' %{ - v, (nnode._menu_selected or (node.leaf and v == leaf)) and 'active' or '', - nodeurl(prefix, v, nnode.query), - striptags(translate(nnode.title)) - }) - end - end - - if level > 2 then - write('
') - end - - if selected_node then - render_tabmenu(prefix .. "/" .. selected_name, selected_node, level + 1) - end - end - end - - local function render_submenu(prefix, node) - local childs = disp.node_childs(node) - if #childs > 0 then - write('') - end - end - - local function render_topmenu() - local childs = disp.node_childs(cattree) - if #childs > 0 then - write('') - end - end - - local function render_changes() - -- calculate the number of unsaved changes - if tree.nodes[category] and tree.nodes[category].ucidata then - local ucichanges = 0 - - local i, j - for i, j in pairs(require("luci.model.uci").cursor():changes()) do - ucichanges = ucichanges + #j - end - - if ucichanges > 0 then - write('%s: %d' %{ - url(category, 'uci/changes'), - http.urlencode(http.formvalue('redir') or table.concat(disp.context.request, "/")), - translate('Unsaved Changes'), - ucichanges - }) - end - end - end --%> - - - - - <%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI - - - - - <% if node and node.css then %> - - <% end -%> - <% if css then %> - - <% end -%> - - - - - -
-
-
- Outdoor Router - <% render_topmenu() %> -
- -
-
-
-
- -
- <%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%> -
-

<%:No password set!%>

-

<%:You are using the default router password. Please custom your router password to protect the web interface and enable SSH.%>

- -
- <%- end -%> - - - - <% if category then render_tabmenu(category, cattree) end %> diff --git a/luci-theme-lamatel/root/etc/uci-defaults/30_luci-theme-lametal b/luci-theme-lamatel/root/etc/uci-defaults/30_luci-theme-lametal deleted file mode 100755 index 3c64379bd..000000000 --- a/luci-theme-lamatel/root/etc/uci-defaults/30_luci-theme-lametal +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -uci batch <<-EOF - set luci.themes.lamtel=/luci-static/lamatel - set luci.main.mediaurlbase=/luci-static/lamatel - commit luci -EOF -exit 0