update 04-06 11:14

This commit is contained in:
github-actions[bot] 2022-04-06 11:14:27 +08:00
parent 569afdb5e7
commit 20781aa055
38 changed files with 2775 additions and 0 deletions

15
luci-themedog/Makefile Executable file
View File

@ -0,0 +1,15 @@
#
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=ThemeDog
LUCI_DEPENDS:=
PKG_VERSION:=0.0.60
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,48 @@
:root {
--background-color-high-hsl: none;
--background-color-high: none;
--background-color-medium-hsl: none;
--background-color-medium: none;
--background-color-low-hsl: none;
--background-color-low: none;
--text-color-high: #eee;
}
#maincontent {
position: relative;
width: 100%;
max-width: 1180px;
margin: 0 auto;
padding: 3rem 1rem 1rem;
}
.alert-message.fade-in.warning {
max-width: 1100px;
width: 100%;
background: rgba(0, 0, 0, 0.7);
border-radius: 1rem;
margin: 0 auto;
padding: 1rem 1.5rem;
}
.alert-message.fade-in.warning.fade-out {
display: none !important;
}
html,body{
color-scheme: none !important;
}
body {
background: none !important;
/* background: url(/luci-static/themedog/image/bg.gif) no-repeat center center fixed; */
}
.modal {
background-color: #181c20c7;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
}
select{
background-color: #181c20c7;
}
option{
color: #fff;
}
.cbi-dropdown[open] > ul.dropdown {
background-color: #181c20;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View File

@ -0,0 +1,68 @@
module("luci.controller.themedog", package.seeall)
function index()
entry({"admin", "themedog"}, call("themedog_template"))
if nixio.fs.access("/usr/lib/lua/luci/view/themedog/main_dev.htm") then
entry({"admin", "themedog_dev"}, call("themedog_template_dev"))
end
entry({"admin", "themedog", "api"}, call("redirect_index"))
entry({"admin", "themedog", "api","status"}, call("themedog_api_status"))
entry({"admin", "themedog", "api","memory"}, call("themedog_api_memory"))
entry({"admin", "themedog", "api","cpu"}, call("themedog_api_cpu"))
end
function redirect_index()
luci.http.redirect(luci.dispatcher.build_url("admin/themedog"))
end
function themedog_template()
luci.template.render("themedog/main")
end
function themedog_template_dev()
luci.template.render("themedog/main_dev")
end
function themedog_api_status()
local locallTime = luci.sys.exec("printf \"%d\" $(date +%s)")
local uptime = luci.sys.uptime()
local result = {
locallTime = tonumber(locallTime),
uotime = uptime
}
local data = {
success = true,
result = result
}
luci.http.prepare_content("application/json")
luci.http.write_json(data)
end
function themedog_api_memory()
local total = luci.sys.exec("cat /proc/meminfo |grep MemTotal |awk -F ' ' '{printf(\"%d\",$2)}'")
local available = luci.sys.exec("free -h |grep Mem |awk -F ' ' '{printf(\"%d\", $7)}'")
local result = {
total = tonumber(total),
available = tonumber(available)
}
local data = {
success = true,
result = result
}
luci.http.prepare_content("application/json")
luci.http.write_json(data)
end
function themedog_api_cpu()
local available = luci.sys.exec("top -n1 | awk '/^CPU:/ {printf(\"%d\",$8)}'")
local result = {
total = 100,
available = tonumber(available)
}
local data = {
success = true,
result = result
}
luci.http.prepare_content("application/json")
luci.http.write_json(data)
end

View File

@ -0,0 +1,13 @@
<%+header%>
<script>
(function(){
window.ThemeDog = {
HostName: "<%=luci.sys.hostname()%>",
BaseURL:"<%=media%>",
}
})()
</script>
<script type="module" crossorigin src="<%=media%>/assets/index.js?v=<%=math.random(1,100000)%>"></script>
<link rel="modulepreload" href="<%=media%>/assets/vendor.js?v=<%=math.random(1,100000)%>">
<link rel="stylesheet" href="<%=media%>/assets/style.css?v=<%=math.random(1,100000)%>">
<%+footer%>

View File

@ -0,0 +1,11 @@
<%+header%>
<script>
(function(){
window.ThemeDog = {
HostName: "<%=luci.sys.hostname()%>",
BaseURL:"<%=media%>",
}
})()
</script>
<script type="module" src="http://localhost:3000/src/main.ts"></script>
<%+footer%>

View File

@ -0,0 +1,3 @@
</div>
</body>
</html>

View File

@ -0,0 +1,40 @@
<%
local util = require "luci.util"
local disp = require "luci.dispatcher"
local node = disp.context.dispatched
local path = table.concat(disp.context.path, "-")
local hostname = luci.sys.hostname()
local page = pcdata(table.concat(disp.context.requestpath, "-"))
local lang = luci.i18n.context.lang
local isindex = path == "admin-themedog"
luci.http.prepare_content("text/html; charset=UTF-8")
-%>
<!DOCTYPE html>
<html lang="<%=lang%>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="msapplication-navbutton-color" content="#000">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="theme-color" content="#000">
<!-- -->
<script type="text/javascript" src="<%=url('admin/translations', lang)%>"></script>
<script type="text/javascript" src="<%=resource%>/cbi.js?v=0.0.5"></script>
<script type="text/javascript" src="<%=resource%>/xhr.js?v=0.0.5"></script>
<!-- -->
<%
if ( isindex ) then
else
-%>
<link rel="stylesheet" href="<%=media%>/css/cascade.css?v=<%=math.random(1,100000)%>">
<link rel="stylesheet" href="<%=media%>/css/use.css?v=<%=math.random(1,100000)%>">
<% end -%>
<title>
<%=hostname%> - LuCI
</title>
</head>
<body name="<%=hostname%>" class="lang_<%=lang%> <% if node then %><%= striptags( node.title ) %><%- end %>" data-page="<%= page %>">
<div id="maincontent" >
<div id="indicators" class="pull-right"></div>

View File

@ -0,0 +1,59 @@
<%
local node = luci.dispatcher.context.dispatched;
local hostname = luci.sys.hostname();
local lang = luci.i18n.context.lang;
luci.http.prepare_content("text/html; charset=UTF-8");
-%>
<!DOCTYPE html>
<html lang="<%=lang%>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- -->
<!-- -->
<link rel="stylesheet" href="<%=media%>/assets/style.css?v=<%=math.random(1,100000)%>">
<!-- -->
<title>
<%=hostname%> - LuCI
</title>
<!-- -->
</head>
<body name="<%=hostname%>" class="lang_<%=lang%> <% if node then %><%= striptags( node.title ) %><%- end %>" >
<div id="themedog_loginer">
<div class="loginer-container">
<div class="login-logo">
<%=hostname%>
</div>
<% if fuser then %>
<div class="login-message">
<%:Invalid username and/or password! Please try again.%>
</div>
<% end %>
<form method="post" class="cbi-map">
<div class="cbi-section-node">
<div class="cbi-value">
<div class="cbi-value-field">
<input name="luci_username" placeholder="<%:Username%>" type="text" <%=attr("value", duser)%>>
</div>
</div>
<div class="cbi-value">
<div class="cbi-value-field">
<input name="luci_password" placeholder="<%:Password%>" type="password">
</div>
</div>
</div>
<div class="cbi-page-actions">
<button class="btn cbi-button-positive important">
<%:Login%>
</button>
</div>
</form>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,12 @@
#!/bin/sh
if [ "$PKG_UPGRADE" != 1 ]; then
uci get luci.themes.ThemeDog >/dev/null 2>&1 || \
uci batch <<-EOF
set luci.themes.ThemeDog=/luci-static/themedog
set luci.main.mediaurlbase=/luci-static/themedog
commit luci
EOF
fi
exit 0

View File

@ -0,0 +1,9 @@
{
"admin/themedog": {
"order": 0,
"action": {
"type": "template",
"path": "themedog/main"
}
}
}