1
0
mirror of https://github.com/kenzok8/small-package synced 2025-09-20 19:11:30 +08:00

update-09.05

This commit is contained in:
github-actions[bot]
2021-09-05 16:50:22 +08:00
parent d010ad431b
commit 7be2b15d1a
3134 changed files with 543230 additions and 0 deletions

24
luci-theme-edge/Makefile Normal file
View File

@ -0,0 +1,24 @@
#
# Copyright (C) 2008-2019 GaryPang
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=Edge Theme
LUCI_DEPENDS:=+curl
PKG_VERSION:=2.5
PKG_RELEASE:=20210107
include $(TOPDIR)/feeds/luci/luci.mk
define Package/luci-theme-edge/postinst
#!/bin/sh
sed -i ":a;$!N;s/tmpl.render.*sysauth_template.*return/local scope = { duser = default_user, fuser = user }\nlocal ok, res = luci.util.copcall\(luci.template.render_string, [[<% include\(\"themes\/\" .. theme .. \"\/sysauth\"\) %>]], scope\)\nif ok then\nreturn res\nend\nreturn luci.template.render\(\"sysauth\", scope\)/;ba" /usr/lib/lua/luci/dispatcher.lua
sed -i ":a;$!N;s/t.render.*sysauth_template.*return/local scope = { duser = h, fuser = a }\nlocal ok, res = luci.util.copcall\(luci.template.render_string, [[<% include\(\"themes\/\" .. theme .. \"\/sysauth\"\) %>]], scope\)\nif ok then\nreturn res\nend\nreturn luci.template.render\(\"sysauth\", scope\)/;ba" /usr/lib/lua/luci/dispatcher.lua
rm -Rf /var/luci-modulecache
endef
# call BuildPackage - OpenWrt buildroot signature

33
luci-theme-edge/README.md Normal file
View File

@ -0,0 +1,33 @@
# luci-theme-edge ([中文](/README_ZH.md))
[1]: https://img.shields.io/badge/license-MIT-brightgreen.svg
[2]: /LICENSE
[3]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
[4]: https://github.com/https://github.com/garypang13/luci-theme-edge/pulls
[5]: https://img.shields.io/badge/Issues-welcome-brightgreen.svg
[6]: https://github.com/https://github.com/garypang13/luci-theme-edge/issues/new
[7]: https://img.shields.io/badge/release-v2.1-blue.svg?
[10]: https://img.shields.io/badge/Contact-telegram-blue
[11]: https://t.me/openwrt_nginx
[![license][1]][2]
[![PRs Welcome][3]][4]
[![Issue Welcome][5]][6]
[![Contact Me][10]][11]
A new Luci theme for LEDE/OpenWRT
Edge is a clean HTML5 theme for LuCI. It is based on luci-theme-argon Template
## Thanks to
luci-theme-argon: https://github.com/jerrykuku/luci-theme-argon
![](/Screenshots/1.png)
![](/Screenshots/2.png)
![](/Screenshots/3.png)
![](/Screenshots/4.png)
![](/Screenshots/5.png)
<br/>
<br />
<br />
<img src="/Screenshots/6.png" width="550" />

View File

@ -0,0 +1,23 @@
# luci-theme-edge ([Eng](/README.md))
[1]: https://img.shields.io/badge/license-MIT-brightgreen.svg
[2]: /LICENSE
[3]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
[4]: https://github.com/https://github.com/kiddin9/luci-theme-edge/pulls
[5]: https://img.shields.io/badge/Issues-welcome-brightgreen.svg
[6]: https://github.com/https://github.com/kiddin9/luci-theme-edge/issues/new
[7]: https://img.shields.io/badge/release-v2.1-blue.svg?
[10]: https://img.shields.io/badge/Contact-telegram-blue
[11]: https://t.me/openwrt_nginx
[![license][1]][2]
[![PRs Welcome][3]][4]
[![Issue Welcome][5]][6]
[![Contact Me][10]][11]
全新的 Openwrt 主题基于luci-theme-argon 主题进行修改。
## 注意
仅适用于 luci 19.07
## 感谢
luci-theme-argon: https://github.com/jerrykuku/luci-theme-argon

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
:root{--main-color:#09c;--header-bg:#09c;--header-color:#fff;--bar-bg:#5e72e4;--menu-bg-color:#fff;--menu-color:#5f6368;--menu-color-hover:#202124;--main-menu-color:#202124;--submenu-bg-hover:#d4d4d4;--submenu-bg-hover-active:#09c;--blue:#5e72e4;--indigo:#5603ad;--purple:#8965e0;--pink:#f3a4b5;--red:#f5365c;--orange:#fb6340;--yellow:#ffd600;--green:#2dce89;--teal:#11cdef;--cyan:#2bffc6;--gray:#8898aa;--gray-dark:#32325d;--light:#96999c;--lighter:#e9ecef;--primary:#5e72e4;--secondary:#f7fafc;--success:#2dce89;--info:#11cdef;--warning:#fb6340;--danger:#f5365c;--dark:#212529;--default:#172b4d;--white:#fff;--neutral:#fff;--darker:#000;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-body:"Microsoft Yahei","WenQuanYi Micro Hei",sans-serif,"Helvetica Neue",Helvetica,"Hiragino Sans GB"}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,29 @@
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In -->
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
x="0px" y="0px" viewBox="0 0 465.3 465.3" enable-background="new 0 0 465.3 465.3"
xml:space="preserve">
<defs>
</defs>
<g>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="120.4726" y1="232.6669" x2="344.8612" y2="232.6669">
<stop offset="0" style="stop-color:#F57E20"/>
<stop offset="0.5018" style="stop-color:#FFFFFF;stop-opacity:0.6"/>
<stop offset="1" style="stop-color:#F57E20"/>
</linearGradient>
<polygon fill="url(#SVGID_1_)" points="120.5,344.9 228,228 344.9,120.5 237.4,237.4 "/>
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="120.4726" y1="232.6669" x2="344.8612" y2="232.6669">
<stop offset="0" style="stop-color:#F57E20"/>
<stop offset="0.5018" style="stop-color:#FFFFFF;stop-opacity:0.6"/>
<stop offset="1" style="stop-color:#F57E20"/>
</linearGradient>
<polygon fill="url(#SVGID_2_)" points="120.5,120.5 237.4,228 344.9,344.9 228,237.4 "/>
<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="0" y1="232.6669" x2="465.3338" y2="232.6669">
<stop offset="0" style="stop-color:#A22890"/>
<stop offset="0.5018" style="stop-color:#FFFFFF;stop-opacity:0.6"/>
<stop offset="1" style="stop-color:#A22890"/>
</linearGradient>
<polygon fill="url(#SVGID_3_)" points="0,232.7 232.7,226 465.3,232.7 232.7,239.3 "/>
<polygon fill="none" points="232.7,465.3 226,232.7 232.7,0 239.3,232.7 "/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#202124" d="m8,10.033663l-6.898535,-6.013274l-1.060688,0.972974l7.959223,6.986249l7.959223,-6.986249l-1.060688,-0.972974l-6.898535,6.013274z"/></svg>

After

Width:  |  Height:  |  Size: 221 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#888" d="M8,0c-4.355,0-7.898,3.481-7.998,7.812,0.092-3.779,2.966-6.812,6.498-6.812,3.59,0,6.5,3.134,6.5,7,0,0.828,0.672,1.5,1.5,1.5s1.5-0.672,1.5-1.5c0-4.418-3.582-8-8-8zM8,16c4.355,0,7.898-3.481,7.998-7.812-0.092,3.779-2.966,6.812-6.498,6.812-3.59,0-6.5-3.134-6.5-7,0-0.828-0.672-1.5-1.5-1.5s-1.5,0.672-1.5,1.5c0,4.418,3.582,8,8,8z"/></svg>

After

Width:  |  Height:  |  Size: 413 B

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,357 @@
/**
* Argon is a clean HTML5 theme for LuCI. It is based on luci-theme-material and Argon Template
*
* luci-theme-argon
* Copyright 2019 Jerrykuku <jerrykuku@qq.com>
*
* Have a bug? Please create an issue here on GitHub!
* https://github.com/jerrykuku/luci-theme-argon/issues
*
* luci-theme-bootstrap:
* Copyright 2008 Steven Barth <steven@midlink.org>
* Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
* Copyright 2012 David Menting <david@nut-bolt.nl>
*
* MUI:
* https://github.com/muicss/mui
*
* luci-theme-material:
* https://github.com/LuttyYang/luci-theme-material/
*
* Agron Theme
* https://demos.creative-tim.com/argon-dashboard/index.html
*
* Login background
* https://unsplash.com/
*
* Licensed to the public under the Apache License 2.0
*/
/*
* Font generate by Icomoon<icomoon.io>
*/
(function ($) {
$(".main > .loading").fadeOut();
/**
* trim text, Remove spaces, wrap
* @param text
* @returns {string}
*/
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);
/**
* get the current node by Burl (primary)
* @returns {boolean} success?
*/
function getCurrentNodeByUrl() {
var ret = false;
if (!$('body').hasClass('logged-in')) {
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) {
ulNode.click();
ulNode.next(".slide-menu").stop(true, true);
lastNode = that.parent();
lastNode.addClass("active");
ret = true;
return true;
}
});
});
return ret;
}
/**
* menu click
*/
$(".main > .main-left > .nav > .slide > .menu").click(function () {
var ul = $(this).next(".slide-menu");
var menu = $(this);
$(".main > .main-left > .nav > .slide > .menu").each(function () {
var ulNode = $(this);
ulNode.removeClass("active");
ulNode.next(".slide-menu").stop(true).slideUp("fast")
});
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;
});
// define what element should be observed by the observer
// and what types of mutations trigger the callback
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");
$(this).parent().addClass("active");
$(".main > .loading").fadeIn("fast");
return true;
});
/**
* fix menu click
*/
$(".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;
});
/**
* fix submenu click
*/
$("#maincontent > .container > .tabs > li").click(function () {
$(".main > .loading").fadeIn("fast");
window.location = $($(this).find("a")[0]).attr("href");
return false;
});
/**
* get current node and open it
*/
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("");
/**
* hook other "A Label" and add hash to it.
*/
$("#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;
}
});
}
});
/**
* Sidebar expand
*/
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: "15rem"
}, "fast");
$(".main-right").css("overflow-y", "hidden");
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");
}
});
$(window).resize(function () {
if ($(window).width() > 921) {
$(".main-left").css("width", "");
$(".darkMask").stop(true);
$(".darkMask").css("display", "none");
showSide = false;
}
});
/**
* fix legend position
*/
$("legend").each(function () {
var that = $(this);
that.after("<span class='panel-title'>" + that.text() + "</span>");
});
$(".cbi-section-table-titles, .cbi-section-table-descr, .cbi-section-descr").each(function () {
var that = $(this);
if (that.text().trim() == "") {
that.css("display", "none");
}
});
$(".node-main-login > .main .cbi-value.cbi-value-last .cbi-input-text").focus(function () {
//$(".node-main-login > .main > .main-right > .login-bg").addClass("blur");
});
$(".node-main-login > .main .cbi-value.cbi-value-last .cbi-input-text").blur(function () {
//$(".node-main-login > .main > .main-right > .login-bg").removeClass("blur");
});
$(".main-right").focus();
$(".main-right").blur();
$("input").attr("size", "0");
if (mainNodeName != undefined) {
console.log(mainNodeName);
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;
}
}
var getaudio = $('#player')[0];
/* Get the audio from the player (using the player's ID), the [0] is necessary */
/* Global variable for a timer. When the mouse is hovered over the speaker it will start playing after hovering for 1 second, if less than 1 second it won't play (incase you accidentally hover over the speaker) */
var audiostatus = 'off';
/* Global variable for the audio's status (off or on). It's a bit crude but it works for determining the status. */
$(document).on('click touchend', '.speaker', function() {
/* Touchend is necessary for mobile devices, click alone won't work */
if (!$('.speaker').hasClass("speakerplay")) {
if (audiostatus == 'off') {
$('.speaker').addClass('speakerplay');
getaudio.load();
getaudio.play();
audiostatus = 'on';
return false;
} else if (audiostatus == 'on') {
$('.speaker').addClass('speakerplay');
getaudio.play()
}
} else if ($('.speaker').hasClass("speakerplay")) {
getaudio.pause();
$('.speaker').removeClass('speakerplay');
audiostatus = 'on';
}
});
$('#player').on('ended', function() {
$('.speaker').removeClass('speakerplay');
/*When the audio has finished playing, remove the class speakerplay*/
audiostatus = 'off';
/*Set the status back to off*/
});
setTimeout(function(){
var config = {
// How long Waves effect duration
// when it's clicked (in milliseconds)
duration: 600
};
Waves.attach("button,input[type='button'],input[type='reset'],input[type='submit']", ['waves-light']);
// Ripple on hover
$("button,input[type='button'],input[type='reset'],input[type='submit']").mouseenter(function() {
Waves.ripple(this, {wait: null});
}).mouseleave(function() {
Waves.calm(this);
});
Waves.init(config);
$(".waves-input-wrapper").filter(function () {
if($(this).children().css("display")=="none"){
        return true;
    }else{
        return false;
    }
}).hide();
$("div>select:first-child,div>input[type='text']:first-child").filter(function () {
return (!$(this).parents(".cbi-dynlist").length&&!$("body.Diagnostics").length&&!$(this).hasClass("cbi-input-password"))
}).after("<span class='focus-input'></span>");
$("input[type='checkbox']").filter(function () {
return (!$(this).next("label").length)
}).show();
$("select,input").filter(function () {
return ($(this).next(".focus-input").length)
}).focus(function(){
$(this).css("border-bottom","1px solid #fff");
}).blur(function(){
$(this).css("border-bottom","1px solid #9e9e9e");
});
}, 0);
$(".cbi-value").has("textarea").css("background","none");
if(document.body.scrollHeight > window.innerHeight){
$(".cbi-page-actions.control-group").addClass("fixed")
}
})(jQuery);

View File

@ -0,0 +1,41 @@
;(function(window,factory){'use strict';if(typeof define==='function'&&define.amd){define([],function(){window.Waves=factory.call(window);return window.Waves;});}
else if(typeof exports==='object'){module.exports=factory.call(window);}
else{window.Waves=factory.call(window);}})(typeof global==='object'?global:this,function(){'use strict';var Waves=Waves||{};var $$=document.querySelectorAll.bind(document);var toString=Object.prototype.toString;var isTouchAvailable='ontouchstart'in window;function isWindow(obj){return obj!==null&&obj===obj.window;}
function getWindow(elem){return isWindow(elem)?elem:elem.nodeType===9&&elem.defaultView;}
function isObject(value){var type=typeof value;return type==='function'||type==='object'&&!!value;}
function isDOMNode(obj){return isObject(obj)&&obj.nodeType>0;}
function getWavesElements(nodes){var stringRepr=toString.call(nodes);if(stringRepr==='[object String]'){return $$(nodes);}else if(isObject(nodes)&&/^\[object (Array|HTMLCollection|NodeList|Object)\]$/.test(stringRepr)&&nodes.hasOwnProperty('length')){return nodes;}else if(isDOMNode(nodes)){return[nodes];}
return[];}
function offset(elem){var docElem,win,box={top:0,left:0},doc=elem&&elem.ownerDocument;docElem=doc.documentElement;if(typeof elem.getBoundingClientRect!==typeof undefined){box=elem.getBoundingClientRect();}
win=getWindow(doc);return{top:box.top+win.pageYOffset-docElem.clientTop,left:box.left+win.pageXOffset-docElem.clientLeft};}
function convertStyle(styleObj){var style='';for(var prop in styleObj){if(styleObj.hasOwnProperty(prop)){style+=(prop+':'+styleObj[prop]+';');}}
return style;}
var Effect={duration:750,delay:200,show:function(e,element,velocity){if(e.button===2){return false;}
element=element||this;var ripple=document.createElement('div');ripple.className='waves-ripple waves-rippling';element.appendChild(ripple);var pos=offset(element);var relativeY=0;var relativeX=0;if('touches'in e&&e.touches.length){relativeY=(e.touches[0].pageY-pos.top);relativeX=(e.touches[0].pageX-pos.left);}
else{relativeY=(e.pageY-pos.top);relativeX=(e.pageX-pos.left);}
relativeX=relativeX>=0?relativeX:0;relativeY=relativeY>=0?relativeY:0;var scale='scale('+((element.clientWidth/100)*3)+')';var translate='translate(0,0)';if(velocity){translate='translate('+(velocity.x)+'px, '+(velocity.y)+'px)';}
ripple.setAttribute('data-hold',Date.now());ripple.setAttribute('data-x',relativeX);ripple.setAttribute('data-y',relativeY);ripple.setAttribute('data-scale',scale);ripple.setAttribute('data-translate',translate);var rippleStyle={top:relativeY+'px',left:relativeX+'px'};ripple.classList.add('waves-notransition');ripple.setAttribute('style',convertStyle(rippleStyle));ripple.classList.remove('waves-notransition');rippleStyle['-webkit-transform']=scale+' '+translate;rippleStyle['-moz-transform']=scale+' '+translate;rippleStyle['-ms-transform']=scale+' '+translate;rippleStyle['-o-transform']=scale+' '+translate;rippleStyle.transform=scale+' '+translate;rippleStyle.opacity='1';var duration=e.type==='mousemove'?2500:Effect.duration;rippleStyle['-webkit-transition-duration']=duration+'ms';rippleStyle['-moz-transition-duration']=duration+'ms';rippleStyle['-o-transition-duration']=duration+'ms';rippleStyle['transition-duration']=duration+'ms';ripple.setAttribute('style',convertStyle(rippleStyle));},hide:function(e,element){element=element||this;var ripples=element.getElementsByClassName('waves-rippling');for(var i=0,len=ripples.length;i<len;i++){removeRipple(e,element,ripples[i]);}
if(isTouchAvailable){element.removeEventListener('touchend',Effect.hide);element.removeEventListener('touchcancel',Effect.hide);}
element.removeEventListener('mouseup',Effect.hide);element.removeEventListener('mouseleave',Effect.hide);}};var TagWrapper={input:function(element){var parent=element.parentNode;if(parent.tagName.toLowerCase()==='i'&&parent.classList.contains('waves-effect')){return;}
var wrapper=document.createElement('i');wrapper.className=element.className+' waves-input-wrapper';element.className='waves-button-input';parent.replaceChild(wrapper,element);wrapper.appendChild(element);},img:function(element){var parent=element.parentNode;if(parent.tagName.toLowerCase()==='i'&&parent.classList.contains('waves-effect')){return;}
var wrapper=document.createElement('i');parent.replaceChild(wrapper,element);wrapper.appendChild(element);}};function removeRipple(e,el,ripple){if(!ripple){return;}
ripple.classList.remove('waves-rippling');var relativeX=ripple.getAttribute('data-x');var relativeY=ripple.getAttribute('data-y');var scale=ripple.getAttribute('data-scale');var translate=ripple.getAttribute('data-translate');var diff=Date.now()-Number(ripple.getAttribute('data-hold'));var delay=350-diff;if(delay<0){delay=0;}
if(e.type==='mousemove'){delay=150;}
var duration=e.type==='mousemove'?2500:Effect.duration;setTimeout(function(){var style={top:relativeY+'px',left:relativeX+'px',opacity:'0','-webkit-transition-duration':duration+'ms','-moz-transition-duration':duration+'ms','-o-transition-duration':duration+'ms','transition-duration':duration+'ms','-webkit-transform':scale+' '+translate,'-moz-transform':scale+' '+translate,'-ms-transform':scale+' '+translate,'-o-transform':scale+' '+translate,'transform':scale+' '+translate};ripple.setAttribute('style',convertStyle(style));setTimeout(function(){try{el.removeChild(ripple);}catch(e){return false;}},duration);},delay);}
var TouchHandler={touches:0,allowEvent:function(e){var allow=true;if(/^(mousedown|mousemove)$/.test(e.type)&&TouchHandler.touches){allow=false;}
return allow;},registerEvent:function(e){var eType=e.type;if(eType==='touchstart'){TouchHandler.touches+=1;}else if(/^(touchend|touchcancel)$/.test(eType)){setTimeout(function(){if(TouchHandler.touches){TouchHandler.touches-=1;}},500);}}};function getWavesEffectElement(e){if(TouchHandler.allowEvent(e)===false){return null;}
var element=null;var target=e.target||e.srcElement;while(target.parentElement){if((!(target instanceof SVGElement))&&target.classList.contains('waves-effect')){element=target;break;}
target=target.parentElement;}
return element;}
function showEffect(e){var element=getWavesEffectElement(e);if(element!==null){if(element.disabled||element.getAttribute('disabled')||element.classList.contains('disabled')){return;}
TouchHandler.registerEvent(e);if(e.type==='touchstart'&&Effect.delay){var hidden=false;var timer=setTimeout(function(){timer=null;Effect.show(e,element);},Effect.delay);var hideEffect=function(hideEvent){if(timer){clearTimeout(timer);timer=null;Effect.show(e,element);}
if(!hidden){hidden=true;Effect.hide(hideEvent,element);}
removeListeners();};var touchMove=function(moveEvent){if(timer){clearTimeout(timer);timer=null;}
hideEffect(moveEvent);removeListeners();};element.addEventListener('touchmove',touchMove,false);element.addEventListener('touchend',hideEffect,false);element.addEventListener('touchcancel',hideEffect,false);var removeListeners=function(){element.removeEventListener('touchmove',touchMove);element.removeEventListener('touchend',hideEffect);element.removeEventListener('touchcancel',hideEffect);};}else{Effect.show(e,element);if(isTouchAvailable){element.addEventListener('touchend',Effect.hide,false);element.addEventListener('touchcancel',Effect.hide,false);}
element.addEventListener('mouseup',Effect.hide,false);element.addEventListener('mouseleave',Effect.hide,false);}}}
Waves.init=function(options){var body=document.body;options=options||{};if('duration'in options){Effect.duration=options.duration;}
if('delay'in options){Effect.delay=options.delay;}
if(isTouchAvailable){body.addEventListener('touchstart',showEffect,false);body.addEventListener('touchcancel',TouchHandler.registerEvent,false);body.addEventListener('touchend',TouchHandler.registerEvent,false);}
body.addEventListener('mousedown',showEffect,false);};Waves.attach=function(elements,classes){elements=getWavesElements(elements);if(toString.call(classes)==='[object Array]'){classes=classes.join(' ');}
classes=classes?' '+classes:'';var element,tagName;for(var i=0,len=elements.length;i<len;i++){element=elements[i];tagName=element.tagName.toLowerCase();if(['input','img'].indexOf(tagName)!==-1){TagWrapper[tagName](element);element=element.parentElement;}
if(element.className.indexOf('waves-effect')===-1){element.className+=' waves-effect'+classes;}}};Waves.ripple=function(elements,options){elements=getWavesElements(elements);var elementsLen=elements.length;options=options||{};options.wait=options.wait||0;options.position=options.position||null;if(elementsLen){var element,pos,off,centre={},i=0;var mousedown={type:'mousedown',button:1};var hideRipple=function(mouseup,element){return function(){Effect.hide(mouseup,element);};};for(;i<elementsLen;i++){element=elements[i];pos=options.position||{x:element.clientWidth/2,y:element.clientHeight/2};off=offset(element);centre.x=off.left+pos.x;centre.y=off.top+pos.y;mousedown.pageX=centre.x;mousedown.pageY=centre.y;Effect.show(mousedown,element);if(options.wait>=0&&options.wait!==null){var mouseup={type:'mouseup',button:1};setTimeout(hideRipple(mouseup,element),options.wait);}}}};Waves.calm=function(elements){elements=getWavesElements(elements);var mouseup={type:'mouseup',button:1};for(var i=0,len=elements.length;i<len;i++){Effect.hide(mouseup,elements[i]);}};Waves.displayEffect=function(options){console.error('Waves.displayEffect() has been deprecated and will be removed in future version. Please use Waves.init() to initialize Waves effect');Waves.init(options);};return Waves;});

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,14 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 111.7 111.7" enable-background="new 0 0 111.7 111.7" xml:space="preserve" id="sun">
<g>
<g>
<circle opacity="5.000000e-02" fill="#F9A149" cx="55.9" cy="55.9" r="55.9"/>
<circle opacity="0.2083" fill="#F9A854" cx="55.9" cy="55.9" r="48.7"/>
<circle opacity="0.3667" fill="#FAAE5E" cx="55.9" cy="55.9" r="41.6"/>
<circle opacity="0.525" fill="#FAB567" cx="55.9" cy="55.9" r="34.4"/>
<circle opacity="0.6833" fill="#FABC71" cx="55.9" cy="55.9" r="27.3"/>
<circle opacity="0.8417" fill="#FBC27A" cx="55.9" cy="55.9" r="20.1"/>
<circle fill="#FBC984" cx="55.9" cy="55.9" r="13"/>
</g>
<circle fill="#FFFFFF" cx="55.9" cy="55.9" r="4.6"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 761 B

View File

@ -0,0 +1,135 @@
/*!
* Waves v0.7.6
* http://fian.my.id/Waves
*
* Copyright 2014-2018 Alfiana E. Sibuea and other contributors
* Released under the MIT license
* https://github.com/fians/Waves/blob/master/LICENSE */
.waves-effect {
position: relative;
cursor: pointer;
display: inline-block;
overflow: hidden;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
.waves-effect .waves-ripple {
position: absolute;
border-radius: 50%;
width: 100px;
height: 100px;
margin-top: -50px;
margin-left: -50px;
opacity: 0;
background: rgba(0, 0, 0, 0.2);
background: -webkit-radial-gradient(rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.5) 60%, rgba(255, 255, 255, 0) 70%);
background: -o-radial-gradient(rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.5) 60%, rgba(255, 255, 255, 0) 70%);
background: -moz-radial-gradient(rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.5) 60%, rgba(255, 255, 255, 0) 70%);
background: radial-gradient(rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.5) 60%, rgba(255, 255, 255, 0) 70%);
-webkit-transition: all 0.5s ease-out;
-moz-transition: all 0.5s ease-out;
-o-transition: all 0.5s ease-out;
transition: all 0.5s ease-out;
-webkit-transition-property: -webkit-transform, opacity;
-moz-transition-property: -moz-transform, opacity;
-o-transition-property: -o-transform, opacity;
transition-property: transform, opacity;
-webkit-transform: scale(0) translate(0, 0);
-moz-transform: scale(0) translate(0, 0);
-ms-transform: scale(0) translate(0, 0);
-o-transform: scale(0) translate(0, 0);
transform: scale(0) translate(0, 0);
pointer-events: none;
}
.waves-effect.waves-light .waves-ripple {
background: rgba(255, 255, 255, 0.4);
background: -webkit-radial-gradient(rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%);
background: -o-radial-gradient(rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%);
background: -moz-radial-gradient(rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%);
background: radial-gradient(rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%);
}
.waves-effect.waves-classic .waves-ripple {
background: rgba(0, 0, 0, 0.2);
}
.waves-effect.waves-classic.waves-light .waves-ripple {
background: rgba(255, 255, 255, 0.4);
}
.waves-notransition {
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
transition: none !important;
}
.waves-button,
.waves-circle {
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
-o-transform: translateZ(0);
transform: translateZ(0);
-webkit-mask-image: -webkit-radial-gradient(circle, white 100%, black 100%);
}
.waves-button,
.waves-button:hover,
.waves-button:visited,
.waves-button-input {
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
border: none;
outline: none;
color: inherit;
background-color: rgba(0, 0, 0, 0);
font-size: 1em;
line-height: 1em;
text-align: center;
text-decoration: none;
z-index: 1;
}
.waves-button {
padding: 0.85em 1.1em;
border-radius: 0.2em;
}
.waves-button-input {
margin: 0;
padding: 0.85em 1.1em;
}
.waves-input-wrapper {
border-radius: 0.2em;
vertical-align: bottom;
}
.waves-input-wrapper.waves-button {
padding: 0;
}
.waves-input-wrapper .waves-button-input {
position: relative;
top: 0;
left: 0;
z-index: 1;
}
.waves-circle {
text-align: center;
width: 2.5em;
height: 2.5em;
line-height: 2.5em;
border-radius: 50%;
}
.waves-float {
-webkit-mask-image: none;
-webkit-box-shadow: 0px 1px 1.5px 1px rgba(0, 0, 0, 0.12);
box-shadow: 0px 1px 1.5px 1px rgba(0, 0, 0, 0.12);
-webkit-transition: all 300ms;
-moz-transition: all 300ms;
-o-transition: all 300ms;
transition: all 300ms;
}
.waves-float:active {
-webkit-box-shadow: 0px 8px 20px 1px rgba(0, 0, 0, 0.3);
box-shadow: 0px 8px 20px 1px rgba(0, 0, 0, 0.3);
}
.waves-block {
display: block;
}

View File

@ -0,0 +1,12 @@
<%#
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
Licensed to the public under the Apache License 2.0.
-%>
<%
if not luci.dispatcher.context.template_header_sent then
include("themes/" .. theme .. "/header_login")
luci.dispatcher.context.template_header_sent = true
end
%>

View File

@ -0,0 +1,52 @@
<%#
edge is a clean HTML5 theme for LuCI. It is based on luci-theme-material edge Template
luci-theme-edge
Copyright 2019 Jerrykuku <jerrykuku@qq.com>
Have a bug? Please create an issue here on GitHub!
https://github.com/jerrykuku/luci-theme-edge/issues
luci-theme-material:
Copyright 2015 Lutty Yang <lutty@wcan.in>
Agron Theme
https://demos.creative-tim.com/edge-dashboard/index.html
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)
%>
</div>
<footer class="mobile-hide">
<a href="https://github.com/openwrt/luci">Powered by <%= ver.luciname %> (<%= ver.luciversion %>)</a> /
<%= ver.distversion %>
<% if #categories > 1 then %>
<ul class="breadcrumb pull-right" id="modemenu">
<% for i, r in ipairs(categories) do %>
<li<% if request[1] == r then %> class="active"<%end%>><a href="<%=controller%>/<%=r%>/"><%=striptags(translate(tree.nodes[r].title))%></a> <span class="divider">|</span></li>
<% end %>
</ul>
<% end %>
</footer>
</div>
</div>
<script>
// thanks for Jo-Philipp Wich <jow@openwrt.org>
var luciLocation = <%= luci.http.write_json(luci.dispatcher.context.path) %>;
</script>
<script src="<%=media%>/js/script.js"></script>
<script src="<%=media%>/js/waves.js"></script>
</body>
</html>

View File

@ -0,0 +1,286 @@
<%#
edge is a clean HTML5 theme for LuCI. It is based on luci-theme-material edge Template
luci-theme-edge
Copyright 2020 GaryPang <garyp@qq.com>
Have a bug? Please create an issue here on GitHub!
https://github.com/jerrykuku/luci-theme-edge/issues
luci-theme-material:
Copyright 2015 Lutty Yang <lutty@wcan.in>
Agron Theme
https://demos.creative-tim.com/edge-dashboard/index.html
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 fs = require "nixio.fs"
local nutil = require "nixio.util"
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('<ul class="tabs">')
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('<li class="tabmenu-item-%s %s"><a href="%s">%s</a></li>' %{
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('</ul>')
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('<ul class="slide-menu">')
for i, r in ipairs(childs) do
local nnode = node.nodes[r]
local title = pcdata(striptags(translate(nnode.title)))
write('<li><a data-title="%s" href="%s">%s</a></li>' %{
title,
nodeurl(prefix, r, nnode.query),
title
})
end
write('</ul>')
end
end
local function render_topmenu()
local childs = disp.node_childs(cattree)
if #childs > 0 then
write('<ul class="nav">')
for i, r in ipairs(childs) do
local nnode = cattree.nodes[r]
local grandchildren = disp.node_childs(nnode)
if #grandchildren > 0 then
local title = pcdata(striptags(translate(nnode.title)))
local en_title = pcdata(striptags(string.gsub(nnode.title," ","_")))
write('<li class="slide"><a class="menu" data-title="%s" href="#">%s</a>' %{
en_title,
title
})
render_submenu(category .. "/" .. r, nnode)
write('</li>')
else
local title = pcdata(striptags(translate(nnode.title)))
local en_title = pcdata(striptags(nnode.title))
write('<li class="slide"><a class="Logout" data-title="%s" href="%s">%s</a></li>' %{
en_title,
nodeurl(category, r, nnode.query),
title
})
end
end
write('</ul>')
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
for i, j in pairs(require("luci.model.uci").cursor():changes()) do
for k, l in pairs(j) do
for m, n in pairs(l) do
ucichanges = ucichanges + 1;
end
end
end
if ucichanges > 0 then
write('<a class="uci_change_indicator label notice" href="%s?redir=%s">%s: %d</a>' %{
url(category, 'uci/changes'),
http.urlencode(http.formvalue('redir') or table.concat(disp.context.request, "/")),
translate('Unsaved Changes'),
ucichanges
})
end
end
end
math.randomseed(os.time())
-%>
<!DOCTYPE html>
<html lang="<%=luci.i18n.context.lang%>">
<head>
<meta charset="utf-8">
<title>
<%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %>
- LuCI</title>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<meta name="format-detection" content="telephone=no, email=no" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="x5-fullscreen" content="true">
<meta name="full-screen" content="yes">
<meta name="x5-page-mode" content="app">
<meta name="browsermode" content="application">
<meta name="theme-color" content="#5e72e4">
<meta name="msapplication-tap-highlight" content="no">
<meta name="msapplication-TileColor" content="#5e72e4">
<meta name="application-name" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
<meta name="apple-mobile-web-app-title" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
<meta name="msapplication-TileImage" content="<%=media%>/logo.png" />
<link rel="icon" href="<%=media%>/logo.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" href="<%=media%>/logo.png" sizes="144x144">
<link rel="stylesheet" href="<%=media%>/waves.css">
<link rel="stylesheet" href="<%=media%>/cascade.css">
<link rel="shortcut icon" href="<%=media%>/favicon.ico">
<% if node and node.css then %>
<link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
<% end -%>
<% if css then %>
<style title="text/css"><%=css %></style>
<% end -%>
<script src="<%=resource%>/cbi.js"></script>
<script src="<%=resource%>/xhr.js"></script>
<script src="<%=media%>/js/jquery.min.js"></script>
</head>
<body
class="<%- if node then %><%= striptags( node.title ) %><%- end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %> lang_<%=luci.i18n.context.lang%> ">
<div class="main">
<div class="main-left">
<div class="sidenav-header d-flex align-items-center">
<a class="brand" href="#"><img src="<%=media%>/logo.png"></a>
<div class="ml-auto">
<!-- Sidenav toggler -->
<div class="sidenav-toggler d-none d-xl-block active" data-action="sidenav-unpin"
data-target="#sidenav-main">
<div class="sidenav-toggler-inner">
<i class="sidenav-toggler-line"></i>
<i class="sidenav-toggler-line"></i>
<i class="sidenav-toggler-line"></i>
</div>
</div>
</div>
</div>
<% render_topmenu() %>
</div>
<div class="main-right">
<hr/>
<div id="indicators" class="pull-right">
<% render_changes() %>
<span data-indicator="poll-status" id="xhr_poll_status" style="display:none"
onclick="XHR.running() ? XHR.halt() : XHR.run()">
<span class="" id="xhr_poll_status_on"><span
class="mobile-hide"><%:Auto Refresh%></span> <%:on%></span>
<span class="" id="xhr_poll_status_off" style="display:none"><span
class="mobile-hide"><%:Auto Refresh%></span> <%:off%></span>
</span>
</div>
<header class="bg-primary">
<div class="fill">
<div class="container">
<a class="showSide"></a>
<a class="brand" href="#"><img src="<%=media%>/logo.png"></a>
</div>
</div>
</header>
<div class="darkMask"></div>
<div id="maincontent">
<div class="container">
<%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
<div class="alert-message error">
<h4><%:No password set!%></h4>
<p><%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%>
</p>
<div class="right"><a class="btn"
href="<%=url("admin/system/admin")%>"><%:Go to password configuration...%></a></div>
</div>
<%- end -%>
<noscript>
<div class="alert-message error">
<h4><%:JavaScript required!%></h4>
<p><%:You must enable JavaScript in your browser or LuCI will not work properly.%></p>
</div>
</noscript>
<% if category then render_tabmenu(category, cattree) end %>

View File

@ -0,0 +1,226 @@
<%#
edge is a clean HTML5 theme for LuCI. It is based on luci-theme-material edge Template
luci-theme-edge
Copyright 2019 Jerrykuku <jerrykuku@qq.com>
Have a bug? Please create an issue here on GitHub!
https://github.com/jerrykuku/luci-theme-edge/issues
luci-theme-material:
Copyright 2015 Lutty Yang <lutty@wcan.in>
Agron Theme
https://demos.creative-tim.com/edge-dashboard/index.html
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 fs = require "nixio.fs"
local nutil = require "nixio.util"
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('<ul class="tabs">')
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('<li class="tabmenu-item-%s %s"><a href="%s">%s</a></li>' %{
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('</ul>')
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('<ul class="slide-menu">')
for i, r in ipairs(childs) do
local nnode = node.nodes[r]
local title = pcdata(striptags(translate(nnode.title)))
write('<li><a data-title="%s" href="%s">%s</a></li>' %{
title,
nodeurl(prefix, r, nnode.query),
title
})
end
write('</ul>')
end
end
local function render_topmenu()
local childs = disp.node_childs(cattree)
if #childs > 0 then
write('<ul class="nav">')
for i, r in ipairs(childs) do
local nnode = cattree.nodes[r]
local grandchildren = disp.node_childs(nnode)
if #grandchildren > 0 then
local title = pcdata(striptags(translate(nnode.title)))
local en_title = pcdata(striptags(string.gsub(nnode.title," ","_")))
write('<li class="slide"><a class="menu" data-title="%s" href="#">%s</a>' %{
en_title,
title
})
render_submenu(category .. "/" .. r, nnode)
write('</li>')
else
local title = pcdata(striptags(translate(nnode.title)))
local en_title = pcdata(striptags(nnode.title))
write('<li class="slide"><a class="menu exit" data-title="%s" href="%s">%s</a></li>' %{
en_title,
nodeurl(category, r, nnode.query),
title
})
end
end
write('</ul>')
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
for i, j in pairs(require("luci.model.uci").cursor():changes()) do
for k, l in pairs(j) do
for m, n in pairs(l) do
ucichanges = ucichanges + 1;
end
end
end
if ucichanges > 0 then
write('<a class="uci_change_indicator label notice" href="%s?redir=%s">%s: %d</a>' %{
url(category, 'uci/changes'),
http.urlencode(http.formvalue('redir') or table.concat(disp.context.request, "/")),
translate('Unsaved Changes'),
ucichanges
})
end
end
end
math.randomseed(os.time())
-%>
<!DOCTYPE html>
<html lang="<%=luci.i18n.context.lang%>">
<head>
<meta charset="utf-8">
<title>
<%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %>
- LuCI</title>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<meta name="format-detection" content="telephone=no, email=no" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="x5-fullscreen" content="true">
<meta name="full-screen" content="yes">
<meta name="x5-page-mode" content="app">
<meta name="browsermode" content="application">
<meta name="theme-color" content="#5e72e4">
<meta name="msapplication-tap-highlight" content="no">
<meta name="msapplication-TileColor" content="#5e72e4">
<meta name="application-name" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
<meta name="apple-mobile-web-app-title" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
<meta name="msapplication-TileImage" content="<%=media%>/logo.png" />
<link rel="icon" href="<%=media%>/logo.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" href="<%=media%>/logo.png" sizes="144x144">
<link rel="stylesheet" href="<%=media%>/landscape.css">
<link rel="stylesheet" href="<%=media%>/waves.css">
<link rel="stylesheet" href="<%=media%>/cascade.css">
<link rel="shortcut icon" href="<%=media%>/favicon.ico">
<% if node and node.css then %>
<link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
<% end -%>
<% if css then %>
<style title="text/css"><%=css %></style>
<% end -%>
<script src="<%=resource%>/cbi.js"></script>
<script src="<%=resource%>/xhr.js"></script>
<script src="<%=media%>/js/jquery.min.js"></script>
</head>
<body
class="<%- if node then %><%= striptags( node.title ) %><%- end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %> lang_<%=luci.i18n.context.lang%> ">
<p class="chromeframe">您使用的浏览器过于老旧,
请使用<a href="https://www.microsoft.com/zh-cn/edge"> Edge </a>, <a href="https://www.mozilla.org/zh-CN/firefox/new/"> Firefox </a>等高级浏览器.</a></p>

View File

@ -0,0 +1,102 @@
<%#
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008-2012 Jo-Philipp Wich <jow@openwrt.org>
Licensed to the public under the Apache License 2.0.
-%>
<%+header_login%>
<div id="CrossFade"><img src="<%=media%>/background/1.jpg" alt="img"/><img src="<%=media%>/background/2.jpg" alt="img"/><img src="<%=media%>/background/3.jpg" alt="img"/>
</div>
<div class="speaker"></div>
<audio loop autoplay id="player" type="audio/mpeg"></audio>
<script>
setTimeout(function(){
var sound = document.getElementById("player");
sound.setAttribute('src','https://cdn.jsdelivr.net/gh/kkkidding/custom2@master/audio.ogg');
}, 0);
setTimeout(function(){
if (!$('#player')[0].paused) {
$('.speaker').addClass('speakerplay');
}
}, 1200);
if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
$("audio").prop("autoplay", false);
$("audio")[0].load();
};
</script>
<div class="main">
<div class="main-right">
<div class="darkMask"></div>
<div id="maincontent">
<%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
<div class="alert-message error">
<h4><%:No password set!%></h4>
<p><%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%>
</p>
</div>
<%- end -%>
<%- if fuser then %>
<div class="alert-message warning">
<p><%:Invalid username and/or password! Please try again.%></p>
</div>
<% end -%>
<noscript>
<div class="alert-message error">
<h4><%:JavaScript required!%></h4>
<p><%:You must enable JavaScript in your browser or LuCI will not work properly.%></p>
</div>
</noscript>
<div class="container">
<form method="post" action="<%=pcdata(luci.http.getenv("REQUEST_URI"))%>">
<div class="cbi-map">
<h2 name="content"><img src="<%=media%>/logo.png" width="200"></h2>
<div class="cbi-map-descr">
<%:Have a nice day. ✨%>
</div>
<fieldset class="cbi-section"><fieldset class="cbi-section-node">
<div class="cbi-value">
<label class="cbi-value-title"><%:Username%></label>
<div class="cbi-value-field">
<input class="cbi-input-user" type="text" name="luci_username" placeholder="User name" value="<%=duser%>" />
</div>
</div>
<div class="cbi-value cbi-value-last">
<label class="cbi-value-title"><%:Password%></label>
<div class="cbi-value-field">
<input class="cbi-input-password" type="password" placeholder="Password" name="luci_password" />
</div>
</div>
</fieldset></fieldset>
</div>
<div class="cbi-page-actions">
<input type="submit" value="<%:Login%>" class="cbi-button cbi-button-apply" />
<input type="reset" value="<%:Reset%>" class="cbi-button cbi-button-reset" />
</div>
</form>
<script>
if (!!window.ActiveXObject || "ActiveXObject" in window){
$('.chromeframe').show();
$('.landscape').hide();
$('.main').hide();
}
</script>
<script type="text/javascript">//<![CDATA[
var input = document.getElementsByName('luci_password')[0];
if (input)
input.focus();
//]]></script>
<%+footer%>
<%
luci.sys.exec("(curl -k -L \"$(curl -s https://instant.unsplash.com | grep -oE '\"raw\":\".*?\",\"full\"'| grep -o 'https://.*,' | sed 's/\",//g')\&q=80\&w=1680\" -o /www/luci-static/edge/background/1.jpg >/dev/null 2>&1) &")
luci.sys.exec("(curl -k -L \"$(curl -s https://instant.unsplash.com | grep -oE '\"raw\":\".*?\",\"full\"'| grep -o 'https://.*,' | sed 's/\",//g')\&q=80\&w=1680\" -o /www/luci-static/edge/background/2.jpg >/dev/null 2>&1) &")
luci.sys.exec("(curl -k -L \"$(curl -s https://instant.unsplash.com | grep -oE '\"raw\":\".*?\",\"full\"'| grep -o 'https://.*,' | sed 's/\",//g')\&q=80\&w=1680\" -o /www/luci-static/edge/background/3.jpg >/dev/null 2>&1) &")
%>

View File

@ -0,0 +1,10 @@
#!/bin/sh
sed -i ":a;$!N;s/tmpl.render.*sysauth_template.*return/local scope = { duser = default_user, fuser = user }\nlocal ok, res = luci.util.copcall\(luci.template.render_string, [[<% include\(\"themes\/\" .. theme .. \"\/sysauth\"\) %>]], scope\)\nif ok then\nreturn res\nend\nreturn luci.template.render\(\"sysauth\", scope\)/;ba" /usr/lib/lua/luci/dispatcher.lua
sed -i ":a;$!N;s/t.render.*sysauth_template.*return/local scope = { duser = h, fuser = a }\nlocal ok, res = luci.util.copcall\(luci.template.render_string, [[<% include\(\"themes\/\" .. theme .. \"\/sysauth\"\) %>]], scope\)\nif ok then\nreturn res\nend\nreturn luci.template.render\(\"sysauth\", scope\)/;ba" /usr/lib/lua/luci/dispatcher.lua
rm -Rf /var/luci-*cache*
uci batch <<-EOF
set luci.themes.Edge=/luci-static/edge
set luci.main.mediaurlbase=/luci-static/edge
commit luci
EOF
exit 0