luci-theme-edge: add package
@ -41,7 +41,8 @@ node-request source: [jerrykuku/node-request](https://github.com/jerrykuku/node-
|
||||
luci-app-jd-dailybonus source: [jerrykuku/luci-app-jd-dailybonus](https://github.com/jerrykuku/luci-app-jd-dailybonus).<br/>
|
||||
luci-app-oled source: [NateLol/luci-app-oled](https://github.com/NateLol/luci-app-oled).<br/>
|
||||
luci-app-beardropper source: [NateLol/natelol](https://github.com/NateLol/natelol).<br/>
|
||||
luci-app-vssr source: [jerrykuku/luci-app-vssr](https://github.com/jerrykuku/luci-app-vssr).
|
||||
luci-app-vssr source: [jerrykuku/luci-app-vssr](https://github.com/jerrykuku/luci-app-vssr).<br/>
|
||||
luci-theme-edge source: [garypang13/luci-theme-edge](https://github.com/garypang13/luci-theme-edge).
|
||||
|
||||
## License
|
||||
### Depend on their own License.
|
||||
|
||||
16
package/ctcgfw/luci-theme-edge/Makefile
Normal file
@ -0,0 +1,16 @@
|
||||
#
|
||||
# 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:=
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 37 KiB |
4120
package/ctcgfw/luci-theme-edge/htdocs/luci-static/edge/cascade.css
Normal file
@ -0,0 +1,46 @@
|
||||
: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;
|
||||
--white: #fff;
|
||||
--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: black;
|
||||
--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";
|
||||
}
|
||||
|
After Width: | Height: | Size: 15 KiB |
@ -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 |
@ -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 |
@ -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 |
2
package/ctcgfw/luci-theme-edge/htdocs/luci-static/edge/js/jquery.min.js
vendored
Normal file
@ -0,0 +1,321 @@
|
||||
/**
|
||||
* Edge is a clean HTML5 theme for LuCI. It is based on luci-theme-Argon
|
||||
*
|
||||
* luci-theme-edge
|
||||
* Copyright 2020 Garypang <garyp@qq.com>
|
||||
*
|
||||
* Have a bug? Please create an issue here on GitHub!
|
||||
* https://github.com/garypang13/luci-theme-edge/issues
|
||||
*
|
||||
* luci-theme-material:
|
||||
* Copyright 2015 Lutty Yang <lutty@wcan.in>
|
||||
* https://github.com/LuttyYang/luci-theme-material/
|
||||
*
|
||||
* Agron Theme
|
||||
* https://demos.creative-tim.com/argon-dashboard/index.html
|
||||
*
|
||||
* Login background
|
||||
* https://unsplash.com/
|
||||
* Font generate by Icomoon<icomoon.io>
|
||||
*
|
||||
* Licensed to the public under the Apache License 2.0
|
||||
*/
|
||||
|
||||
document.addEventListener('luci-loaded', function(ev) {
|
||||
(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){
|
||||
var luciLocation;
|
||||
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 > .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
|
||||
*/
|
||||
/**
|
||||
* 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;
|
||||
});
|
||||
|
||||
/**
|
||||
* 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;
|
||||
});
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sidebar expand
|
||||
*/
|
||||
var showSide = false;
|
||||
$(".showSide").click(function () {
|
||||
if (showSide) {
|
||||
$(".darkMask").stop(true).fadeOut("fast");
|
||||
$(".main-left").stop(true).animate({
|
||||
width: "0"
|
||||
}, "200");
|
||||
$(".main-right").css("overflow-y", "visible");
|
||||
showSide = false;
|
||||
} else {
|
||||
$(".darkMask").stop(true).fadeIn("fast");
|
||||
$(".main-left").stop(true).animate({
|
||||
width: "13rem"
|
||||
}, "200");
|
||||
$(".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", "visible");
|
||||
}
|
||||
});
|
||||
|
||||
$(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");
|
||||
}
|
||||
});
|
||||
|
||||
$(".main-right").focus();
|
||||
$(".main-right").blur();
|
||||
$("input").attr("size", "0");
|
||||
$(".cbi-button-up").val("__");
|
||||
$(".cbi-button-down").val("__");
|
||||
$(".slide > a").removeAttr("href");
|
||||
|
||||
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 */
|
||||
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);
|
||||
|
||||
var options = { attributes: true};
|
||||
function callback() {
|
||||
$("div>select:first-child,div>input[type='text']:first-child").filter(function () {
|
||||
return (!$(this).parents(".cbi-dynlist").length&&!$(this).hasClass("cbi-input-password"))
|
||||
}).after("<span class='focus-input'></span>");
|
||||
$("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");
|
||||
});
|
||||
$("input[type='checkbox']").filter(function () {
|
||||
return (!$(this).next("label").length)
|
||||
}).show();
|
||||
}
|
||||
var mutationObserver = new MutationObserver(callback);
|
||||
mutationObserver.observe($("body")[0], options);
|
||||
$(".cbi-value").has("textarea").css("background","none");
|
||||
})(jQuery);
|
||||
});
|
||||
@ -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;});
|
||||
BIN
package/ctcgfw/luci-theme-edge/htdocs/luci-static/edge/logo.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
@ -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 |
135
package/ctcgfw/luci-theme-edge/htdocs/luci-static/edge/waves.css
Normal 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;
|
||||
}
|
||||
38
package/ctcgfw/luci-theme-edge/luasrc/view/header_login.htm
Normal file
@ -0,0 +1,38 @@
|
||||
<%#
|
||||
Copyright 2008 Steven Barth <steven@midlink.org>
|
||||
Copyright 2008-2019 Jo-Philipp Wich <jo@mein.io>
|
||||
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
|
||||
|
||||
local applyconf = luci.config and luci.config.apply
|
||||
%>
|
||||
|
||||
<script type="text/javascript" src="<%=resource%>/promis.min.js?v=git-20.186.82389-282dbf8"></script>
|
||||
<script type="text/javascript" src="<%=resource%>/luci.js?v=git-20.186.82389-282dbf8"></script>
|
||||
<script type="text/javascript">
|
||||
L = new LuCI(<%= luci.http.write_json({
|
||||
token = token,
|
||||
media = media,
|
||||
resource = resource,
|
||||
scriptname = luci.http.getenv("SCRIPT_NAME"),
|
||||
pathinfo = luci.http.getenv("PATH_INFO"),
|
||||
documentroot = luci.http.getenv("DOCUMENT_ROOT"),
|
||||
requestpath = luci.dispatcher.context.requestpath,
|
||||
dispatchpath = luci.dispatcher.context.path,
|
||||
pollinterval = luci.config.main.pollinterval or 5,
|
||||
ubuspath = luci.config.main.ubuspath or '/ubus/',
|
||||
sessionid = luci.dispatcher.context.authsession,
|
||||
nodespec = luci.dispatcher.context.dispatched,
|
||||
apply_rollback = math.max(applyconf and applyconf.rollback or 30, 30),
|
||||
apply_holdoff = math.max(applyconf and applyconf.holdoff or 4, 1),
|
||||
apply_timeout = math.max(applyconf and applyconf.timeout or 5, 1),
|
||||
apply_display = math.max(applyconf and applyconf.display or 1.5, 1),
|
||||
rollback_token = rollback_token
|
||||
}) %>);
|
||||
</script>
|
||||
@ -0,0 +1,36 @@
|
||||
<%#
|
||||
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" %>
|
||||
</div>
|
||||
<footer class="mobile-hide">
|
||||
<a href="https://github.com/openwrt/luci">Powered by <%= ver.luciname %> (<%= ver.luciversion %>)</a> / <%= ver.distversion %>
|
||||
<ul class="breadcrumb pull-right" id="modemenu" style="display:none"></ul>
|
||||
</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?v=2.1"></script>
|
||||
<script src="<%=media%>/js/waves.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -0,0 +1,240 @@
|
||||
<%#
|
||||
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 boardinfo = util.ubus("system", "board")
|
||||
|
||||
local node = disp.context.dispatched
|
||||
|
||||
local fs = require "nixio.fs"
|
||||
local nutil = require "nixio.util"
|
||||
|
||||
|
||||
|
||||
-- send as HTML5
|
||||
http.prepare_content("text/html")
|
||||
|
||||
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="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="theme-color" content="#09c">
|
||||
<meta name="msapplication-tap-highlight" content="no">
|
||||
<meta name="msapplication-TileColor" content="#09c">
|
||||
<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="<%=url('admin/translations', luci.i18n.context.lang)%>"></script>
|
||||
<script src="<%=resource%>/cbi.js"></script>
|
||||
<script src="<%=resource%>/luci.js"></script>
|
||||
<script src="<%=media%>/js/jquery.min.js"></script>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
function EF() { return L.dom.create.apply(L.dom, arguments) }
|
||||
(function() {
|
||||
function get_children(node) {
|
||||
var children = [];
|
||||
for (var k in node.children) {
|
||||
if (!node.children.hasOwnProperty(k))
|
||||
continue;
|
||||
if (!node.children[k].satisfied)
|
||||
continue;
|
||||
if (!node.children[k].hasOwnProperty('title'))
|
||||
continue;
|
||||
children.push(Object.assign(node.children[k], { name: k }));
|
||||
}
|
||||
return children.sort(function(a, b) {
|
||||
return ((a.order || 1000) - (b.order || 1000));
|
||||
});
|
||||
}
|
||||
function render_mainmenu(tree, url, level) {
|
||||
var l = (level || 0) + 1,
|
||||
ul = EF('ul', { 'class': level ? 'slide-menu' : 'nav' }),
|
||||
children = get_children(tree);
|
||||
if (children.length == 0 || l > 2)
|
||||
return EF([]);
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
var submenu = render_mainmenu(children[i], url + '/' + children[i].name, l),
|
||||
hasChildren = submenu.children.length;
|
||||
ul.appendChild(EF('li', { 'class': hasChildren ? 'slide' : null }, [
|
||||
EF('a', {
|
||||
'href': hasChildren ? '#' : L.url(url, children[i].name),
|
||||
'class': hasChildren ? 'menu' : null,
|
||||
'data-title': hasChildren ? children[i].title.replace(" ", "_") : children[i].title.replace(" ", "_"),
|
||||
}, [ _(children[i].title) ]),
|
||||
submenu
|
||||
]));
|
||||
}
|
||||
if (l == 1) {
|
||||
var container = document.querySelector('#mainmenu');
|
||||
container.appendChild(ul);
|
||||
container.style.display = '';
|
||||
}
|
||||
return ul;
|
||||
}
|
||||
function render_modemenu(tree) {
|
||||
var ul = document.querySelector('#modemenu'),
|
||||
children = get_children(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(EF('li', {}, [
|
||||
EF('a', {
|
||||
'href': L.url(children[i].name),
|
||||
'class': isActive ? 'active' : null
|
||||
}, [ _(children[i].title) ])
|
||||
]));
|
||||
if (isActive)
|
||||
render_mainmenu(children[i], children[i].name);
|
||||
}
|
||||
if (ul.children.length > 1)
|
||||
ul.style.display = '';
|
||||
}
|
||||
function render_tabmenu(tree, url, level) {
|
||||
var container = document.querySelector('#tabmenu'),
|
||||
l = (level || 0) + 1,
|
||||
ul = EF('ul', { 'class': 'tabs' }),
|
||||
children = get_children(tree),
|
||||
activeNode = null;
|
||||
if (children.length == 0)
|
||||
return EF([]);
|
||||
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(EF('li', { 'class': className }, [
|
||||
EF('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(render_tabmenu(activeNode, url + '/' + activeNode.name, l));
|
||||
return ul;
|
||||
}
|
||||
document.addEventListener('luci-loaded', function(ev) {
|
||||
var tree = <%= luci.http.write_json(luci.dispatcher.menu_json() or {}) %>,
|
||||
node = tree,
|
||||
url = '';
|
||||
render_modemenu(tree);
|
||||
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)
|
||||
render_tabmenu(node, url);
|
||||
}
|
||||
});
|
||||
})();
|
||||
//]]></script>
|
||||
</head>
|
||||
|
||||
<body
|
||||
class="lang_<%=luci.i18n.context.lang%> <% if node then %><%= striptags( node.title ) %><% end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %>"
|
||||
data-page="<%= table.concat(disp.context.requestpath, "-") %>">
|
||||
|
||||
<div class="main">
|
||||
<div style="" class="loading">
|
||||
<div class="sk-folding-cube">
|
||||
<div class="sk-cube1 sk-cube"></div>
|
||||
<div class="sk-cube2 sk-cube"></div>
|
||||
<div class="sk-cube4 sk-cube"></div>
|
||||
<div class="sk-cube3 sk-cube"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-left" id="mainmenu" style="display:none">
|
||||
<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>
|
||||
</div>
|
||||
<div class="main-right">
|
||||
<hr/>
|
||||
<div id="indicators" class="pull-right"></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>
|
||||
<% if disp.lookup("admin/system/admin") then %>
|
||||
<div class="right"><a class="btn"
|
||||
href="<%=url("admin/system/admin")%>"><%:Go to password configuration...%></a></div>
|
||||
<% end %>
|
||||
</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 id="tabmenu" style="display:none"></div>
|
||||
@ -0,0 +1,121 @@
|
||||
<%#
|
||||
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/garypang13/luci-theme-edge/issues
|
||||
|
||||
luci-theme-Argon:
|
||||
Copyright 2019 Jerrykuku <jerrykuku@qq.com>
|
||||
|
||||
Edge 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 boardinfo = util.ubus("system", "board")
|
||||
|
||||
local node = disp.context.dispatched
|
||||
|
||||
local fs = require "nixio.fs"
|
||||
local nutil = require "nixio.util"
|
||||
|
||||
|
||||
|
||||
-- send as HTML5
|
||||
http.prepare_content("text/html")
|
||||
|
||||
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="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="theme-color" content="#09c">
|
||||
<meta name="msapplication-tap-highlight" content="no">
|
||||
<meta name="msapplication-TileColor" content="#09c">
|
||||
<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="<%=url('admin/translations', luci.i18n.context.lang)%>"></script>
|
||||
<script src="<%=resource%>/cbi.js"></script>
|
||||
<script src="<%=resource%>/luci.js"></script>
|
||||
<script src="<%=media%>/js/jquery.min.js"></script>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
(function () {
|
||||
function get_children(node) {
|
||||
var children = [];
|
||||
|
||||
for (var k in node.children) {
|
||||
if (!node.children.hasOwnProperty(k))
|
||||
continue;
|
||||
|
||||
if (!node.children[k].satisfied)
|
||||
continue;
|
||||
|
||||
if (!node.children[k].hasOwnProperty('title'))
|
||||
continue;
|
||||
|
||||
children.push(Object.assign(node.children[k], { name: k }));
|
||||
}
|
||||
|
||||
return children.sort(function (a, b) {
|
||||
return ((a.order || 1000) - (b.order || 1000));
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('luci-loaded', function (ev) {
|
||||
var tree = <%= luci.http.write_json(luci.dispatcher.menu_json() or { }) %>,
|
||||
node = tree,
|
||||
url = '';
|
||||
|
||||
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];
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}) ();
|
||||
//]]></script>
|
||||
</head>
|
||||
|
||||
<body
|
||||
class="lang_<%=luci.i18n.context.lang%> <% if node then %><%= striptags( node.title ) %><% end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %>"
|
||||
data-page="<%= table.concat(disp.context.requestpath, "-") %>">
|
||||
|
||||
<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>
|
||||
@ -0,0 +1,139 @@
|
||||
<%#
|
||||
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 id="player" autoplay 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>
|
||||
|
||||
<!-- partial -->
|
||||
<div class="main">
|
||||
<div style="" class="loading">
|
||||
<div class="sk-folding-cube">
|
||||
<div class="sk-cube1 sk-cube"></div>
|
||||
<div class="sk-cube2 sk-cube"></div>
|
||||
<div class="sk-cube4 sk-cube"></div>
|
||||
<div class="sk-cube3 sk-cube"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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(FULL_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>
|
||||
<div class="cbi-section"><div class="cbi-section-node">
|
||||
<div class="cbi-value">
|
||||
<label class="cbi-value-title"><%:Username%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input class="cbi-input-text" 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-text" type="password" placeholder="Password" name="luci_password" />
|
||||
</div>
|
||||
</div>
|
||||
</div></div>
|
||||
</div>
|
||||
|
||||
<div class="cbi-page-actions">
|
||||
<input type="submit" value="<%:Login%>" class="btn cbi-button cbi-button-apply" />
|
||||
<input type="reset" value="<%:Reset%>" class="btn 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>
|
||||
<%
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
local fs = require "nixio.fs"
|
||||
local https_key = uci:get("uhttpd", "main", "key")
|
||||
local https_port = uci:get("uhttpd", "main", "listen_https")
|
||||
if type(https_port) == "table" then
|
||||
https_port = https_port[1]
|
||||
end
|
||||
|
||||
if https_port and fs.access(https_key) then
|
||||
https_port = https_port:match("(%d+)$")
|
||||
%>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
if (document.location.protocol != 'https:') {
|
||||
var url = 'https://' + window.location.hostname + ':' + '<%=https_port%>' + window.location.pathname;
|
||||
var img = new Image;
|
||||
img.onload = function () { window.location = url };
|
||||
img.src = 'https://' + window.location.hostname + ':' + '<%=https_port%>' + '<%=resource%>/cbi/up.gif?' + Math.random();;
|
||||
setTimeout(function () {
|
||||
img.src = ''
|
||||
}, 5000);
|
||||
}
|
||||
//]]></script>
|
||||
<% end %>
|
||||
|
||||
<%+footer%>
|
||||
<%
|
||||
luci.sys.exec("(sleep 1;curl -k -L https://source.unsplash.com/featured/1080x720/?wallpapers -o /www/luci-static/edge/background/1.jpg) &")
|
||||
luci.sys.exec("(sleep 1;curl -k -L https://source.unsplash.com/featured/1080x720/?fashion -o /www/luci-static/edge/background/2.jpg) &")
|
||||
luci.sys.exec("(sleep 1;curl -k -L https://source.unsplash.com/featured/1080x720 -o /www/luci-static/edge/background/3.jpg) &")
|
||||
%>
|
||||
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
uci batch <<-EOF
|
||||
set luci.themes.Edge=/luci-static/edge
|
||||
set luci.main.mediaurlbase=/luci-static/edge
|
||||
commit luci
|
||||
EOF
|
||||
exit 0
|
||||