luci-theme-bootstrap-mod: add new package
This commit is contained in:
parent
416cb63d71
commit
f529ea10bb
15
package/lienol/luci-theme-bootstrap-mod/Makefile
Normal file
15
package/lienol/luci-theme-bootstrap-mod/Makefile
Normal file
@ -0,0 +1,15 @@
|
||||
# Copyright (C) 2018-2020 Lienol <lawlienol@gmail.com>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=Bootstrap Mod Theme By Lienol
|
||||
LUCI_DEPENDS:=
|
||||
PKG_VERSION:=1.3
|
||||
PKG_RELEASE:=20200310
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 75 KiB |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,3 @@
|
||||
// HTML5 Shiv v3 | @jon_neal @afarkas @rem | MIT/GPL2 Licensed
|
||||
// Uncompressed source: https://github.com/aFarkas/html5shiv
|
||||
(function(a,b){function f(a){var c,d,e,f;b.documentMode>7?(c=b.createElement("font"),c.setAttribute("data-html5shiv",a.nodeName.toLowerCase())):c=b.createElement("shiv:"+a.nodeName);while(a.firstChild)c.appendChild(a.childNodes[0]);for(d=a.attributes,e=d.length,f=0;f<e;++f)d[f].specified&&c.setAttribute(d[f].nodeName,d[f].nodeValue);c.style.cssText=a.style.cssText,a.parentNode.replaceChild(c,a),c.originalElement=a}function g(a){var b=a.originalElement;while(a.childNodes.length)b.appendChild(a.childNodes[0]);a.parentNode.replaceChild(b,a)}function h(a,b){b=b||"all";var c=-1,d=[],e=a.length,f,g;while(++c<e){f=a[c],g=f.media||b;if(f.disabled||!/print|all/.test(g))continue;d.push(h(f.imports,g),f.cssText)}return d.join("")}function i(c){var d=new RegExp("(^|[\\s,{}])("+a.html5.elements.join("|")+")","gi"),e=c.split("{"),f=e.length,g=-1;while(++g<f)e[g]=e[g].split("}"),b.documentMode>7?e[g][e[g].length-1]=e[g][e[g].length-1].replace(d,'$1font[data-html5shiv="$2"]'):e[g][e[g].length-1]=e[g][e[g].length-1].replace(d,"$1shiv\\:$2"),e[g]=e[g].join("}");return e.join("{")}var c=function(a){return a.innerHTML="<x-element></x-element>",a.childNodes.length===1}(b.createElement("a")),d=function(a,b,c){return b.appendChild(a),(c=(c?c(a):a.currentStyle).display)&&b.removeChild(a)&&c==="block"}(b.createElement("nav"),b.documentElement,a.getComputedStyle),e={elements:"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),shivDocument:function(a){a=a||b;if(a.documentShived)return;a.documentShived=!0;var f=a.createElement,g=a.createDocumentFragment,h=a.getElementsByTagName("head")[0],i=function(a){f(a)};c||(e.elements.join(" ").replace(/\w+/g,i),a.createElement=function(a){var b=f(a);return b.canHaveChildren&&e.shivDocument(b.document),b},a.createDocumentFragment=function(){return e.shivDocument(g())});if(!d&&h){var j=f("div");j.innerHTML=["x<style>","article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}","audio{display:none}","canvas,video{display:inline-block;*display:inline;*zoom:1}","[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}","mark{background:#FF0;color:#000}","</style>"].join(""),h.insertBefore(j.lastChild,h.firstChild)}return a}};e.shivDocument(b),a.html5=e;if(c||!a.attachEvent)return;a.attachEvent("onbeforeprint",function(){if(a.html5.supportsXElement||!b.namespaces)return;b.namespaces.shiv||b.namespaces.add("shiv");var c=-1,d=new RegExp("^("+a.html5.elements.join("|")+")$","i"),e=b.getElementsByTagName("*"),g=e.length,j,k=i(h(function(a,b){var c=[],d=a.length;while(d)c.unshift(a[--d]);d=b.length;while(d)c.unshift(b[--d]);c.sort(function(a,b){return a.sourceIndex-b.sourceIndex}),d=c.length;while(d)c[--d]=c[d].styleSheet;return c}(b.getElementsByTagName("style"),b.getElementsByTagName("link"))));while(++c<g)j=e[c],d.test(j.nodeName)&&f(j);b.appendChild(b._shivedStyleSheet=b.createElement("style")).styleSheet.cssText=k}),a.attachEvent("onafterprint",function(){if(a.html5.supportsXElement||!b.namespaces)return;var c=-1,d=b.getElementsByTagName("*"),e=d.length,f;while(++c<e)f=d[c],f.originalElement&&g(f);b._shivedStyleSheet&&b._shivedStyleSheet.parentNode.removeChild(b._shivedStyleSheet)})})(this,document)
|
||||
@ -0,0 +1,78 @@
|
||||
@media screen and (max-width: 1600px) {
|
||||
|
||||
header h3 a,
|
||||
header .brand {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1600px) {
|
||||
.container>.pull-right>* {
|
||||
position: absolute;
|
||||
right: 0.5rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1024px) {
|
||||
body {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
header {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
legend {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.dropdown-menu a {
|
||||
font-size: 13px;
|
||||
min-width: 130px;
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.mobile-hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#maincontent.container {
|
||||
padding: 0px 10px;
|
||||
}
|
||||
|
||||
div.cbi-section,
|
||||
fieldset {
|
||||
min-width: inherit;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.cbi-value {}
|
||||
|
||||
.cbi-value-title {
|
||||
width: 30%;
|
||||
min-width: 0rem !important;
|
||||
margin-right: 1em;
|
||||
/* text-align: left;
|
||||
padding-left: 1em; */
|
||||
}
|
||||
|
||||
.cbi-value-field {
|
||||
width: 55%;
|
||||
}
|
||||
|
||||
.cbi-value-description {
|
||||
width: 75%;
|
||||
display: inline-table;
|
||||
padding: 1px 1.2rem;
|
||||
background-position-y: 3px;
|
||||
}
|
||||
|
||||
.cbi-value-field .cbi-input-select,
|
||||
.cbi-value input[type="password"],
|
||||
.cbi-value input[type="text"] {
|
||||
min-width: unset;
|
||||
/* width: 95%; */
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 75 KiB |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,3 @@
|
||||
// HTML5 Shiv v3 | @jon_neal @afarkas @rem | MIT/GPL2 Licensed
|
||||
// Uncompressed source: https://github.com/aFarkas/html5shiv
|
||||
(function(a,b){function f(a){var c,d,e,f;b.documentMode>7?(c=b.createElement("font"),c.setAttribute("data-html5shiv",a.nodeName.toLowerCase())):c=b.createElement("shiv:"+a.nodeName);while(a.firstChild)c.appendChild(a.childNodes[0]);for(d=a.attributes,e=d.length,f=0;f<e;++f)d[f].specified&&c.setAttribute(d[f].nodeName,d[f].nodeValue);c.style.cssText=a.style.cssText,a.parentNode.replaceChild(c,a),c.originalElement=a}function g(a){var b=a.originalElement;while(a.childNodes.length)b.appendChild(a.childNodes[0]);a.parentNode.replaceChild(b,a)}function h(a,b){b=b||"all";var c=-1,d=[],e=a.length,f,g;while(++c<e){f=a[c],g=f.media||b;if(f.disabled||!/print|all/.test(g))continue;d.push(h(f.imports,g),f.cssText)}return d.join("")}function i(c){var d=new RegExp("(^|[\\s,{}])("+a.html5.elements.join("|")+")","gi"),e=c.split("{"),f=e.length,g=-1;while(++g<f)e[g]=e[g].split("}"),b.documentMode>7?e[g][e[g].length-1]=e[g][e[g].length-1].replace(d,'$1font[data-html5shiv="$2"]'):e[g][e[g].length-1]=e[g][e[g].length-1].replace(d,"$1shiv\\:$2"),e[g]=e[g].join("}");return e.join("{")}var c=function(a){return a.innerHTML="<x-element></x-element>",a.childNodes.length===1}(b.createElement("a")),d=function(a,b,c){return b.appendChild(a),(c=(c?c(a):a.currentStyle).display)&&b.removeChild(a)&&c==="block"}(b.createElement("nav"),b.documentElement,a.getComputedStyle),e={elements:"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),shivDocument:function(a){a=a||b;if(a.documentShived)return;a.documentShived=!0;var f=a.createElement,g=a.createDocumentFragment,h=a.getElementsByTagName("head")[0],i=function(a){f(a)};c||(e.elements.join(" ").replace(/\w+/g,i),a.createElement=function(a){var b=f(a);return b.canHaveChildren&&e.shivDocument(b.document),b},a.createDocumentFragment=function(){return e.shivDocument(g())});if(!d&&h){var j=f("div");j.innerHTML=["x<style>","article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}","audio{display:none}","canvas,video{display:inline-block;*display:inline;*zoom:1}","[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}","mark{background:#FF0;color:#000}","</style>"].join(""),h.insertBefore(j.lastChild,h.firstChild)}return a}};e.shivDocument(b),a.html5=e;if(c||!a.attachEvent)return;a.attachEvent("onbeforeprint",function(){if(a.html5.supportsXElement||!b.namespaces)return;b.namespaces.shiv||b.namespaces.add("shiv");var c=-1,d=new RegExp("^("+a.html5.elements.join("|")+")$","i"),e=b.getElementsByTagName("*"),g=e.length,j,k=i(h(function(a,b){var c=[],d=a.length;while(d)c.unshift(a[--d]);d=b.length;while(d)c.unshift(b[--d]);c.sort(function(a,b){return a.sourceIndex-b.sourceIndex}),d=c.length;while(d)c[--d]=c[d].styleSheet;return c}(b.getElementsByTagName("style"),b.getElementsByTagName("link"))));while(++c<g)j=e[c],d.test(j.nodeName)&&f(j);b.appendChild(b._shivedStyleSheet=b.createElement("style")).styleSheet.cssText=k}),a.attachEvent("onafterprint",function(){if(a.html5.supportsXElement||!b.namespaces)return;var c=-1,d=b.getElementsByTagName("*"),e=d.length,f;while(++c<e)f=d[c],f.originalElement&&g(f);b._shivedStyleSheet&&b._shivedStyleSheet.parentNode.removeChild(b._shivedStyleSheet)})})(this,document)
|
||||
@ -0,0 +1,78 @@
|
||||
@media screen and (max-width: 1600px) {
|
||||
|
||||
header h3 a,
|
||||
header .brand {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1600px) {
|
||||
.container>.pull-right>* {
|
||||
position: absolute;
|
||||
right: 0.5rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1024px) {
|
||||
body {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
header {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
legend {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.dropdown-menu a {
|
||||
font-size: 13px;
|
||||
min-width: 130px;
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.mobile-hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#maincontent.container {
|
||||
padding: 0px 10px;
|
||||
}
|
||||
|
||||
div.cbi-section,
|
||||
fieldset {
|
||||
min-width: inherit;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.cbi-value {}
|
||||
|
||||
.cbi-value-title {
|
||||
width: 30%;
|
||||
min-width: 0rem !important;
|
||||
margin-right: 1em;
|
||||
/* text-align: left;
|
||||
padding-left: 1em; */
|
||||
}
|
||||
|
||||
.cbi-value-field {
|
||||
width: 55%;
|
||||
}
|
||||
|
||||
.cbi-value-description {
|
||||
width: 75%;
|
||||
display: inline-table;
|
||||
padding: 1px 1.2rem;
|
||||
background-position-y: 3px;
|
||||
}
|
||||
|
||||
.cbi-value-field .cbi-input-select,
|
||||
.cbi-value input[type="password"],
|
||||
.cbi-value input[type="text"] {
|
||||
min-width: unset;
|
||||
/* width: 95%; */
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
@ -0,0 +1,55 @@
|
||||
<%#
|
||||
Copyright 2008 Steven Barth <steven@midlink.org>
|
||||
Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
|
||||
Copyright 2012 David Menting <david@nut-bolt.nl>
|
||||
Copyright 2018-2019 Lienol <lawlienol@gmail.com>
|
||||
Licensed to the public under the Apache License 2.0.
|
||||
-%>
|
||||
|
||||
<%
|
||||
local ver = require "luci.version"
|
||||
local disp = require "luci.dispatcher"
|
||||
local request = disp.context.path
|
||||
local category = request[1]
|
||||
local tree = disp.node()
|
||||
local categories = disp.node_childs(tree)
|
||||
%>
|
||||
<footer>
|
||||
<a href="https://github.com/openwrt/luci">Powered by <%= ver.luciname %></a> / <%= ver.distversion %>
|
||||
<% if #categories > 1 then %>
|
||||
<ul class="breadcrumb pull-right" id="modemenu">
|
||||
<% for i, r in ipairs(categories) do %>
|
||||
<li<% if request[1] == r then %> class="active"<%end%>><a href="<%=controller%>/<%=r%>/"><%=striptags(translate(tree.nodes[r].title))%></a> <span class="divider">|</span></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
window.onload = function(){
|
||||
var content = document.getElementsByName("content");
|
||||
var luci_username = document.getElementsByName("luci_username");
|
||||
var luci_password = document.getElementsByName("luci_password");
|
||||
if (content.length == 1 && luci_username.length == 1 && luci_password.length == 1) {
|
||||
//需要登录
|
||||
document.body.classList.add('node-main-login');
|
||||
luci_username[0].parentElement.parentElement.classList.add('luci_username_div');
|
||||
luci_username[0].parentElement.parentElement.children[0].style.display = "none";
|
||||
luci_password[0].parentElement.parentElement.classList.add('luci_password_div');
|
||||
luci_password[0].parentElement.parentElement.children[0].style.display = "none";
|
||||
|
||||
var errorbox = document.getElementsByClassName("errorbox");
|
||||
if (errorbox.length == 1) {
|
||||
var tips = document.getElementsByClassName("cbi-map-descr");
|
||||
if (tips.length == 1) {
|
||||
tips[0].innerHTML = errorbox[0].innerHTML;
|
||||
tips[0].classList.add('errorbox');
|
||||
errorbox[0].style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
@ -0,0 +1,220 @@
|
||||
<%#
|
||||
Copyright 2008 Steven Barth <steven@midlink.org>
|
||||
Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
|
||||
Copyright 2012 David Menting <david@nut-bolt.nl>
|
||||
Copyright 2018-2019 Lienol <lawlienol@gmail.com>
|
||||
Licensed to the public under the Apache License 2.0.
|
||||
-%>
|
||||
|
||||
<%
|
||||
local sys = require "luci.sys"
|
||||
local util = require "luci.util"
|
||||
local http = require "luci.http"
|
||||
local disp = require "luci.dispatcher"
|
||||
|
||||
local boardinfo = util.ubus("system", "board")
|
||||
|
||||
local request = disp.context.path
|
||||
local request2 = disp.context.request
|
||||
|
||||
local category = request[1]
|
||||
local cattree = category and disp.node(category)
|
||||
|
||||
local leaf = request2[#request2]
|
||||
|
||||
local tree = disp.node()
|
||||
local node = disp.context.dispatched
|
||||
|
||||
local categories = disp.node_childs(tree)
|
||||
|
||||
local c = tree
|
||||
local i, r
|
||||
|
||||
-- tag all nodes leading to this page
|
||||
for i, r in ipairs(request) do
|
||||
if c.nodes and c.nodes[r] then
|
||||
c = c.nodes[r]
|
||||
c._menu_selected = true
|
||||
end
|
||||
end
|
||||
|
||||
-- send as HTML5
|
||||
http.prepare_content("text/html")
|
||||
|
||||
local function nodeurl(prefix, name, query)
|
||||
local u = url(prefix, name)
|
||||
if query then
|
||||
u = u .. http.build_querystring(query)
|
||||
end
|
||||
return pcdata(u)
|
||||
end
|
||||
|
||||
local function render_tabmenu(prefix, node, level)
|
||||
if not level then
|
||||
level = 1
|
||||
end
|
||||
|
||||
local childs = disp.node_childs(node)
|
||||
if #childs > 0 then
|
||||
if level > 2 then
|
||||
write('<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="dropdown-menu">')
|
||||
|
||||
for i, r in ipairs(childs) do
|
||||
local nnode = node.nodes[r]
|
||||
write('<li><a href="%s">%s</a></li>' %{
|
||||
nodeurl(prefix, r, nnode.query),
|
||||
pcdata(striptags(translate(nnode.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
|
||||
write('<li class="dropdown"><a class="menu" href="#">%s</a>' % pcdata(striptags(translate(nnode.title))))
|
||||
render_submenu(category .. "/" .. r, nnode)
|
||||
write('</li>')
|
||||
else
|
||||
write('<li><a href="%s">%s</a></li>' %{
|
||||
nodeurl(category, r, nnode.query),
|
||||
pcdata(striptags(translate(nnode.title)))
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
write('</ul>')
|
||||
end
|
||||
end
|
||||
|
||||
local function render_changes()
|
||||
local file = io.open("/usr/lib/lua/luci/view/admin_uci/changes.htm", "rb")
|
||||
if file then file:close() end
|
||||
if file ~= nil then
|
||||
-- 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
|
||||
end
|
||||
-%>
|
||||
<!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>
|
||||
<!--[if lt IE 9]><script src="<%=media%>/html5.js?v=git-18.138.53009-80cb4fe"></script><![endif]-->
|
||||
<meta name="viewport" content="initial-scale=1.0">
|
||||
<link rel="stylesheet" href="<%=media%>/cascade.css?v=git-18.138.53009-80cb4fe">
|
||||
<link rel="stylesheet" media="only screen and (max-width: 1600px)" href="<%=media%>/mobile.css?v=git-18.138.53009-80cb4fe" type="text/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)%>?v=git-19.338.61646-9ca48ec"></script>
|
||||
<script src="<%=resource%>/cbi.js?v=git-19.338.61646-9ca48ec"></script>
|
||||
<script src="<%=resource%>/xhr.js?v=git-19.338.61646-9ca48ec"></script>
|
||||
</head>
|
||||
|
||||
<body class="lang_<%=luci.i18n.context.lang%> <% if node then %><%= striptags( node.title ) %><%- end %>" data-page="<%= table.concat(disp.context.requestpath, "-") %>">
|
||||
<header>
|
||||
<div class="fill">
|
||||
<div class="container">
|
||||
<a class="brand" href="#"><%=boardinfo.hostname or "?"%></a>
|
||||
<% render_topmenu() %>
|
||||
<div class="pull-right">
|
||||
<% render_changes() %>
|
||||
<span id="xhr_poll_status" style="display:none" onclick="XHR.running() ? XHR.halt() : XHR.run()">
|
||||
<span class="label success" id="xhr_poll_status_on"><span class="mobile-hide"><%:Auto Refresh%> </span><%:on%></span>
|
||||
<span class="label" id="xhr_poll_status_off" style="display:none"><span class="mobile-hide"><%:Auto Refresh%> </span><%:off%></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
|
||||
<div class="container">
|
||||
<div class="alert-message warning">
|
||||
<h4><%:No password set!%></h4>
|
||||
<%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%><br>
|
||||
<a href="<%=pcdata(luci.dispatcher.build_url("admin/system/admin"))%>"><%:Go to password configuration...%></a>
|
||||
</div>
|
||||
</div>
|
||||
<%- end -%>
|
||||
|
||||
<noscript>
|
||||
<div class="alert-message warning">
|
||||
<strong><%:JavaScript required!%></strong><br />
|
||||
<%:You must enable JavaScript in your browser or LuCI will not work properly.%>
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<div id="maincontent" class="container">
|
||||
<% if category then render_tabmenu(category, cattree) end %>
|
||||
@ -0,0 +1,55 @@
|
||||
<%#
|
||||
Copyright 2008 Steven Barth <steven@midlink.org>
|
||||
Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
|
||||
Copyright 2012 David Menting <david@nut-bolt.nl>
|
||||
Copyright 2018-2019 Lienol <lawlienol@gmail.com>
|
||||
Licensed to the public under the Apache License 2.0.
|
||||
-%>
|
||||
|
||||
<%
|
||||
local ver = require "luci.version"
|
||||
local disp = require "luci.dispatcher"
|
||||
local request = disp.context.path
|
||||
local category = request[1]
|
||||
local tree = disp.node()
|
||||
local categories = disp.node_childs(tree)
|
||||
%>
|
||||
<footer>
|
||||
<a href="https://github.com/openwrt/luci">Powered by <%= ver.luciname %></a> / <%= ver.distversion %>
|
||||
<% if #categories > 1 then %>
|
||||
<ul class="breadcrumb pull-right" id="modemenu">
|
||||
<% for i, r in ipairs(categories) do %>
|
||||
<li<% if request[1] == r then %> class="active"<%end%>><a href="<%=controller%>/<%=r%>/"><%=striptags(translate(tree.nodes[r].title))%></a> <span class="divider">|</span></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
window.onload = function(){
|
||||
var content = document.getElementsByName("content");
|
||||
var luci_username = document.getElementsByName("luci_username");
|
||||
var luci_password = document.getElementsByName("luci_password");
|
||||
if (content.length == 1 && luci_username.length == 1 && luci_password.length == 1) {
|
||||
//需要登录
|
||||
document.body.classList.add('node-main-login');
|
||||
luci_username[0].parentElement.parentElement.classList.add('luci_username_div');
|
||||
luci_username[0].parentElement.parentElement.children[0].style.display = "none";
|
||||
luci_password[0].parentElement.parentElement.classList.add('luci_password_div');
|
||||
luci_password[0].parentElement.parentElement.children[0].style.display = "none";
|
||||
|
||||
var errorbox = document.getElementsByClassName("errorbox");
|
||||
if (errorbox.length == 1) {
|
||||
var tips = document.getElementsByClassName("cbi-map-descr");
|
||||
if (tips.length == 1) {
|
||||
tips[0].innerHTML = errorbox[0].innerHTML;
|
||||
tips[0].classList.add('errorbox');
|
||||
errorbox[0].style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
@ -0,0 +1,220 @@
|
||||
<%#
|
||||
Copyright 2008 Steven Barth <steven@midlink.org>
|
||||
Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
|
||||
Copyright 2012 David Menting <david@nut-bolt.nl>
|
||||
Copyright 2018-2019 Lienol <lawlienol@gmail.com>
|
||||
Licensed to the public under the Apache License 2.0.
|
||||
-%>
|
||||
|
||||
<%
|
||||
local sys = require "luci.sys"
|
||||
local util = require "luci.util"
|
||||
local http = require "luci.http"
|
||||
local disp = require "luci.dispatcher"
|
||||
|
||||
local boardinfo = util.ubus("system", "board")
|
||||
|
||||
local request = disp.context.path
|
||||
local request2 = disp.context.request
|
||||
|
||||
local category = request[1]
|
||||
local cattree = category and disp.node(category)
|
||||
|
||||
local leaf = request2[#request2]
|
||||
|
||||
local tree = disp.node()
|
||||
local node = disp.context.dispatched
|
||||
|
||||
local categories = disp.node_childs(tree)
|
||||
|
||||
local c = tree
|
||||
local i, r
|
||||
|
||||
-- tag all nodes leading to this page
|
||||
for i, r in ipairs(request) do
|
||||
if c.nodes and c.nodes[r] then
|
||||
c = c.nodes[r]
|
||||
c._menu_selected = true
|
||||
end
|
||||
end
|
||||
|
||||
-- send as HTML5
|
||||
http.prepare_content("text/html")
|
||||
|
||||
local function nodeurl(prefix, name, query)
|
||||
local u = url(prefix, name)
|
||||
if query then
|
||||
u = u .. http.build_querystring(query)
|
||||
end
|
||||
return pcdata(u)
|
||||
end
|
||||
|
||||
local function render_tabmenu(prefix, node, level)
|
||||
if not level then
|
||||
level = 1
|
||||
end
|
||||
|
||||
local childs = disp.node_childs(node)
|
||||
if #childs > 0 then
|
||||
if level > 2 then
|
||||
write('<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="dropdown-menu">')
|
||||
|
||||
for i, r in ipairs(childs) do
|
||||
local nnode = node.nodes[r]
|
||||
write('<li><a href="%s">%s</a></li>' %{
|
||||
nodeurl(prefix, r, nnode.query),
|
||||
pcdata(striptags(translate(nnode.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
|
||||
write('<li class="dropdown"><a class="menu" href="#">%s</a>' % pcdata(striptags(translate(nnode.title))))
|
||||
render_submenu(category .. "/" .. r, nnode)
|
||||
write('</li>')
|
||||
else
|
||||
write('<li><a href="%s">%s</a></li>' %{
|
||||
nodeurl(category, r, nnode.query),
|
||||
pcdata(striptags(translate(nnode.title)))
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
write('</ul>')
|
||||
end
|
||||
end
|
||||
|
||||
local function render_changes()
|
||||
local file = io.open("/usr/lib/lua/luci/view/admin_uci/changes.htm", "rb")
|
||||
if file then file:close() end
|
||||
if file ~= nil then
|
||||
-- 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
|
||||
end
|
||||
-%>
|
||||
<!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>
|
||||
<!--[if lt IE 9]><script src="<%=media%>/html5.js?v=git-18.138.53009-80cb4fe"></script><![endif]-->
|
||||
<meta name="viewport" content="initial-scale=1.0">
|
||||
<link rel="stylesheet" href="<%=media%>/cascade.css?v=git-18.138.53009-80cb4fe">
|
||||
<link rel="stylesheet" media="only screen and (max-width: 1600px)" href="<%=media%>/mobile.css?v=git-18.138.53009-80cb4fe" type="text/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)%>?v=git-19.338.61646-9ca48ec"></script>
|
||||
<script src="<%=resource%>/cbi.js?v=git-19.338.61646-9ca48ec"></script>
|
||||
<script src="<%=resource%>/xhr.js?v=git-19.338.61646-9ca48ec"></script>
|
||||
</head>
|
||||
|
||||
<body class="lang_<%=luci.i18n.context.lang%> <% if node then %><%= striptags( node.title ) %><%- end %>" data-page="<%= table.concat(disp.context.requestpath, "-") %>">
|
||||
<header>
|
||||
<div class="fill">
|
||||
<div class="container">
|
||||
<a class="brand" href="#"><%=boardinfo.hostname or "?"%></a>
|
||||
<% render_topmenu() %>
|
||||
<div class="pull-right">
|
||||
<% render_changes() %>
|
||||
<span id="xhr_poll_status" style="display:none" onclick="XHR.running() ? XHR.halt() : XHR.run()">
|
||||
<span class="label success" id="xhr_poll_status_on"><span class="mobile-hide"><%:Auto Refresh%> </span><%:on%></span>
|
||||
<span class="label" id="xhr_poll_status_off" style="display:none"><span class="mobile-hide"><%:Auto Refresh%> </span><%:off%></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
|
||||
<div class="container">
|
||||
<div class="alert-message warning">
|
||||
<h4><%:No password set!%></h4>
|
||||
<%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%><br>
|
||||
<a href="<%=pcdata(luci.dispatcher.build_url("admin/system/admin"))%>"><%:Go to password configuration...%></a>
|
||||
</div>
|
||||
</div>
|
||||
<%- end -%>
|
||||
|
||||
<noscript>
|
||||
<div class="alert-message warning">
|
||||
<strong><%:JavaScript required!%></strong><br />
|
||||
<%:You must enable JavaScript in your browser or LuCI will not work properly.%>
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<div id="maincontent" class="container">
|
||||
<% if category then render_tabmenu(category, cattree) end %>
|
||||
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
uci batch <<-EOF
|
||||
set luci.themes.Bootstrap_Mod=/luci-static/bootstrap_mod
|
||||
set luci.themes.Bootstrap_Blue=/luci-static/bootstrap_blue
|
||||
set luci.main.mediaurlbase=/luci-static/bootstrap_mod
|
||||
commit luci
|
||||
EOF
|
||||
exit 0
|
||||
Loading…
Reference in New Issue
Block a user