update 2024-03-10 00:19:44

This commit is contained in:
github-actions[bot] 2024-03-10 00:19:44 +08:00
parent 08b72aef82
commit 16ce9f14b3
40 changed files with 793 additions and 560 deletions

View File

@ -9,7 +9,7 @@ PKG_VERSION:=0.0.0-dev.2023102203
PKG_RELEASE:=3 PKG_RELEASE:=3
ifeq ($(ARCH),aarch64) ifeq ($(ARCH),aarch64)
H_ARCH:=arm64y H_ARCH:=arm64
else ifeq ($(ARCH),arm) else ifeq ($(ARCH),arm)
H_ARCH:=arm H_ARCH:=arm

View File

@ -64,8 +64,8 @@ msgstr "选择功能"
msgid "Execute selected functions" msgid "Execute selected functions"
msgstr "执行选择的功能" msgstr "执行选择的功能"
msgid "Test broadband version" msgid "client version selection"
msgstr "测试宽带版本" msgstr "客户端版本"
msgid "python3-speedtest-cli" msgid "python3-speedtest-cli"
msgstr "python3网络测试客户端" msgstr "python3网络测试客户端"
@ -129,7 +129,7 @@ msgid "Test failed"
msgstr "测试失败" msgstr "测试失败"
msgid "Waiting (executing)..." msgid "Waiting (executing)..."
msgstr "等待(执行)中" msgstr "努力执行中"
msgid "Server Port Delay Value" msgid "Server Port Delay Value"
msgstr "服务器端口延时值" msgstr "服务器端口延时值"
@ -152,8 +152,8 @@ msgstr "-P, --parallel ...<number>........多线程运行的数量"
msgid "-R, --reverse ....................run in reverse mode (server sends, client receives)" msgid "-R, --reverse ....................run in reverse mode (server sends, client receives)"
msgstr "-R, --reverse ....................反向模式运行(服务器发送,客户端接收)" msgstr "-R, --reverse ....................反向模式运行(服务器发送,客户端接收)"
msgid "-c, --client <host> ..............run in client mode, connecting to <host>" msgid "-c, --client host ................run in client mode, connecting to host"
msgstr "-c, --client <host> ..............客户端模式下运行,连接到<host>" msgstr "-c, --client host ................客户端模式下运行连接到host"
msgid "-s, --server .....................run in server mode" msgid "-s, --server .....................run in server mode"
msgstr "-s, --server .....................服务器模式下运行" msgstr "-s, --server .....................服务器模式下运行"

View File

@ -64,8 +64,8 @@ msgstr "选择功能"
msgid "Execute selected functions" msgid "Execute selected functions"
msgstr "执行选择的功能" msgstr "执行选择的功能"
msgid "Test broadband version" msgid "client version selection"
msgstr "测试宽带版本" msgstr "客户端版本"
msgid "python3-speedtest-cli" msgid "python3-speedtest-cli"
msgstr "python3网络测试客户端" msgstr "python3网络测试客户端"
@ -129,7 +129,7 @@ msgid "Test failed"
msgstr "测试失败" msgstr "测试失败"
msgid "Waiting (executing)..." msgid "Waiting (executing)..."
msgstr "等待(执行)中" msgstr "努力执行中"
msgid "Server Port Delay Value" msgid "Server Port Delay Value"
msgstr "服务器端口延时值" msgstr "服务器端口延时值"
@ -152,8 +152,8 @@ msgstr "-P, --parallel ...<number>........多线程运行的数量"
msgid "-R, --reverse ....................run in reverse mode (server sends, client receives)" msgid "-R, --reverse ....................run in reverse mode (server sends, client receives)"
msgstr "-R, --reverse ....................反向模式运行(服务器发送,客户端接收)" msgstr "-R, --reverse ....................反向模式运行(服务器发送,客户端接收)"
msgid "-c, --client <host> ..............run in client mode, connecting to <host>" msgid "-c, --client host ................run in client mode, connecting to host"
msgstr "-c, --client <host> ..............客户端模式下运行,连接到<host>" msgstr "-c, --client host ................客户端模式下运行连接到host"
msgid "-s, --server .....................run in server mode" msgid "-s, --server .....................run in server mode"
msgstr "-s, --server .....................服务器模式下运行" msgstr "-s, --server .....................服务器模式下运行"

0
luci-app-netspeedtest/root/etc/init.d/netspeedtest Normal file → Executable file
View File

0
luci-app-netspeedtest/root/usr/bin/speedtest Normal file → Executable file
View File

View File

@ -1,17 +1,19 @@
# #
# Copyright (C) 2019-2023 The Sirpdboy Team <herboy2008@gmail.com> # Copyright (C) 2019-2024 The Sirpdboy Team <herboy2008@gmail.com>
# #
# This is free software, licensed under the Apache License, Version 2.0 . # This is free software, licensed under the Apache License, Version 2.0 .
# #
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
THEME_NAME:=kucat
LUCI_TITLE:=Kucat Theme THEME_TITLE:=Kucat Theme
PKG_NAME:=luci-theme-kucat PKG_NAME:=luci-theme-$(THEME_NAME)
LUCI_TITLE:=Kucat Theme by sirpdboy
LUCI_DEPENDS:= LUCI_DEPENDS:=
PKG_VERSION:=2.3.9 PKG_VERSION:=2.4.6
PKG_RELEASE:=20240305
define Package/luci-theme-kucat/postinst define Package/luci-theme-$(THEME_NAME)/postinst
#!/bin/sh #!/bin/sh
rm -Rf /var/luci-modulecache rm -Rf /var/luci-modulecache

View File

@ -1,4 +1,25 @@
 /*
* luci-theme-kucat
* Copyright (C) 2019-2024 The Sirpdboy Team <herboy2008@gmail.com>
*
* Have a bug? Please create an issue here on GitHub!
* https://github.com/sirpdboy/luci-theme-kucat/issues
*
* luci-theme-bootstrap:
* Copyright 2008 Steven Barth <steven@midlink.org>
* Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
* Copyright 2012 David Menting <david@nut-bolt.nl>
*
* luci-theme-material:
* https://github.com/LuttyYang/luci-theme-material/
* luci-theme-argon:
* https://github.com/jerrykuku/luci-theme-argon
* luci-theme-opentopd:
* https://github.com/sirpdboy/luci-theme-opentopd
*
* Licensed to the public under the Apache License 2.0
*/
body { body {
font-family: "Microsoft Yahei", "Google Sans", "WenQuanYi Micro Hei", "sans-serif", "Helvetica Neue", "Helvetica", "Hiragino Sans GB"!important font-family: "Microsoft Yahei", "Google Sans", "WenQuanYi Micro Hei", "sans-serif", "Helvetica Neue", "Helvetica", "Hiragino Sans GB"!important
} }
@ -357,8 +378,6 @@ button:hover,
.btn:hover, .btn:hover,
.cbi-button:hover, .cbi-button:hover,
.item:hover::after { .item:hover::after {
transform: scale(1.05) translate(0, -0.15rem);
box-shadow: 0 0.5rem 1rem rgba(255,255,255, 0.35); box-shadow: 0 0.5rem 1rem rgba(255,255,255, 0.35);
-webkit-box-shadow: 0 0 6px rgba(255,255,255, 0.35); -webkit-box-shadow: 0 0 6px rgba(255,255,255, 0.35);
-moz-box-shadow: 0 0 6px rgba(255,255,255, 0.35); -moz-box-shadow: 0 0 6px rgba(255,255,255, 0.35);
@ -368,8 +387,6 @@ button:hover,
.cbi-button:active , .cbi-button:active ,
button:active, button:active,
.item:hover::after { .item:hover::after {
transform: scale(1) translate(0, 0.15rem);
box-shadow: 0 0.5rem 1rem rgba(255,255,255, 0.15); box-shadow: 0 0.5rem 1rem rgba(255,255,255, 0.15);
-webkit-box-shadow: 0 0 6px rgba(255,255,255, 0.15); -webkit-box-shadow: 0 0 6px rgba(255,255,255, 0.15);
-moz-box-shadow: 0 0 6px rgba(255,255,255, 0.15); -moz-box-shadow: 0 0 6px rgba(255,255,255, 0.15);
@ -540,8 +557,6 @@ h3 {
.cbi-tabmenu li[class~="cbi-tab"] { .cbi-tabmenu li[class~="cbi-tab"] {
border-right: 0.18751rem solid #fd8c73; border-right: 0.18751rem solid #fd8c73;
border-left: 0.18751rem solid #fd8c73; border-left: 0.18751rem solid #fd8c73;
transform: scale(1) translate(0, 0.15rem);
box-shadow: 0 0.5rem 1rem rgba(255, 255, 255, 0.15); box-shadow: 0 0.5rem 1rem rgba(255, 255, 255, 0.15);
background-color: rgba(255, 255, 255, 0.2); background-color: rgba(255, 255, 255, 0.2);
} }
@ -593,9 +608,9 @@ h3 {
box-shadow: 0 0 1px rgba(255, 255, 255, 0.12); box-shadow: 0 0 1px rgba(255, 255, 255, 0.12);
} }
#syslog { #syslog {
color: #8391a2; color: #8391a2;
font-family: "Microsoft Yahei",-apple-system, "WenQuanYi Micro Hei", "sans-serif"; font-family: monospace;
background-color: rgba(0,0,0,0.1); background-color: rgba(0,0,0,0.1);
} }
.request>.requestBody, .request>.requestBody,
.response .markdown-body, .response .markdown-body,

View File

@ -1,20 +1,32 @@
/** /*
* kucat is a clean HTML5 theme for LuCI. It is based on luci-theme-material * luci-theme-kucat
* Copyright (C) 2019-2024 The Sirpdboy Team <herboy2008@gmail.com>
* *
* luci-theme-material * Have a bug? Please create an issue here on GitHub!
* Copyright 2015 Lutty Yang <lutty@wcan.in> * https://github.com/sirpdboy/luci-theme-kucat/issues
* *
* Copyright 2019-2023 sirpdboy <sirpdboy@qq.com> * luci-theme-bootstrap:
* Copyright 2008 Steven Barth <steven@midlink.org>
* Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
* Copyright 2012 David Menting <david@nut-bolt.nl>
*
* luci-theme-material:
* https://github.com/LuttyYang/luci-theme-material/
* luci-theme-argon:
* https://github.com/jerrykuku/luci-theme-argon
* luci-theme-opentopd:
* https://github.com/sirpdboy/luci-theme-opentopd
* *
* Licensed to the public under the Apache License 2.0 * Licensed to the public under the Apache License 2.0
*/ */
@font-face { @font-face {
font-family: 'sirpdboy-kucat'; font-family: 'kucat';
src: url('../fonts/sirpdboy-kucat.eot?9qz8zf'); src: url('../fonts/kucat.eot?9qz8zf');
src: url('../fonts/sirpdboy-kucat.eot?9qz8zf#iefix') format('embedded-opentype'), src: url('../fonts/kucat.eot?9qz8zf#iefix') format('embedded-opentype'),
url('../fonts/sirpdboy-kucat.ttf?9qz8zf') format('truetype'), url('../fonts/kucat.ttf?9qz8zf') format('truetype'),
url('../fonts/sirpdboy-kucat.woff?9qz8zf') format('woff'), url('../fonts/kucat.woff?9qz8zf') format('woff'),
url('../fonts/sirpdboy-kucat.svg?9qz8zf#sirpdboy-kucat') format('svg'); url('../fonts/kucat.svg?9qz8zf#kucat') format('svg');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
font-display: block; font-display: block;
@ -22,7 +34,7 @@
[class^="icon-"], [class*=" icon-"] { [class^="icon-"], [class*=" icon-"] {
/* use !important to prevent issues with browser extensions that change fonts */ /* use !important to prevent issues with browser extensions that change fonts */
font-family: 'sirpdboy-kucat' !important; font-family: 'kucat' !important;
speak: never; speak: never;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 887 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -1 +0,0 @@
https://www.github.com/sirpdboy/openwrt

View File

@ -1 +0,0 @@
做事先做人,尊重他人劳动成果,是为人的基本准则!

View File

@ -1,7 +0,0 @@
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="768" height="768" viewBox="0 0 768 768">
<title></title>
<g id="icomoon-ignore">
</g>
<path d="M154.573 302.973c22.405-63.323 68.309-111.537 124.518-138.38s122.572-32.193 185.864-9.789c36.054 12.768 67.062 33.075 90.683 57.151l86.032 80.863h-105.67c-16.78 0-30.4 13.619-30.4 30.4s13.619 30.4 30.4 30.4h182.308c0.152 0 0.274 0 0.425 0 4.165-0.031 8.147-0.943 11.734-2.493 3.617-1.55 6.962-3.83 9.85-6.84 0.364-0.395 0.73-0.79 1.094-1.186 2.28-2.645 4.043-5.564 5.259-8.664s1.946-6.415 2.098-9.91c0.031-0.456 0.031-0.881 0.031-1.307v-182.399c0-16.781-13.619-30.4-30.4-30.4s-30.4 13.619-30.4 30.4v112.145l-88.95-83.569c-30.156-30.704-69.038-56.027-113.786-71.865-79.13-27.998-162.183-21.25-232.345 12.221s-127.649 93.814-155.647 172.945c-5.624 15.808 2.675 33.166 18.483 38.79s33.196-2.675 38.79-18.514zM80.001 515.102l89.831 84.42c58.641 58.702 136.495 88.403 214.258 88.433s155.617-29.64 214.987-88.98c33.561-33.561 57.79-73.172 71.774-113.848 5.472-15.868-2.979-33.166-18.878-38.638s-33.166 2.979-38.638 18.878c-10.975 31.92-30.187 63.566-57.242 90.622-47.515 47.484-109.713 71.196-171.971 71.196s-124.457-23.773-172.64-71.926l-85.12-80.042h105.64c16.781 0 30.4-13.619 30.4-30.4s-13.619-30.4-30.4-30.4h-182.308c-0.151 0-0.274 0-0.425 0-4.165 0.031-8.147 0.943-11.734 2.493-3.617 1.55-6.961 3.83-9.85 6.84-0.364 0.395-0.73 0.791-1.094 1.186-2.28 2.644-4.043 5.563-5.259 8.664s-1.945 6.415-2.098 9.91c-0.031 0.456-0.031 0.881-0.031 1.307v182.399c0 16.78 13.619 30.4 30.4 30.4s30.4-13.619 30.4-30.4z"></path>
</svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

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

Before

Width:  |  Height:  |  Size: 413 B

File diff suppressed because one or more lines are too long

View File

@ -1,27 +0,0 @@
(function ($) {
// 修复某些插件导致在https下env(safe-area-inset-bottom)为0的情况
var url = self.location.href;
if ((/(iPhone|iPad|iPod|iOS|Mac|Macintosh)/i.test(navigator.userAgent)) && url.indexOf("openclash") != -1 ) {
var oMeta = document.createElement('meta');
oMeta.content = 'width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,viewport-fit=cover';
oMeta.name = 'viewport';
document.getElementsByTagName('head')[0].appendChild(oMeta);
}
})(jQuery);
function pdopenbar() {
document.getElementById("header-bar-left").style.width = "300px";
document.getElementById("header-bar-left").style.display = "block";
document.getElementById("header-bar-right").style.width = "0";
document.getElementById("header-bar-right").style.display = "none"
}
function pdclosebar() {
document.getElementById("header-bar-left").style.display = "none";
document.getElementById("header-bar-left").style.width = "0";
document.getElementById("header-bar-right").style.display = "block";
document.getElementById("header-bar-right").style.width = "50px"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,10 @@
<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
<g>
<title>Layer 1</title>
<path d="m51.5,53.8a6.6,6.6 0 1 0 0,13.2a6.6,6.6 0 0 0 0,-13.2m-40.5,-33.9l7,6.8a47.5,47.5 0 0 1 67.2,0l7,-6.8a57.2,57.2 0 0 0 -81.2,0" fill="#00ace2" id="svg_2"/>
<path d="m23.5,32.2l6.8,7a30,30 0 0 1 42.6,0l6.8,-7a39.7,39.7 0 0 0 -56.3,0" fill="#00ace2" id="svg_3"/>
<path d="m35.8,44.6l6.8,6.9a12.6,12.6 0 0 1 18,0l6.8,-6.9a22.3,22.3 0 0 0 -31.6,0" fill="#00ace2" id="svg_4"/>
<path d="m75.9,40.7a30.2,30.2 0 1 1 -48.7,0l-6.9,-7a39.9,39.9 0 1 0 62.5,0l-6.9,7z" fill="#002B49" id="svg_5"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 609 B

View File

@ -8,32 +8,7 @@
"prompt_message":"fast read Kucat", "prompt_message":"fast read Kucat",
"icons":[ "icons":[
{ {
"src":"img/logo16.png", "src":"img/apple-touch-icon.png",
"sizes":"16x16",
"type":"image/png"
},
{
"src":"img/logo32.png",
"sizes":"32x32",
"type":"image/png"
},
{
"src":"img/logo48.png",
"sizes":"48x48",
"type":"image/png"
},
{
"src":"img/logo64.png",
"sizes":"64x64",
"type":"image/png"
},
{
"src":"img/logo96.png",
"sizes":"96x96",
"type":"image/png"
},
{
"src":"img/applelogo144.png",
"sizes":"144x144", "sizes":"144x144",
"type":"image/png" "type":"image/png"
}, },

View File

@ -0,0 +1,41 @@
/*
* luci-theme-kucat
* Copyright (C) 2019-2024 The Sirpdboy Team <herboy2008@gmail.com>
*
* Have a bug? Please create an issue here on GitHub!
* https://github.com/sirpdboy/luci-theme-kucat/issues
*
* Licensed to the public under the Apache License 2.0
*/
// const isDark = localStorage.getItem("isDark");
// if (isDark == 1) {
// const element = document.querySelector("body");
// element.classList.add("dark");
// }
// const themetoggler = document.querySelector(".themetoggler");
// themetoggler.addEventListener(
// "click",
// function (e) {
// e.preventDefault();
// const element = document.querySelector("body");
// element.classList.toggle("dark");
// const isDark = localStorage.getItem("isDark");
// localStorage.setItem("isDark", isDark == 1 ? 0 : 1);
// },
// false
// );
function pdopenbar() {
document.getElementById("header-bar-left").style.width = "300px";
document.getElementById("header-bar-left").style.display = "block";
document.getElementById("header-bar-right").style.width = "0";
document.getElementById("header-bar-right").style.display = "none"
}
function pdclosebar() {
document.getElementById("header-bar-left").style.display = "none";
document.getElementById("header-bar-left").style.width = "0";
document.getElementById("header-bar-right").style.display = "block";
document.getElementById("header-bar-right").style.width = "50px"
}

View File

@ -1,7 +1,26 @@
/*
* luci-theme-kucat
* Copyright (C) 2019-2024 The Sirpdboy Team <herboy2008@gmail.com>
*
* Have a bug? Please create an issue here on GitHub!
* https://github.com/sirpdboy/luci-theme-kucat/issues
*
* luci-theme-bootstrap:
* Copyright 2008 Steven Barth <steven@midlink.org>
* Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
* Copyright 2012 David Menting <david@nut-bolt.nl>
*
* luci-theme-material:
* https://github.com/LuttyYang/luci-theme-material/
* luci-theme-opentopd:
* https://github.com/sirpdboy/luci-theme-opentopd
*
* Licensed to the public under the Apache License 2.0
*/
'use strict'; 'use strict';
'require baseclass'; 'require baseclass';
'require ui'; 'require ui';
return baseclass.extend({ return baseclass.extend({
__init__: function() { __init__: function() {
ui.menu.load().then(L.bind(this.render, this)); ui.menu.load().then(L.bind(this.render, this));
@ -41,31 +60,36 @@ return baseclass.extend({
}, },
handleMenuExpand: function(ev) { handleMenuExpand: function(ev) {
var a = ev.target, slide = a.parentNode, slide_menu = a.nextElementSibling; var a = ev.target, ul1 = a.parentNode, ul2 = a.nextElementSibling;
var collapse = false; var collapse = false;
document.querySelectorAll('.main .main-left .nav > li >ul.active').forEach(function (ul) { document.querySelectorAll('li.slide.active').forEach(function(li) {
$(ul).stop(true).slideUp("fast", function () { if (li !== a.parentNode || li == ul1) {
ul.classList.remove('active'); li.classList.remove('active');
ul.previousElementSibling.classList.remove('active'); li.childNodes[0].classList.remove('active');
}); }
if (!collapse && ul === slide_menu) { if (!collapse && li == ul1) {
collapse = true; collapse = true;
} }
}); });
if (!slide_menu) if (!ul2)
return; return;
if (ul2.parentNode.offsetLeft + ul2.offsetWidth <= ul1.offsetLeft + ul1.offsetWidth)
ul2.classList.add('align-left');
if (!collapse) { if (!collapse) {
$(slide).find(".slide-menu").slideDown("fast",function(){ ul1.classList.add('active');
slide_menu.classList.add('active'); a.classList.add('active');
a.classList.add('active');
});
a.blur();
} }
else
{
ul1.classList.remove('active');
a.classList.remove('active');
}
a.blur();
ev.preventDefault(); ev.preventDefault();
ev.stopPropagation(); ev.stopPropagation();
}, },

View File

@ -1,5 +1,5 @@
<%# <%#
Copyright 2019-2021 sirpdboy <sirpdboy@qq.com> Copyright (C) 2019-2024 The Sirpdboy Team <herboy2008@gmail.com>
luci-theme-material: luci-theme-material:
Copyright 2015 Lutty Yang <lutty@wcan.in> Copyright 2015 Lutty Yang <lutty@wcan.in>

View File

@ -1,5 +1,5 @@
<%# <%#
Copyright (C) 2019-2023 The Sirpdboy Team <herboy2008@gmail.com> Copyright (C) 2019-2024 The Sirpdboy Team <herboy2008@gmail.com>
luci-theme-material: luci-theme-material:
Copyright 2015 Lutty Yang <lutty@wcan.in> Copyright 2015 Lutty Yang <lutty@wcan.in>
luci-theme-bootstrap: luci-theme-bootstrap:
@ -44,27 +44,18 @@
http.prepare_content("text/html; charset=UTF-8") http.prepare_content("text/html; charset=UTF-8")
local theme_dir = resource .. "/background/"
if not fs.access("/www" .. resource .. "/background/") then
local theme_dir = media .. "/background/"
end
local bingUrl = "http://www.bing.com/"
local dark_css = fs.readfile('/www/luci-static/kucat/css/dark.css') local dark_css = fs.readfile('/www/luci-static/kucat/css/dark.css')
local bg_url = media.."/img/bg1.jpg" local bar='/cgi-bin/luci/admin/'
local bg_lock = bg_url
local bar="/cgi-bin/luci/admin/"
local mode = 'light' local mode = 'light'
local home = "overview" local home = ''
local user = "admin" local user = ''
local setbar = "1" local setbar = "1"
local bgqs = '1' local bgqs = '1'
local showword = sys.exec("cat /www/luci-static/kucat/img/logoword")
local showurl = sys.exec("cat /www/luci-static/kucat/img/logourl")
local ssr = "" local ssr = ""
local gohome = bar .. "status/" ..home local gohome = bar .. 'status/' ..home
local gouser = bar .. "system/" ..user local gouser = bar .. 'system/' ..user
local gossr = bar .. "services/" ..ssr local gossr = bar .. 'services/' ..ssr
local background = '0' local background = '0'
local fontd = '1.2rem' local fontd = '1.2rem'
local fontz = '0.92rem' local fontz = '0.92rem'
@ -76,134 +67,56 @@
local primary_rgbs_ts = '0.1' local primary_rgbs_ts = '0.1'
local primary_opacity = '0' local primary_opacity = '0'
local bkuse = '0' local bkuse = '0'
local bk_use='none' local bk_use='rgba(var(--primary-rgbbody),1)'
local loginbk_use = 'background: linear-gradient(0deg, rgba(var(--primary-rgbm), 1) 0%, rgba(var(--primary-rgbbody), 1) 100%)'
local bklock = '1' local bklock = '1'
local dayword = '0' local dayword = '0'
if fs.access('/etc/config/advancedplus') then local kucat = ''
primary_rgbbody = uci:get_first('advancedplus', 'basic', 'primary_rgbbody') if fs.access('/etc/config/advancedplus') then
primary_rgbm = uci:get_first('advancedplus', 'basic', 'primary_rgbm') kucat = 'advancedplus'
primary_rgbm_ts = uci:get_first('advancedplus', 'basic', 'primary_rgbm_ts') elseif fs.access('/etc/config/kucat') then
primary_opacity = uci:get_first('advancedplus', 'basic', 'primary_opacity') kucat = 'kucat'
primary_rgbs = uci:get_first('advancedplus', 'basic', 'primary_rgbs') end
primary_rgbs_ts = uci:get_first('advancedplus', 'basic', 'primary_rgbs_ts') if (kucat and kucat ~= '') then
mode = uci:get_first('advancedplus', 'basic', 'mode') primary_rgbbody = uci:get_first(kucat, 'basic', 'primary_rgbbody')
setbar = uci:get_first('advancedplus', 'basic', 'setbar') primary_rgbm = uci:get_first(kucat, 'basic', 'primary_rgbm')
home = uci:get_first('advancedplus', 'basic', 'gohome') primary_rgbm_ts = uci:get_first(kucat, 'basic', 'primary_rgbm_ts')
user = uci:get_first('advancedplus', 'basic', 'gouser') primary_opacity = uci:get_first(kucat, 'basic', 'primary_opacity')
ssr = uci:get_first('advancedplus', 'basic', 'gossr') primary_rgbs = uci:get_first(kucat, 'basic', 'primary_rgbs')
primary_rgbs_ts = uci:get_first(kucat, 'basic', 'primary_rgbs_ts')
mode = uci:get_first(kucat, 'basic', 'mode')
setbar = uci:get_first(kucat, 'basic', 'setbar')
home = uci:get_first(kucat, 'basic', 'gohome')
user = uci:get_first(kucat, 'basic', 'gouser')
ssr = uci:get_first(kucat, 'basic', 'gossr')
gohome = bar .. "status/" .. home gohome = bar .. "status/" .. home
gouser = bar .. "system/" .. user gouser = bar .. "system/" .. user
gossr = bar .. "services/" .. ssr gossr = bar .. "services/" .. ssr
background = uci:get_first('advancedplus', 'basic', 'background') background = uci:get_first(kucat, 'basic', 'background')
bkuse = uci:get_first('advancedplus', 'basic', 'bkuse') bkuse = uci:get_first(kucat, 'basic', 'bkuse')
bklock = uci:get_first('advancedplus', 'basic', 'bklock') bklock = uci:get_first(kucat, 'basic', 'bklock')
fontd = uci:get_first('advancedplus', 'basic', 'font_d') fontd = uci:get_first(kucat, 'basic', 'font_d')
fontz = uci:get_first('advancedplus', 'basic', 'font_z') fontz = uci:get_first(kucat, 'basic', 'font_z')
fontx = uci:get_first('advancedplus', 'basic', 'font_x') fontx = uci:get_first(kucat, 'basic', 'font_x')
bgqs = uci:get_first('advancedplus', 'basic', 'bgqs') bgqs = uci:get_first(kucat, 'basic', 'bgqs')
dayword = uci:get_first('advancedplus', 'basic', 'dayword') dayword = uci:get_first(kucat, 'basic', 'dayword')
end end
local primary_ufilter = "saturate(150%) contrast(50%) blur(" .. primary_opacity .. "px)" local primary_ufilter = "saturate(150%) contrast(50%) blur(" .. primary_opacity .. "px)"
if primary_opacity == '0' then if primary_opacity == '0' then
primary_ufilter = 'none' primary_ufilter = 'none'
end end
local bgqs_image = '-webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent)' local bgqs_image = '-webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent)'
local bgqs_color = 'rgba(var(--primary-rgbm),var(--primary-rgbm-ts))'
if bgqs == '1' then if bgqs == '1' then
bgqs_image = 'none' bgqs_image = 'rgba(var(--primary-rgbm),var(--primary-rgbm-ts))'
end end
local bg_url = media..'/img/bg1.jpg'
function downunsplashUrl() if background == '0' then
local check = 1
if fs.access('/tmp/kucatunsplash.tmp') then
local localtime = sys.exec("a=$(date +%Y%m%d) && cat /tmp/kucatunsplash.tmp | grep $a")
if localtime ~= '' then
check = 0
end
end
if check == 1 or not fs.access('/www/luci-static/kucat/img/down2.jpg') then
io.popen("(curl -k -L \"$(curl -s https://instant.unsplash.com | grep -oE '\"raw\":\".*?\",\"full\"'| grep -o 'https://.*,' | sed 's/\",//g' | awk -F '\"raw\"' '{printf $(NF)}' | sed 's/:\"//g')\&q=80\&w=1680\" -o /www/luci-static/kucat/img/down2.jpg >/dev/null 2>&1) &")
sys.exec("date +%Y%m%d > /tmp/kucatunsplash.tmp")
end
if fs.access('/www/luci-static/kucat/img/down2.jpg') then
bg_url = media .. "/img/down2.jpg"
end
end
function downbingUrl()
local check = 1
if fs.access('/tmp/kucatbing.tmp') then
local localtime = sys.exec("cat /tmp/kucatbing.tmp | grep `date +%Y%m%d`")
if localtime ~= '' then
check = 0
end
end
if check == 1 or not fs.access('/www/luci-static/kucat/img/down3.jpg') then
local dbing = sys.exec("curl -s 'http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=3&mkt=en-US'" )
if (dbing and dbing ~= '') then
bUrl = bingUrl .. json.parse(dbing).images[1].url
end
sys.exec("curl -kLfsm 5 -o /www/luci-static/kucat/img/down3.jpg '%s'" %bUrl)
sys.exec("date +%Y%m%d > /tmp/kucatbing.tmp")
end
if fs.access('/www/luci-static/kucat/img/down3.jpg') then
bg_url = media .. "/img/down3.jpg"
end
end
function downIcibaword()
local check = 1
if fs.access('/tmp/kucaticibaword.tmp') then
local localtime = sys.exec("cat /tmp/kucaticibaword.tmp | grep `date +%Y%m%d`")
if localtime ~= '' then
check = 0
end
end
if check == 1 or not fs.access('/tmp/showword.tmp') then
local localword = sys.exec("a=`curl -kLfsm 5 https://v1.hitokoto.cn | awk -F 'hitokoto\":\"' '{print $2}'| awk -F '\"' '{print $1}' ` && printf $a ")
if localword ~= '' then
sys.exec("a=`curl -kLfsm 5 https://v1.hitokoto.cn | awk -F 'hitokoto\":\"' '{print $2}'| awk -F '\"' '{print $1}' ` && echo -e $a >/tmp/showword.tmp")
sys.exec("date +%Y%m%d > /tmp/kucaticibaword.tmp")
end
end
if fs.access('/tmp/showword.tmp') then
localword = sys.exec("a=`cat /tmp/showword.tmp` && printf $a ")
if localword ~= '' then
showword = localword
end
end
end
function downbirdUrl()
local check = 1
if fs.access('/tmp/kucatbird.tmp') then
local localtime = sys.exec("cat /tmp/kucatbird.tmp | grep `date +%Y%m%d` ")
if localtime ~= '' then
check = 0
end
end
if check == 1 or not fs.access('/www/luci-static/kucat/img/down5.jpg') then
math.randomseed(tostring(os.time()):reverse():sub(1,9))
local j = math.random(1, 9)
local i = math.random(1, 400)
local bUrl = "http://wp.birdpaper.com.cn/intf/search?content=4k&pageno=" .. i .. "&count=9"
bUrl = sys.exec("curl -s '%s' | awk -F '\"count\":9' '{print $2}' | awk -F ',\"processTime\"' '{print $1}' | sed 's#,#{#' " %bUrl)
if (bUrl and bUrl ~= '') then
bUrl = "" .. json.parse(bUrl).list[j].url
end
io.popen("curl -kLfsm 3 -o /www/luci-static/kucat/img/down5.jpg '%s'" %bUrl )
sys.exec("date +%Y%m%d > /tmp/kucatbird.tmp")
end
if fs.access('/www/luci-static/kucat/img/down5.jpg') then
bg_url = media .. "/img/down5.jpg"
end
end
if ( background == "0" ) then
math.randomseed(os.time()) math.randomseed(os.time())
local theme_dir = resource .. '/background/'
if not fs.access('/www' .. resource .. '/background/') then
local theme_dir = media .. '/background/'
end
local bgcount = 0 local bgcount = 0
local currentBg = {} local currentBg = {}
local bgs,attr = {} local bgs,attr = {}
@ -222,19 +135,16 @@ if ( background == "0" ) then
end end
if bgcount > 0 then if bgcount > 0 then
currentBg = bgs[math.random(1,bgcount)] currentBg = bgs[math.random(1,bgcount)]
bg_url = currentBg.url picurl = currentBg.url
end end
elseif ( background == "2" ) then else
pcall(downunsplashUrl) picurl = sys.exec("/usr/libexec/kucat/kucat_wallpaper")
elseif background == "3" then end
pcall(downbingUrl) if (picurl and picurl ~= '') then
elseif background == "4" then bg_url = picurl
pcall(downbirdUrl) end
end local bg_lock = bg_url
if bklock == '0' then
if bklock == '1' then
bg_lock = bg_url
else
math.randomseed(os.time()) math.randomseed(os.time())
local bk_dir = media .. "/bg/" local bk_dir = media .. "/bg/"
local bkcount = 0 local bkcount = 0
@ -257,14 +167,15 @@ else
currentbk = bgs[math.random(1,bkcount)] currentbk = bgs[math.random(1,bkcount)]
bg_lock = currentbk.url bg_lock = currentbk.url
end end
end end
if dayword == '1' then if dayword == '1' then
pcall(downIcibaword) showword = sys.exec("/usr/libexec/kucat/kucat_word")
end end
if bkuse == '1' then if bkuse == '1' then
bk_use="url("..bg_lock..")" bk_use='url('..bg_lock..') no-repeat center center fixed'
end loginbk_use = "background-image:url(" .. bg_url .. ")"
%> end
-%>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<%=luci.i18n.context.lang%>"> <html lang="<%=luci.i18n.context.lang%>">
@ -280,26 +191,29 @@ end
<meta name="browsermode" content="application"> <meta name="browsermode" content="application">
<meta name="msapplication-tap-highlight" content="no"> <meta name="msapplication-tap-highlight" content="no">
<meta name="apple-mobile-web-app-status-bar-style" content="default" /> <meta name="apple-mobile-web-app-status-bar-style" content="default" />
<meta name="theme-color" media="(prefers-color-scheme: light)" content="white">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="black">
<meta name="application-name" content="<%=striptags( (boardinfo.hostname or "OpenWrt") ) %> - LuCI"> <meta name="application-name" content="<%=striptags( (boardinfo.hostname or "OpenWrt") ) %> - LuCI">
<meta name="apple-mobile-web-app-title" content="<%=striptags( (boardinfo.hostname or "OpenWrt") ) %> - LuCI"> <meta name="apple-mobile-web-app-title" content="<%=striptags( (boardinfo.hostname or "OpenWrt") ) %> - LuCI">
<meta name="msapplication-TileImage" content="<%=media%>/logo.png"/> <meta name="msapplication-TileImage" content="<%=media%>/logo.png"/>
<link rel="icon" type="image/png" sizes="192x192" href="<%=media%>/logo.png"> <link rel="icon" type="image/png" sizes="192x192" href="<%=media%>/logo.png">
<link rel="icon" href="<%=media%>/logo.svg" sizes="any">
<meta name="msapplication-TileColor" content="<%=bar_color%>"> <meta name="msapplication-TileColor" content="<%=bar_color%>">
<meta name="theme-color" content="<%=bar_color%>"> <meta name="theme-color" content="<%=bar_color%>">
<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="apple-touch-fullscreen" content="yes" /> <meta name="apple-touch-fullscreen" content="yes" />
<link rel="apple-touch-icon" sizes="180x180" href="<%=media%>/img/apple-touch-icon.png"> <link rel="apple-touch-icon" sizes="144x144" href="<%=media%>/img/apple-touch-icon.png">
<link rel="apple-touch-icon-precomposed" href="<%=media%>/img/applelogo144.png" sizes="144x144"> <link rel="apple-touch-icon-precomposed" href="<%=media%>/img/apple-touch-icon.png" sizes="144x144">
<link rel="stylesheet" href="<%=media%>/css/style.css?v=<%= ver.luciversion %>"> <link rel="stylesheet" href="<%=media%>/css/style.css?v=<%= ver.luciversion %>">
<script src="<%=media%>/js/jquery.min.js?v=3.5.1"></script> <meta name="theme-color" media="(prefers-color-scheme: light)" content="white">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="black">
<link rel="shortcut icon" href="<%=media%>/favicon.ico"> <link rel="shortcut icon" href="<%=media%>/favicon.ico">
<% if node and node.css then %>
<link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
<% end -%>
<style title="text/css"> <style title="text/css">
<% if mode == 'dark' then %> <% if css then %>
<%=dark_css%> <%= css %>
<% end -%> <% end -%>
:root { :root {
--primary-rgbbody:<%=primary_rgbbody%>; --primary-rgbbody:<%=primary_rgbbody%>;
@ -313,7 +227,6 @@ end
--font-x: <%=fontx%>; --font-x: <%=fontx%>;
--theme-background: <%=bk_use%>; --theme-background: <%=bk_use%>;
--bgqs-image: <%=bgqs_image%>; --bgqs-image: <%=bgqs_image%>;
--bgqs-color: <%=bgqs_color%>;
} }
<% if setbar == "1" then %> <% if setbar == "1" then %>
@ -336,25 +249,35 @@ end
} }
<% end -%> <% end -%>
</style> </style>
<% if node and node.css then %>
<link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
<% end -%>
<script src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script> <script src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
<script src="<%=resource%>/cbi.js"></script> <script src="<%=resource%>/cbi.js"></script>
<script src="<%=resource%>/luci.js?v=<%=ver.luciversion%>"></script> <script src="<%=resource%>/luci.js?v=<%=ver.luciversion%>"></script>
<% if css then %> <script src="<%=media%>/style.js"></script>
<style title="text/css">
<%= css %>
</style>
<% end -%>
</head> </head>
<body class="lang_<%=luci.i18n.context.lang%> <% if luci.dispatcher.context.authsession then %>logged-in<% end %> <% if not (path == "") then %>node-<%= path %><% else %>node-main-login<% end %>" data-page="<%= pcdata(path) %>"> <body class="lang_<%=luci.i18n.context.lang%> <% if luci.dispatcher.context.authsession then %>logged-in<% end %> <% if not (path == "") then %>node-<%= path %><% else %>node-main-login<% end %>" data-page="<%= pcdata(path) %>"
<% if mode ~= 'auto' then %>
data-theme = "<%= mode %>"
<% end -%>
>
<% if mode == 'auto' then %>
<script>
function setTheme() {
let color_scheme = window.matchMedia('(prefers-color-scheme: dark)');
document.body.setAttribute('data-theme', color_scheme.matches? 'dark': 'light');
}
setTheme();
window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', setTheme);
</script>
<% end -%>
<header class="bar-primary"> <header class="bar-primary">
<div id="header-bar-left" class="container-bar-left"> <div id="header-bar-left" class="container-bar-left">
<a class="labelbar pdboy-closebar" href="javascript:void(0)" onclick="pdclosebar()" title="Close" ></a> <a class="labelbar pdboy-closebar" href="javascript:void(0)" onclick="pdclosebar()" title="Close" ></a>
<a class="labelbar pdboy-gohome" href="<%=gohome%>" title="<%=home%>"></a> <a class="labelbar pdboy-gohome" href="<%=gohome%>" title="<%=Status%>"></a>
<a class="labelbar pdboy-goadvanced" href="<%=gouser%>" title="<%=user%>"></a> <a class="labelbar pdboy-goadvanced" href="<%=gouser%>" title="<%=System%>"></a>
<a class="labelbar pdboy-gossr" href="<%=gossr%>" title="<%=ssr%>"></a> <a class="labelbar pdboy-gossr" href="<%=gossr%>" title="<%=Services%>"></a>
<a class="labelbar pdboy-gonet" href="<%=url("admin/network/network")%>" title="<%:Network%>"></a> <a class="labelbar pdboy-gonet" href="<%=url("admin/network/network")%>" title="<%:Network%>"></a>
<a class="labelbar pdboy-gopoweroff" href="<%=url("admin/system/reboot")%>" title="<%:Reboot%>"></a> <a class="labelbar pdboy-gopoweroff" href="<%=url("admin/system/reboot")%>" title="<%:Reboot%>"></a>
</div> </div>
@ -380,11 +303,11 @@ end
<a class="brand" href="#"><%=striptags(boardinfo.hostname or "OpenWrt")%></a> <a class="brand" href="#"><%=striptags(boardinfo.hostname or "OpenWrt")%></a>
</div> </div>
<% if dayword == '1' then %> <% if dayword == '1' then %>
<a class="showWord" href="<%=showurl%>"><%=showword%></a> <a class="showWord" href="#"><%=showword%></a>
<% end -%> <% end -%>
<div class="status" id="indicators"></div> <div class="status" id="indicators"></div>
<span > <a class="pdboy-qlogout" href="<%=url("admin/logout")%>" title="<%:Logout%>" > </a></span> <span > <a class="pdboy-qlogout" href="<%=url("admin/logout")%>" title="<%:Log_out%>" > </a></span>
</div> </div>
</div> </div>
</header> </header>
@ -392,7 +315,7 @@ end
<ul id="modemenu"></ul> <ul id="modemenu"></ul>
</div> </div>
<div class="darkMask"></div> <div class="darkMask"></div>
<div class="login-bg" style="background-image:url(<%=bg_url%>)"></div> <div class="login-bg" style="<%=loginbk_use%>"></div>
<div id="maincontent"> <div id="maincontent">
<div class="container"> <div class="container">
<%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%> <%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
@ -409,4 +332,3 @@ end
</div> </div>
</noscript> </noscript>
<div id="tabmenu" style="display:none"></div> <div id="tabmenu" style="display:none"></div>
<script src="<%=media%>/js/style.js"></script>

View File

@ -0,0 +1,37 @@
#!/bin/sh
if [ "$PKG_UPGRADE" != 1 ]; then
uci get luci.themes.KuCat >/dev/null 2>&1 || \
uci batch <<-EOF
set luci.themes.KuCat=/luci-static/kucat
set luci.main.mediaurlbase=/luci-static/kucat
commit luci
EOF
fi
chmod +x /usr/libexec/kucat/kucat*
if [ ! -s "/etc/config/advancedplus" ];then
[ ! -s "/etc/config/kucat" ] && {
cat <<-EOF >/etc/config/kucat
config basic
option gossr ''
option gouser ''
option gohome ''
option bklock '1'
option fontmode '0'
option font_d '1.1rem'
option font_z '0.92rem'
option font_x '0.875rem'
option background '0'
option setbar '1'
option bkuse '0'
option mode 'auto'
option primary_rgbm_ts '0.8'
option primary_opacity '0'
option primary_rgbm '26,131,97'
option primary_rgbs '76,157,69'
option primary_rgbs_ts '0.2'
option primary_rgbbody '248,248,248'
EOF
}
fi
rm -rf /tmp/luci-*
exit 0

View File

@ -0,0 +1,83 @@
#!/bin/sh
# luci-theme-kucat
# Copyright (C) 2019-2024 The Sirpdboy Team <herboy2008@gmail.com>
#
# Have a bug? Please create an issue here on GitHub!
# https://github.com/sirpdboy/luci-theme-kucat/issues
#
# Licensed to the public under the Apache License 2.0
# author github@sirpdboy
kucat='kucat'
[ -s "/etc/config/advancedplus" ] &&kucat='advancedplus'
background="$(uci -q get $kucat.@basic[0].background || echo '0')"
KUCATTMP="/var/kucat_date_${background}.tmp"
BGURL="/www/luci-static/kucat/img/down${background}.jpg"
REBGURL="/luci-static/kucat/img/down${background}.jpg"
DFBGURL="/luci-static/kucat/img/bg1.jpg"
LOCK="/var/lock/kucat_lock_${background}.lock"
test_url() {
url=$1
local status=$(/usr/bin/curl -I -o /dev/null -skL --connect-timeout 1 --retry 1 -w %{http_code} "$url")
case "$status" in
204|\
200)
echo '1'
;;
esac
}
curl_bgurl() {
case "$background" in
1)
local ppath=`curl -s 'https://open.iciba.com/dsapi/' | jsonfilter -qe '@.picture4'`
[ -n "${ppath}" ] && echo "$ppath"
;;
2)
local ppath="$(curl -s "https://source.unsplash.com/1920x1080/daily?wallpapers" 2>&1 |grep -Eo "photo-\w+-\w+" | head -n1)"
[ -n "${ppath}" ] && echo "https://images.unsplash.com/${ppath}?fm=jpg&fit=crop&w=1920&h=1080"
;;
3)
local ppath=`curl -s "https://www.bing.com/HPImageArchive.aspx?format=js&n=1" |jsonfilter -qe '@.images[0].url'`
[ -n "${ppath}" ] && echo "https://www.bing.com${ppath}"
;;
4)
local i=`awk 'BEGIN{srand();print int(rand()*8)}'`
local j=`awk 'BEGIN{srand();print int(rand()*200)}'`
local ppath=`curl -s "http://wp.birdpaper.com.cn/intf/search?content=4k&pageno=$j&count=9" | awk -F '\"count\":9' '{print $2}' | awk -F ',\"processTime\"' '{print $1}' | sed 's#,#{#' | jsonfilter -e "@.list[$i].url"`
[ -n "${ppath}" ] && echo "$ppath"
;;
esac
}
bgurl_down() {
local bgurl="$(curl_bgurl)"
if [ -n "$bgurl" ]; then
rm -rf $BGURL
curl -kLfsm 3 $bgurl -o $BGURL
date +%Y%m%d > $KUCATTMP
fi
[ -s "$BGURL" ] && echo -ne $REBGURL || echo -ne $DFBGURL
}
check_url() {
if [ -s $KUCATTMP ]; then
localtime=`cat $KUCATTMP | grep $(date +%Y%m%d) `
if [ $localtime ]; then
if [ -s $BGURL ] ; then
echo -ne $REBGURL
return
fi
fi
fi
# local checknet=$(test_url "https://www.baidu.com")
checknet=`ping -c 1 -W 1 223.5.5.5 > /dev/null 2>&1 &&echo 1 || echo 2`
if [ "x$checknet" == "x1" ]; then
bgurl_down
else
[ -s "$DFBGURL" ] && echo -ne $DFBGURL
fi
}
check_url

View File

@ -0,0 +1,96 @@
#!/bin/sh
# luci-theme-kucat
# Copyright (C) 2019-2024 The Sirpdboy Team <herboy2008@gmail.com>
#
# Have a bug? Please create an issue here on GitHub!
# https://github.com/sirpdboy/luci-theme-kucat/issues
#
# Licensed to the public under the Apache License 2.0
LANG=`uci get luci.main.lang`
WORDDATETMP="/var/dayword_kucatword_date.tmp"
LOCK="/var/lock/dayword_kucatword.lock"
WORDTMP="/var/dayword_kucatword_$LANG.tmp"
test_url() {
url=$1
status="$(/usr/bin/curl -I -o /dev/null -skL --connect-timeout 1 --retry 1 -w %{http_code} "$url")"
case "$status" in
204|\
200)
echo '1'
;;
esac
}
get_word() {
kucat='kucat'
[ -s "/etc/config/advancedplus" ] &&kucat='advancedplus'
dayword="$(uci -q get $kucat.@basic[0].dayword || echo '0')"
case "$dayword" in
1)
[ "X$LANG" == "Xen" ] && gwordjson=`curl -s 'https://open.iciba.com/dsapi/' | jsonfilter -qe '@.content'` || gwordjson=`curl -s 'https://open.iciba.com/dsapi/' | jsonfilter -qe '@.note'`
[ -n "${gwordjson}" ] && echo "$gwordjson"
;;
2)
# form iciba : https://api.vvhan.com/api/en
[ "X$LANG" == "Xen" ] && gwordjson=`curl -s 'https://api.vvhan.com/api/en?type=sj'| jsonfilter -qe '@.data.zh'` || gwordjson=`curl -s 'https://api.vvhan.com/api/en?type=sj'| jsonfilter -qe '@.data.en'`
[ -n "${gwordjson}" ] && echo "$gwordjson"
;;
3)
local gwordjson=`curl -s 'https://api.yixiangzhilv.com/yiyan/sentence/get/'`
local gword=`echo $gwordjson | jsonfilter -qe '@.content'`
local gfrom=`echo $gwordjson | jsonfilter -qe '@.author'`
[ -n "${gfrom}" ] && gfrom=$(echo " ---- $gfrom")|| gfrom=''
[ -n "${gword}" ] && echo "$gword $gfrom"
;;
4)
local gwordjson=`curl -s 'https://yijuzhan.com/api/word.php?m=json'`
local gword=`echo $gwordjson | jsonfilter -qe '@.content'`
local gfrom=`echo $gwordjson | jsonfilter -qe '@.source'`
[ -n "${gfrom}" ] && gfrom=$(echo " ---- $gfrom")|| gfrom=''
[ -n "${gword}" ] && echo "$gword $gfrom"
;;
5)
local gword=`curl -s https://v.api.aa1.cn/api/api-wenan-dujitang/index.php?aa1=json | sed 's/\[//g' | sed 's/\]//g'| jsonfilter -qe '@.dujitang'`
[ -n "${gword}" ] && echo "$gword"
;;
*)
local gwordjson=`curl -s 'https://v1.hitokoto.cn'`
local gword=`echo $gwordjson | jsonfilter -qe '@.hitokoto'`
local gfrom=`echo $gwordjson | jsonfilter -qe '@.from_who'`
[ -n "${gfrom}" ] && gfrom=$(echo " ---- $gfrom")|| gfrom=''
[ -n "${gword}" ] && echo "$gword $gfrom"
;;
esac
}
kucatword() {
lock="$LOCK"
exec 200>"$lock"
if flock -n 200 >"/dev/null" 2>&1; then
local localword="$(get_word)"
if [ -n "$localword" ]; then
echo "$localword" >$WORDTMP
date +%Y%m%d > $WORDDATETMP
fi
flock -u 200 >"/dev/null" 2>&1
fi
[ -s "$WORDTMP" ] && cat $WORDTMP || echo -ne "Acquisition failed ,Please Issues:github@sirpdboy"
}
check_url() {
if [ -f "$WORDDATETMP" ]; then
localtime=`cat $WORDDATETMP | grep $(date +%Y%m%d) `
if [ $localtime ]; then
[ -s "$WORDTMP" ] && cat $WORDTMP && return
fi
fi
local checknet=`ping -c 1 -W 1 223.5.5.5 > /dev/null 2>&1 &&echo 1 || echo 2`
if [ "x$checknet" == "x1" ]; then
kucatword
else
echo -ne "No internet connection, no information."
fi
}
check_url