update 2023-01-03 20:29:58
@ -8,9 +8,17 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
LUCI_TITLE:=Edge Theme
|
LUCI_TITLE:=Edge Theme
|
||||||
LUCI_DEPENDS:=+curl
|
LUCI_DEPENDS:=+curl
|
||||||
|
PKG_VERSION:=2.5
|
||||||
|
PKG_RELEASE:=20210107
|
||||||
|
|
||||||
PKG_LICENSE:=Apache-2.0
|
|
||||||
|
|
||||||
include $(TOPDIR)/feeds/luci/luci.mk
|
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
|
# call BuildPackage - OpenWrt buildroot signature
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
# luci-theme-edge
|
# luci-theme-edge ([中文](/README_ZH.md))
|
||||||
|
|
||||||
[1]: https://img.shields.io/badge/license-MIT-brightgreen.svg
|
[1]: https://img.shields.io/badge/license-MIT-brightgreen.svg
|
||||||
[2]: /LICENSE
|
[2]: /LICENSE
|
||||||
[3]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
|
[3]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
|
||||||
[4]: https://github.com/https://github.com/kiddin9/luci-theme-edge/pulls
|
[4]: https://github.com/https://github.com/garypang13/luci-theme-edge/pulls
|
||||||
[5]: https://img.shields.io/badge/Issues-welcome-brightgreen.svg
|
[5]: https://img.shields.io/badge/Issues-welcome-brightgreen.svg
|
||||||
[6]: https://github.com/https://github.com/kiddin9/luci-theme-edge/issues/new
|
[6]: https://github.com/https://github.com/garypang13/luci-theme-edge/issues/new
|
||||||
[7]: https://img.shields.io/badge/release-v2.1-blue.svg?
|
[7]: https://img.shields.io/badge/release-v2.1-blue.svg?
|
||||||
[10]: https://img.shields.io/badge/Contact-telegram-blue
|
[10]: https://img.shields.io/badge/Contact-telegram-blue
|
||||||
[11]: https://t.me/openwrt_nginx
|
[11]: https://t.me/openwrt_nginx
|
||||||
@ -14,13 +14,10 @@
|
|||||||
[![Issue Welcome][5]][6]
|
[![Issue Welcome][5]][6]
|
||||||
[![Contact Me][10]][11]
|
[![Contact Me][10]][11]
|
||||||
|
|
||||||
<a href="https://t.me/opwrts" target="_blank">Telegram</a>
|
|
||||||
|
|
||||||
A new Luci theme for LEDE/OpenWRT
|
A new Luci theme for LEDE/OpenWRT
|
||||||
Edge is a clean HTML5 theme for LuCI. It is based on luci-theme-argon Template
|
Edge is a clean HTML5 theme for LuCI. It is based on luci-theme-argon Template
|
||||||
|
|
||||||
Master branch adapt to official mainline snapshot.
|
|
||||||
Luci 18.06: https://github.com/kiddin9/luci-theme-edge/tree/18.06
|
|
||||||
|
|
||||||
## Thanks to
|
## Thanks to
|
||||||
luci-theme-argon: https://github.com/jerrykuku/luci-theme-argon
|
luci-theme-argon: https://github.com/jerrykuku/luci-theme-argon
|
||||||
|
23
luci-theme-edge/README_ZH.md
Normal 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
|
Before Width: | Height: | Size: 289 KiB |
Before Width: | Height: | Size: 220 KiB |
Before Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 72 KiB |
@ -1,46 +1 @@
|
|||||||
:root {
|
: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"}
|
||||||
--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";
|
|
||||||
}
|
|
@ -1,92 +1,99 @@
|
|||||||
/**
|
/**
|
||||||
* Edge is a clean HTML5 theme for LuCI. It is based on luci-theme-Argon
|
* Argon is a clean HTML5 theme for LuCI. It is based on luci-theme-material and Argon Template
|
||||||
*
|
*
|
||||||
* luci-theme-edge
|
* luci-theme-argon
|
||||||
* Copyright 2020 Kiddin'
|
* Copyright 2019 Jerrykuku <jerrykuku@qq.com>
|
||||||
*
|
*
|
||||||
* Have a bug? Please create an issue here on GitHub!
|
* Have a bug? Please create an issue here on GitHub!
|
||||||
* https://github.com/kiddin9/luci-theme-edge/issues
|
* https://github.com/jerrykuku/luci-theme-argon/issues
|
||||||
*
|
*
|
||||||
* luci-theme-material:
|
* luci-theme-bootstrap:
|
||||||
* Copyright 2015 Lutty Yang <lutty@wcan.in>
|
* Copyright 2008 Steven Barth <steven@midlink.org>
|
||||||
* https://github.com/LuttyYang/luci-theme-material/
|
* 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
|
* Agron Theme
|
||||||
* https://demos.creative-tim.com/argon-dashboard/index.html
|
* https://demos.creative-tim.com/argon-dashboard/index.html
|
||||||
*
|
*
|
||||||
* Login background
|
* Login background
|
||||||
* https://unsplash.com/
|
* https://unsplash.com/
|
||||||
* Font generate by Icomoon<icomoon.io>
|
|
||||||
*
|
*
|
||||||
* Licensed to the public under the Apache License 2.0
|
* Licensed to the public under the Apache License 2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
document.addEventListener('luci-loaded', function(ev) {
|
/*
|
||||||
|
* Font generate by Icomoon<icomoon.io>
|
||||||
|
*/
|
||||||
(function ($) {
|
(function ($) {
|
||||||
$(".main > .loading").fadeOut();
|
$(".main > .loading").fadeOut();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* trim text, Remove spaces, wrap
|
* trim text, Remove spaces, wrap
|
||||||
* @param text
|
* @param text
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
function trimText(text) {
|
function trimText(text) {
|
||||||
return text.replace(/[ \t\n\r]+/g, " ");
|
return text.replace(/[ \t\n\r]+/g, " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
var lastNode = undefined;
|
|
||||||
var mainNodeName = undefined;
|
|
||||||
|
|
||||||
var nodeUrl = "";
|
var lastNode = undefined;
|
||||||
(function(node){
|
var mainNodeName = undefined;
|
||||||
var luciLocation;
|
|
||||||
if (node[0] == "admin"){
|
|
||||||
luciLocation = [node[1], node[2]];
|
|
||||||
}else{
|
|
||||||
luciLocation = node;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(var i in luciLocation){
|
var nodeUrl = "";
|
||||||
nodeUrl += luciLocation[i];
|
(function (node) {
|
||||||
if (i != luciLocation.length - 1){
|
if (node[0] == "admin") {
|
||||||
nodeUrl += "/";
|
luciLocation = [node[1], node[2]];
|
||||||
}
|
} else {
|
||||||
}
|
luciLocation = node;
|
||||||
})(luciLocation);
|
}
|
||||||
|
|
||||||
/**
|
for (var i in luciLocation) {
|
||||||
* get the current node by Burl (primary)
|
nodeUrl += luciLocation[i];
|
||||||
* @returns {boolean} success?
|
if (i != luciLocation.length - 1) {
|
||||||
*/
|
nodeUrl += "/";
|
||||||
function getCurrentNodeByUrl() {
|
}
|
||||||
var ret = false;
|
}
|
||||||
if (!$('body').hasClass('logged-in')) {
|
})(luciLocation);
|
||||||
luciLocation = ["Main", "Login"];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$(".main > .main-left > .nav > .slide > .menu").each(function () {
|
/**
|
||||||
var ulNode = $(this);
|
* get the current node by Burl (primary)
|
||||||
ulNode.next().find("a").each(function () {
|
* @returns {boolean} success?
|
||||||
var that = $(this);
|
*/
|
||||||
var href = that.attr("href");
|
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);
|
||||||
|
|
||||||
if (href.indexOf(nodeUrl) != -1) {
|
ulNode.next().find("a").each(function () {
|
||||||
ulNode.click();
|
var that = $(this);
|
||||||
ulNode.next(".slide-menu").stop(true, true);
|
var href = that.attr("href");
|
||||||
lastNode = that.parent();
|
|
||||||
lastNode.addClass("active");
|
if (href.indexOf(nodeUrl) != -1) {
|
||||||
ret = true;
|
ulNode.click();
|
||||||
return true;
|
ulNode.next(".slide-menu").stop(true, true);
|
||||||
}
|
lastNode = that.parent();
|
||||||
});
|
lastNode.addClass("active");
|
||||||
});
|
ret = true;
|
||||||
return ret;
|
return true;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* menu click
|
|
||||||
*/
|
|
||||||
/**
|
/**
|
||||||
* menu click
|
* menu click
|
||||||
*/
|
*/
|
||||||
@ -111,128 +118,174 @@ document.addEventListener('luci-loaded', function(ev) {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
// define what element should be observed by the observer
|
||||||
* hook menu click and add the hash
|
// and what types of mutations trigger the callback
|
||||||
*/
|
if ($("#cbi-dhcp-lan-ignore").length > 0) {
|
||||||
$(".main > .main-left > .nav > .slide > .slide-menu > li > a").click(function () {
|
observer.observe(document.getElementById("cbi-dhcp-lan-ignore"), {
|
||||||
if (lastNode != undefined) lastNode.removeClass("active");
|
subtree: true,
|
||||||
$(this).parent().addClass("active");
|
attributes: true
|
||||||
$(".main > .loading").fadeIn("fast");
|
});
|
||||||
return true;
|
}
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fix menu click
|
* hook menu click and add the hash
|
||||||
*/
|
*/
|
||||||
$(".main > .main-left > .nav > .slide > .slide-menu > li").click(function () {
|
$(".main > .main-left > .nav > .slide > .slide-menu > li > a").click(function () {
|
||||||
if (lastNode != undefined) lastNode.removeClass("active");
|
if (lastNode != undefined)
|
||||||
$(this).addClass("active");
|
lastNode.removeClass("active");
|
||||||
$(".main > .loading").fadeIn("fast");
|
$(this).parent().addClass("active");
|
||||||
window.location = $($(this).find("a")[0]).attr("href");
|
$(".main > .loading").fadeIn("fast");
|
||||||
return false;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get current node and open it
|
* fix menu click
|
||||||
*/
|
*/
|
||||||
if (getCurrentNodeByUrl()) {
|
$(".main > .main-left > .nav > .slide > .slide-menu > li").click(function () {
|
||||||
mainNodeName = "node-" + luciLocation[0] + "-" + luciLocation[1];
|
if (lastNode != undefined)
|
||||||
mainNodeName = mainNodeName.replace(/[ \t\n\r\/]+/g, "_").toLowerCase();
|
lastNode.removeClass("active");
|
||||||
$("body").addClass(mainNodeName);
|
$(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;
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sidebar expand
|
* get current node and open it
|
||||||
*/
|
*/
|
||||||
var showSide = false;
|
if (getCurrentNodeByUrl()) {
|
||||||
$(".showSide").click(function () {
|
mainNodeName = "node-" + luciLocation[0] + "-" + luciLocation[1];
|
||||||
if (showSide) {
|
mainNodeName = mainNodeName.replace(/[ \t\n\r\/]+/g, "_").toLowerCase();
|
||||||
$(".darkMask").stop(true).fadeOut("fast");
|
$("body").addClass(mainNodeName);
|
||||||
$(".main-left").stop(true).animate({
|
}
|
||||||
width: "0"
|
$(".cbi-button-up").val("");
|
||||||
}, "200");
|
$(".cbi-button-down").val("");
|
||||||
$(".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) {
|
* hook other "A Label" and add hash to it.
|
||||||
$(".main-left").css("width", "");
|
*/
|
||||||
$(".darkMask").stop(true);
|
$("#maincontent > .container").find("a").each(function () {
|
||||||
$(".darkMask").css("display", "none");
|
var that = $(this);
|
||||||
showSide = false;
|
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;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fix legend position
|
* Sidebar expand
|
||||||
*/
|
*/
|
||||||
$("legend").each(function () {
|
var showSide = false;
|
||||||
var that = $(this);
|
$(".showSide").click(function () {
|
||||||
that.after("<span class='panel-title'>" + that.text() + "</span>");
|
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;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$(".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();
|
$(".darkMask").click(function () {
|
||||||
$(".main-right").blur();
|
if (showSide) {
|
||||||
$("input").attr("size", "0");
|
showSide = false;
|
||||||
$(".cbi-button-up").val("__");
|
$(".darkMask").stop(true).fadeOut("fast");
|
||||||
$(".cbi-button-down").val("__");
|
$(".main-left").stop(true).animate({
|
||||||
$(".slide > a").removeAttr("href");
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
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];
|
var getaudio = $('#player')[0];
|
||||||
/* Get the audio from the player (using the player's ID), the [0] is necessary */
|
/* 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';
|
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. */
|
/* 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() {
|
$(document).on('click touchend', '.speaker', function() {
|
||||||
/* Touchend is necessary for mobile devices, click alone won't work */
|
/* Touchend is necessary for mobile devices, click alone won't work */
|
||||||
if (!$('.speaker').hasClass("speakerplay")) {
|
if (!$('.speaker').hasClass("speakerplay")) {
|
||||||
@ -260,22 +313,15 @@ document.addEventListener('luci-loaded', function(ev) {
|
|||||||
/*Set the status back to off*/
|
/*Set the status back to off*/
|
||||||
});
|
});
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
$("input[type='checkbox']").filter(function () {
|
|
||||||
return (!$(this).next("label").length)
|
|
||||||
}).show();
|
|
||||||
}, 0);
|
|
||||||
|
|
||||||
var options = { attributes: true};
|
|
||||||
function callback() {
|
|
||||||
$("input[type='checkbox']").filter(function () {
|
$("input[type='checkbox']").filter(function () {
|
||||||
return (!$(this).next("label").length)
|
return (!$(this).next("label").length)
|
||||||
}).show();
|
}).show();
|
||||||
}
|
|
||||||
var mutationObserver = new MutationObserver(callback);
|
}, 0);
|
||||||
mutationObserver.observe($("body")[0], options);
|
$(".cbi-value").has("textarea").css("background","none");
|
||||||
$(".cbi-value").has("textarea").css("background","none");
|
|
||||||
if(document.body.scrollHeight > window.innerHeight){
|
if(document.body.scrollHeight > window.innerHeight){
|
||||||
$(".cbi-page-actions.control-group").addClass("fixed")
|
$(".cbi-page-actions.control-group").addClass("fixed")
|
||||||
}
|
}
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
});
|
|
@ -1,135 +0,0 @@
|
|||||||
/*!
|
|
||||||
* 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;
|
|
||||||
}
|
|
@ -1,6 +1,6 @@
|
|||||||
<%#
|
<%#
|
||||||
Copyright 2008 Steven Barth <steven@midlink.org>
|
Copyright 2008 Steven Barth <steven@midlink.org>
|
||||||
Copyright 2008-2019 Jo-Philipp Wich <jo@mein.io>
|
Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
|
||||||
Licensed to the public under the Apache License 2.0.
|
Licensed to the public under the Apache License 2.0.
|
||||||
-%>
|
-%>
|
||||||
|
|
||||||
@ -9,30 +9,4 @@
|
|||||||
include("themes/" .. theme .. "/header_login")
|
include("themes/" .. theme .. "/header_login")
|
||||||
luci.dispatcher.context.template_header_sent = true
|
luci.dispatcher.context.template_header_sent = true
|
||||||
end
|
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>
|
|
||||||
|
@ -16,20 +16,36 @@
|
|||||||
Licensed to the public under the Apache License 2.0
|
Licensed to the public under the Apache License 2.0
|
||||||
-%>
|
-%>
|
||||||
|
|
||||||
<% local ver = require "luci.version" %>
|
<%
|
||||||
|
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>
|
</div>
|
||||||
<footer class="mobile-hide">
|
|
||||||
<a href="https://github.com/openwrt/luci">Powered by <%= ver.luciname %> (<%= ver.luciversion %>)</a> / <%= ver.distversion %>
|
<footer class="mobile-hide">
|
||||||
<ul class="breadcrumb pull-right" id="modemenu" style="display:none"></ul>
|
<a href="https://github.com/openwrt/luci">Powered by <%= ver.luciname %> (<%= ver.luciversion %>)</a> /
|
||||||
</footer>
|
<%= ver.distversion %>
|
||||||
</div>
|
<% if #categories > 1 then %>
|
||||||
</div>
|
<ul class="breadcrumb pull-right" id="modemenu">
|
||||||
<script>
|
<% for i, r in ipairs(categories) do %>
|
||||||
// thanks for Jo-Philipp Wich <jow@openwrt.org>
|
<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>
|
||||||
var luciLocation = <%= luci.http.write_json(luci.dispatcher.context.path) %>;
|
<% end %>
|
||||||
</script>
|
</ul>
|
||||||
<script src="<%=media%>/js/script.js?v=2.1"></script>
|
<% end %>
|
||||||
|
</footer>
|
||||||
</body>
|
</div>
|
||||||
</html>
|
</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>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
edge is a clean HTML5 theme for LuCI. It is based on luci-theme-material edge Template
|
edge is a clean HTML5 theme for LuCI. It is based on luci-theme-material edge Template
|
||||||
|
|
||||||
luci-theme-edge
|
luci-theme-edge
|
||||||
Copyright 2020 Kiddin'
|
Copyright 2020 GaryPang <garyp@qq.com>
|
||||||
|
|
||||||
Have a bug? Please create an issue here on GitHub!
|
Have a bug? Please create an issue here on GitHub!
|
||||||
https://github.com/jerrykuku/luci-theme-edge/issues
|
https://github.com/jerrykuku/luci-theme-edge/issues
|
||||||
@ -17,175 +17,213 @@
|
|||||||
-%>
|
-%>
|
||||||
|
|
||||||
<%
|
<%
|
||||||
local sys = require "luci.sys"
|
local sys = require "luci.sys"
|
||||||
local util = require "luci.util"
|
local util = require "luci.util"
|
||||||
local http = require "luci.http"
|
local http = require "luci.http"
|
||||||
local disp = require "luci.dispatcher"
|
local disp = require "luci.dispatcher"
|
||||||
|
local fs = require "nixio.fs"
|
||||||
|
local nutil = require "nixio.util"
|
||||||
|
|
||||||
local boardinfo = util.ubus("system", "board")
|
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 node = disp.context.dispatched
|
||||||
|
|
||||||
local fs = require "nixio.fs"
|
local categories = disp.node_childs(tree)
|
||||||
local nutil = require "nixio.util"
|
|
||||||
|
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
|
-- send as HTML5
|
||||||
http.prepare_content("text/html")
|
http.prepare_content("text/html")
|
||||||
|
|
||||||
math.randomseed(os.time())
|
|
||||||
|
|
||||||
|
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>
|
<!DOCTYPE html>
|
||||||
<html lang="<%=luci.i18n.context.lang%>">
|
<html lang="<%=luci.i18n.context.lang%>">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>
|
<title>
|
||||||
<%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %>
|
<%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %>
|
||||||
- LuCI</title>
|
- LuCI</title>
|
||||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
|
<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="apple-mobile-web-app-capable" content="yes">
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta name="theme-color" content="#09c">
|
<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-tap-highlight" content="no">
|
||||||
<meta name="msapplication-TileColor" content="#09c">
|
<meta name="msapplication-TileColor" content="#5e72e4">
|
||||||
|
|
||||||
<meta name="application-name" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
|
<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="apple-mobile-web-app-title" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
|
||||||
<meta name="msapplication-TileImage" content="<%=media%>/logo.png" />
|
<meta name="msapplication-TileImage" content="<%=media%>/logo.png" />
|
||||||
<link rel="icon" href="<%=media%>/logo.png" sizes="144x144">
|
<link rel="icon" href="<%=media%>/logo.png" sizes="144x144">
|
||||||
<link rel="apple-touch-icon-precomposed" href="<%=media%>/logo.png" sizes="144x144">
|
<link rel="apple-touch-icon-precomposed" href="<%=media%>/logo.png" sizes="144x144">
|
||||||
<link rel="stylesheet" href="<%=media%>/cascade.css">
|
<link rel="stylesheet" href="<%=media%>/cascade.css">
|
||||||
<link rel="shortcut icon" href="<%=media%>/favicon.ico">
|
<link rel="shortcut icon" href="<%=media%>/favicon.ico">
|
||||||
<% if node and node.css then %>
|
<% if node and node.css then %>
|
||||||
<link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
|
<link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% if css then %>
|
<% if css then %>
|
||||||
<style title="text/css">
|
<style title="text/css"><%=css %></style>
|
||||||
<%=css %>
|
|
||||||
</style>
|
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<script src="<%=url('admin/translations', luci.i18n.context.lang)%>"></script>
|
|
||||||
<script src="<%=resource%>/cbi.js"></script>
|
<script src="<%=resource%>/cbi.js"></script>
|
||||||
<script src="<%=resource%>/luci.js"></script>
|
<script src="<%=resource%>/xhr.js"></script>
|
||||||
<script src="<%=media%>/js/jquery.min.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>
|
</head>
|
||||||
|
|
||||||
<body
|
<body
|
||||||
class="lang_<%=luci.i18n.context.lang%> <% if node then %><%= striptags( node.title ) %><% end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %>"
|
class="<%- if node then %><%= striptags( node.title ) %><%- end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %> lang_<%=luci.i18n.context.lang%> ">
|
||||||
data-page="<%= table.concat(disp.context.requestpath, "-") %>">
|
|
||||||
|
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div style="" class="loading">
|
|
||||||
<div class="sk-folding-cube">
|
<div class="main-left">
|
||||||
<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">
|
<div class="sidenav-header d-flex align-items-center">
|
||||||
<a class="brand" href="#"><img src="<%=media%>/logo.png"></a>
|
<a class="brand" href="#"><img src="<%=media%>/logo.png"></a>
|
||||||
<div class="ml-auto">
|
<div class="ml-auto">
|
||||||
@ -200,20 +238,30 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<% render_topmenu() %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="main-right">
|
<div class="main-right">
|
||||||
<hr/>
|
<hr/>
|
||||||
<div id="indicators" class="pull-right"></div>
|
<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">
|
<header class="bg-primary">
|
||||||
<div class="fill">
|
<div class="fill">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="showSide"></a>
|
<a class="showSide"></a>
|
||||||
<a class="brand" href="#"><img src="<%=media%>/logo.png"></a>
|
<a class="brand" href="#"><img src="<%=media%>/logo.png"></a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="darkMask"></div>
|
<div class="darkMask"></div>
|
||||||
<div id="maincontent">
|
<div id="maincontent">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
@ -222,13 +270,11 @@
|
|||||||
<h4><%:No password set!%></h4>
|
<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><%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%>
|
||||||
</p>
|
</p>
|
||||||
<% if disp.lookup("admin/system/admin") then %>
|
|
||||||
<div class="right"><a class="btn"
|
<div class="right"><a class="btn"
|
||||||
href="<%=url("admin/system/admin")%>"><%:Go to password configuration...%></a></div>
|
href="<%=url("admin/system/admin")%>"><%:Go to password configuration...%></a></div>
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
|
|
||||||
<noscript>
|
<noscript>
|
||||||
<div class="alert-message error">
|
<div class="alert-message error">
|
||||||
<h4><%:JavaScript required!%></h4>
|
<h4><%:JavaScript required!%></h4>
|
||||||
@ -236,4 +282,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</noscript>
|
</noscript>
|
||||||
|
|
||||||
<div id="tabmenu" style="display:none"></div>
|
<% if category then render_tabmenu(category, cattree) end %>
|
||||||
|
@ -1,120 +1,225 @@
|
|||||||
<%#
|
<%#
|
||||||
Edge is a clean HTML5 theme for LuCI. It is based on luci-theme-material edge Template
|
edge is a clean HTML5 theme for LuCI. It is based on luci-theme-material edge Template
|
||||||
|
|
||||||
luci-theme-Edge
|
luci-theme-edge
|
||||||
Copyright 2020 Kiddin'
|
Copyright 2019 Jerrykuku <jerrykuku@qq.com>
|
||||||
|
|
||||||
Have a bug? Please create an issue here on GitHub!
|
Have a bug? Please create an issue here on GitHub!
|
||||||
https://github.com/kiddin9/luci-theme-edge/issues
|
https://github.com/jerrykuku/luci-theme-edge/issues
|
||||||
|
|
||||||
luci-theme-Argon:
|
luci-theme-material:
|
||||||
Copyright 2019 Jerrykuku <jerrykuku@qq.com>
|
Copyright 2015 Lutty Yang <lutty@wcan.in>
|
||||||
|
|
||||||
Edge Theme
|
Agron Theme
|
||||||
https://demos.creative-tim.com/edge-dashboard/index.html
|
https://demos.creative-tim.com/edge-dashboard/index.html
|
||||||
|
|
||||||
Licensed to the public under the Apache License 2.0
|
Licensed to the public under the Apache License 2.0
|
||||||
-%>
|
-%>
|
||||||
|
|
||||||
<%
|
<%
|
||||||
local sys = require "luci.sys"
|
local sys = require "luci.sys"
|
||||||
local util = require "luci.util"
|
local util = require "luci.util"
|
||||||
local http = require "luci.http"
|
local http = require "luci.http"
|
||||||
local disp = require "luci.dispatcher"
|
local disp = require "luci.dispatcher"
|
||||||
|
local fs = require "nixio.fs"
|
||||||
|
local nutil = require "nixio.util"
|
||||||
|
|
||||||
local boardinfo = util.ubus("system", "board")
|
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 node = disp.context.dispatched
|
||||||
|
|
||||||
local fs = require "nixio.fs"
|
local categories = disp.node_childs(tree)
|
||||||
local nutil = require "nixio.util"
|
|
||||||
|
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
|
-- send as HTML5
|
||||||
http.prepare_content("text/html")
|
http.prepare_content("text/html")
|
||||||
|
|
||||||
math.randomseed(os.time())
|
|
||||||
|
|
||||||
|
|
||||||
|
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>
|
<!DOCTYPE html>
|
||||||
<html lang="<%=luci.i18n.context.lang%>">
|
<html lang="<%=luci.i18n.context.lang%>">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>
|
<title>
|
||||||
<%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %>
|
<%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %>
|
||||||
- LuCI</title>
|
- LuCI</title>
|
||||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
|
<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="apple-mobile-web-app-capable" content="yes">
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta name="theme-color" content="#09c">
|
<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-tap-highlight" content="no">
|
||||||
<meta name="msapplication-TileColor" content="#09c">
|
<meta name="msapplication-TileColor" content="#5e72e4">
|
||||||
|
|
||||||
<meta name="application-name" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
|
<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="apple-mobile-web-app-title" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
|
||||||
<meta name="msapplication-TileImage" content="<%=media%>/logo.png" />
|
<meta name="msapplication-TileImage" content="<%=media%>/logo.png" />
|
||||||
<link rel="icon" href="<%=media%>/logo.png" sizes="144x144">
|
<link rel="icon" href="<%=media%>/logo.png" sizes="144x144">
|
||||||
<link rel="apple-touch-icon-precomposed" 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%>/landscape.css">
|
||||||
<link rel="stylesheet" href="<%=media%>/cascade.css">
|
<link rel="stylesheet" href="<%=media%>/cascade.css">
|
||||||
<link rel="shortcut icon" href="<%=media%>/favicon.ico">
|
<link rel="shortcut icon" href="<%=media%>/favicon.ico">
|
||||||
<% if node and node.css then %>
|
<% if node and node.css then %>
|
||||||
<link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
|
<link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% if css then %>
|
<% if css then %>
|
||||||
<style title="text/css">
|
<style title="text/css"><%=css %></style>
|
||||||
<%=css %>
|
|
||||||
</style>
|
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<script src="<%=url('admin/translations', luci.i18n.context.lang)%>"></script>
|
|
||||||
<script src="<%=resource%>/cbi.js"></script>
|
<script src="<%=resource%>/cbi.js"></script>
|
||||||
<script src="<%=resource%>/luci.js"></script>
|
<script src="<%=resource%>/xhr.js"></script>
|
||||||
<script src="<%=media%>/js/jquery.min.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>
|
</head>
|
||||||
|
|
||||||
<body
|
<body
|
||||||
class="lang_<%=luci.i18n.context.lang%> <% if node then %><%= striptags( node.title ) %><% end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %>"
|
class="<%- if node then %><%= striptags( node.title ) %><%- end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %> lang_<%=luci.i18n.context.lang%> ">
|
||||||
data-page="<%= table.concat(disp.context.requestpath, "-") %>">
|
|
||||||
|
|
||||||
<p class="chromeframe">您使用的浏览器过于老旧,
|
<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>
|
请使用<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>
|
||||||
|
@ -5,17 +5,16 @@
|
|||||||
-%>
|
-%>
|
||||||
|
|
||||||
<%+header_login%>
|
<%+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 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>
|
||||||
|
|
||||||
<div class="speaker"></div>
|
<div class="speaker"></div>
|
||||||
<audio loop id="player" autoplay type="audio/mpeg"></audio>
|
<audio loop autoplay id="player" type="audio/mpeg"></audio>
|
||||||
<script>
|
<script>
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
var sound = document.getElementById("player");
|
var sound = document.getElementById("player");
|
||||||
sound.setAttribute('src','https://cdn.jsdelivr.net/gh/kkkidding/custom2@master/audio.ogg');
|
sound.setAttribute('src','https://cdn.jsdelivr.net/gh/kkkidding/custom2@master/audio.ogg');
|
||||||
},0);
|
}, 0);
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
if (!$('#player')[0].paused) {
|
if (!$('#player')[0].paused) {
|
||||||
$('.speaker').addClass('speakerplay');
|
$('.speaker').addClass('speakerplay');
|
||||||
@ -27,17 +26,8 @@ if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- partial -->
|
|
||||||
<div class="main">
|
<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="main-right">
|
||||||
<div class="darkMask"></div>
|
<div class="darkMask"></div>
|
||||||
<div id="maincontent">
|
<div id="maincontent">
|
||||||
@ -60,36 +50,33 @@ if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
|
|||||||
</div>
|
</div>
|
||||||
</noscript>
|
</noscript>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<form method="post" action="<%=pcdata(FULL_REQUEST_URI)%>">
|
|
||||||
|
|
||||||
|
|
||||||
|
<form method="post" action="<%=pcdata(luci.http.getenv("REQUEST_URI"))%>">
|
||||||
<div class="cbi-map">
|
<div class="cbi-map">
|
||||||
<h2 name="content"><img src="<%=media%>/logo.png" width="200"></h2>
|
<h2 name="content"><img src="<%=media%>/logo.png" width="200"></h2>
|
||||||
<div class="cbi-map-descr">
|
<div class="cbi-map-descr">
|
||||||
<%:Have a nice day. ✨%>
|
<%:Have a nice day. ✨%>
|
||||||
</div>
|
</div>
|
||||||
<div class="cbi-section"><div class="cbi-section-node">
|
<fieldset class="cbi-section"><fieldset class="cbi-section-node">
|
||||||
<div class="cbi-value">
|
<div class="cbi-value">
|
||||||
<label class="cbi-value-title"><%:Username%></label>
|
<label class="cbi-value-title"><%:Username%></label>
|
||||||
<div class="cbi-value-field">
|
<div class="cbi-value-field">
|
||||||
<input class="cbi-input-text" type="text" name="luci_username" placeholder="User name" value="<%=duser%>" />
|
<input class="cbi-input-user" type="text" name="luci_username" placeholder="User name" value="<%=duser%>" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cbi-value cbi-value-last">
|
<div class="cbi-value cbi-value-last">
|
||||||
<label class="cbi-value-title"><%:Password%></label>
|
<label class="cbi-value-title"><%:Password%></label>
|
||||||
<div class="cbi-value-field">
|
<div class="cbi-value-field">
|
||||||
<input class="cbi-input-text" type="password" placeholder="Password" name="luci_password" />
|
<input class="cbi-input-password" type="password" placeholder="Password" name="luci_password" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div></div>
|
</fieldset></fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="cbi-page-actions">
|
<div class="cbi-page-actions">
|
||||||
<input type="submit" value="<%:Login%>" class="btn cbi-button cbi-button-apply" />
|
<input type="submit" value="<%:Login%>" class="cbi-button cbi-button-apply" />
|
||||||
<input type="reset" value="<%:Reset%>" class="btn cbi-button cbi-button-reset" />
|
<input type="reset" value="<%:Reset%>" class="cbi-button cbi-button-reset" />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@ -109,7 +96,7 @@ if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
|
|||||||
|
|
||||||
<%+footer%>
|
<%+footer%>
|
||||||
<%
|
<%
|
||||||
io.popen("(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) &")
|
io.popen("(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) &")
|
||||||
io.popen("(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) &")
|
io.popen("(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) &")
|
||||||
io.popen("(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) &")
|
io.popen("(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) &")
|
||||||
%>
|
%>
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/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
|
uci batch <<-EOF
|
||||||
set luci.themes.Edge=/luci-static/edge
|
set luci.themes.Edge=/luci-static/edge
|
||||||
set luci.main.mediaurlbase=/luci-static/edge
|
set luci.main.mediaurlbase=/luci-static/edge
|
||||||
|