up kucat 1.5.6
5
Makefile
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2019-2023 sirpdboy
|
||||
# Copyright (C) 2019-2024 The Sirpdboy Team <herboy2008@gmail.com>
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
@ -11,7 +11,8 @@ THEME_TITLE:=Kucat Theme
|
||||
PKG_NAME:=luci-theme-$(THEME_NAME)
|
||||
LUCI_TITLE:=Kucat Theme by sirpdboy
|
||||
LUCI_DEPENDS:=
|
||||
PKG_VERSION:=1.4.9
|
||||
PKG_VERSION:=1.5.6
|
||||
PKG_RELEASE:=20240305
|
||||
|
||||
define Package/luci-theme-$(THEME_NAME)/postinst
|
||||
#!/bin/sh
|
||||
|
@ -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 {
|
||||
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,
|
||||
.cbi-button:hover,
|
||||
.item:hover::after {
|
||||
transform: scale(1.05) translate(0, -0.15rem);
|
||||
|
||||
box-shadow: 0 0.5rem 1rem 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);
|
||||
@ -368,8 +387,6 @@ button:hover,
|
||||
.cbi-button:active ,
|
||||
button:active,
|
||||
.item:hover::after {
|
||||
transform: scale(1) translate(0, 0.15rem);
|
||||
|
||||
box-shadow: 0 0.5rem 1rem 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);
|
||||
@ -540,8 +557,6 @@ h3 {
|
||||
.cbi-tabmenu li[class~="cbi-tab"] {
|
||||
border-right: 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);
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
@ -593,9 +608,9 @@ h3 {
|
||||
box-shadow: 0 0 1px rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
#syslog {
|
||||
color: #8391a2;
|
||||
font-family: "Microsoft Yahei",-apple-system, "WenQuanYi Micro Hei", "sans-serif";
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
color: #8391a2;
|
||||
font-family: monospace;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
}
|
||||
.request>.requestBody,
|
||||
.response .markdown-body,
|
||||
|
@ -1,11 +1,265 @@
|
||||
/**
|
||||
* 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
|
||||
* Copyright 2015 Lutty Yang <lutty@wcan.in>
|
||||
*
|
||||
* Copyright 2019-2023 sirpdboy <sirpdboy@qq.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
|
||||
*/
|
||||
@font-face{font-family:'sirpdboy-kucat';src:url('../fonts/sirpdboy-kucat.eot?9qz8zf');src:url('../fonts/sirpdboy-kucat.eot?9qz8zf#iefix') format('embedded-opentype'),url('../fonts/sirpdboy-kucat.ttf?9qz8zf') format('truetype'),url('../fonts/sirpdboy-kucat.woff?9qz8zf') format('woff'),url('../fonts/sirpdboy-kucat.svg?9qz8zf#sirpdboy-kucat') format('svg');font-weight:normal;font-style:normal;font-display:block}[class^="icon-"],[class*=" icon-"]{font-family:'sirpdboy-kucat' !important;speak:never;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-brightness_low:before{content:"\e926"}.icon-brightness_4:before{content:"\e92e"}.icon-sync_disabled:before{content:"\e932"}.icon-sync_problem:before{content:"\e933"}.icon-power_settings_new:before{content:"\e934"}.icon-logout:before{content:"\e935"}.icon-menu_open:before{content:"\e92f"}.icon-menu_open1:before{content:"\e930"}.icon-published_with_changes:before{content:"\e936"}.icon-update_disabled:before{content:"\e937"}.icon-arrow-left:before{content:"\e938"}.icon-arrow-right:before{content:"\e939"}.icon-chevrons-right:before{content:"\e931"}.icon-download:before{content:"\e904"}.icon-eye:before{content:"\e92b"}.icon-eye-off:before{content:"\e92c"}.icon-fast-forward:before{content:"\e93a"}.icon-gitlab:before{content:"\e93d"}.icon-heart:before{content:"\e927"}.icon-key:before{content:"\e93b"}.icon-message-square:before{content:"\e91f"}.icon-more-horizontal:before{content:"\e928"}.icon-navigation-2:before{content:"\e93e"}.icon-rewind:before{content:"\e921"}.icon-save:before{content:"\e923"}.icon-slash:before{content:"\e92d"}.icon-thumbs-up:before{content:"\e924"}.icon-twitch:before{content:"\e925"}.icon-unlock:before{content:"\e93c"}.icon-upload-cloud:before{content:"\e929"}.icon-user-plus:before{content:"\e92a"}.icon-airplay:before{content:"\e900"}.icon-align-justify:before{content:"\e922"}.icon-archive:before{content:"\e901"}.icon-box:before{content:"\e902"}.icon-chevron-down:before{content:"\e20b"}.icon-chevron-right:before{content:"\e920"}.icon-chevron-up:before{content:"\e20a"}.icon-chevrons-left:before{content:"\e903"}.icon-clock:before{content:"\e905"}.icon-codesandbox:before{content:"\e906"}.icon-database:before{content:"\e907"}.icon-download-cloud:before{content:"\e908"}.icon-gift:before{content:"\e909"}.icon-globe:before{content:"\e90a"}.icon-grid:before{content:"\e90b"}.icon-help-circle:before{content:"\f059"}.icon-home:before{content:"\e90c"}.icon-layers:before{content:"\e90d"}.icon-lock:before{content:"\e90e"}.icon-log-out:before{content:"\e90f"}.icon-menu:before{content:"\e20e"}.icon-minus-circle:before{content:"\e910"}.icon-monitor:before{content:"\e911"}.icon-moon:before{content:"\e912"}.icon-pie-chart:before{content:"\e913"}.icon-plus-circle:before{content:"\e914"}.icon-power:before{content:"\e915"}.icon-refresh-cw:before{content:"\e916"}.icon-send:before{content:"\e917"}.icon-server:before{content:"\e918"}.icon-settings:before{content:"\e919"}.icon-sliders:before{content:"\e91a"}.icon-sun:before{content:"\e91b"}.icon-tool:before{content:"\e91c"}.icon-user:before{content:"\e91d"}.icon-wifi:before{content:"\e91e"}.icon-spinner3:before{content:"\e602"}.icon-spinner6:before{content:"\e603"}.icon-github:before{content:"\eab0"}.icon-appleinc:before{content:"\eabe"}.icon-eye1:before{content:"\e9ce"}
|
||||
|
||||
@font-face {
|
||||
font-family: 'kucat';
|
||||
src: url('../fonts/kucat.eot?9qz8zf');
|
||||
src: url('../fonts/kucat.eot?9qz8zf#iefix') format('embedded-opentype'),
|
||||
url('../fonts/kucat.ttf?9qz8zf') format('truetype'),
|
||||
url('../fonts/kucat.woff?9qz8zf') format('woff'),
|
||||
url('../fonts/kucat.svg?9qz8zf#kucat') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
}
|
||||
|
||||
[class^="icon-"], [class*=" icon-"] {
|
||||
/* use !important to prevent issues with browser extensions that change fonts */
|
||||
font-family: 'kucat' !important;
|
||||
speak: never;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
|
||||
/* Better Font Rendering =========== */
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-brightness_low:before {
|
||||
content: "\e926";
|
||||
}
|
||||
.icon-brightness_4:before {
|
||||
content: "\e92e";
|
||||
}
|
||||
.icon-sync_disabled:before {
|
||||
content: "\e932";
|
||||
}
|
||||
.icon-sync_problem:before {
|
||||
content: "\e933";
|
||||
}
|
||||
.icon-power_settings_new:before {
|
||||
content: "\e934";
|
||||
}
|
||||
.icon-logout:before {
|
||||
content: "\e935";
|
||||
}
|
||||
.icon-menu_open:before {
|
||||
content: "\e92f";
|
||||
}
|
||||
.icon-menu_open1:before {
|
||||
content: "\e930";
|
||||
}
|
||||
.icon-published_with_changes:before {
|
||||
content: "\e936";
|
||||
}
|
||||
.icon-update_disabled:before {
|
||||
content: "\e937";
|
||||
}
|
||||
.icon-arrow-left:before {
|
||||
content: "\e938";
|
||||
}
|
||||
.icon-arrow-right:before {
|
||||
content: "\e939";
|
||||
}
|
||||
.icon-chevrons-right:before {
|
||||
content: "\e931";
|
||||
}
|
||||
.icon-download:before {
|
||||
content: "\e904";
|
||||
}
|
||||
.icon-eye:before {
|
||||
content: "\e92b";
|
||||
}
|
||||
.icon-eye-off:before {
|
||||
content: "\e92c";
|
||||
}
|
||||
.icon-fast-forward:before {
|
||||
content: "\e93a";
|
||||
}
|
||||
.icon-gitlab:before {
|
||||
content: "\e93d";
|
||||
}
|
||||
.icon-heart:before {
|
||||
content: "\e927";
|
||||
}
|
||||
.icon-key:before {
|
||||
content: "\e93b";
|
||||
}
|
||||
.icon-message-square:before {
|
||||
content: "\e91f";
|
||||
}
|
||||
.icon-more-horizontal:before {
|
||||
content: "\e928";
|
||||
}
|
||||
.icon-navigation-2:before {
|
||||
content: "\e93e";
|
||||
}
|
||||
.icon-rewind:before {
|
||||
content: "\e921";
|
||||
}
|
||||
.icon-save:before {
|
||||
content: "\e923";
|
||||
}
|
||||
.icon-slash:before {
|
||||
content: "\e92d";
|
||||
}
|
||||
.icon-thumbs-up:before {
|
||||
content: "\e924";
|
||||
}
|
||||
.icon-twitch:before {
|
||||
content: "\e925";
|
||||
}
|
||||
.icon-unlock:before {
|
||||
content: "\e93c";
|
||||
}
|
||||
.icon-upload-cloud:before {
|
||||
content: "\e929";
|
||||
}
|
||||
.icon-user-plus:before {
|
||||
content: "\e92a";
|
||||
}
|
||||
.icon-airplay:before {
|
||||
content: "\e900";
|
||||
}
|
||||
.icon-align-justify:before {
|
||||
content: "\e922";
|
||||
}
|
||||
.icon-archive:before {
|
||||
content: "\e901";
|
||||
}
|
||||
.icon-box:before {
|
||||
content: "\e902";
|
||||
}
|
||||
.icon-chevron-down:before {
|
||||
content: "\e20b";
|
||||
}
|
||||
.icon-chevron-right:before {
|
||||
content: "\e920";
|
||||
}
|
||||
.icon-chevron-up:before {
|
||||
content: "\e20a";
|
||||
}
|
||||
.icon-chevrons-left:before {
|
||||
content: "\e903";
|
||||
}
|
||||
.icon-clock:before {
|
||||
content: "\e905";
|
||||
}
|
||||
.icon-codesandbox:before {
|
||||
content: "\e906";
|
||||
}
|
||||
.icon-database:before {
|
||||
content: "\e907";
|
||||
}
|
||||
.icon-download-cloud:before {
|
||||
content: "\e908";
|
||||
}
|
||||
.icon-gift:before {
|
||||
content: "\e909";
|
||||
}
|
||||
.icon-globe:before {
|
||||
content: "\e90a";
|
||||
}
|
||||
.icon-grid:before {
|
||||
content: "\e90b";
|
||||
}
|
||||
.icon-help-circle:before {
|
||||
content: "\f059";
|
||||
}
|
||||
.icon-home:before {
|
||||
content: "\e90c";
|
||||
}
|
||||
.icon-layers:before {
|
||||
content: "\e90d";
|
||||
}
|
||||
.icon-lock:before {
|
||||
content: "\e90e";
|
||||
}
|
||||
.icon-log-out:before {
|
||||
content: "\e90f";
|
||||
}
|
||||
.icon-menu:before {
|
||||
content: "\e20e";
|
||||
}
|
||||
.icon-minus-circle:before {
|
||||
content: "\e910";
|
||||
}
|
||||
.icon-monitor:before {
|
||||
content: "\e911";
|
||||
}
|
||||
.icon-moon:before {
|
||||
content: "\e912";
|
||||
}
|
||||
.icon-pie-chart:before {
|
||||
content: "\e913";
|
||||
}
|
||||
.icon-plus-circle:before {
|
||||
content: "\e914";
|
||||
}
|
||||
.icon-power:before {
|
||||
content: "\e915";
|
||||
}
|
||||
.icon-refresh-cw:before {
|
||||
content: "\e916";
|
||||
}
|
||||
.icon-send:before {
|
||||
content: "\e917";
|
||||
}
|
||||
.icon-server:before {
|
||||
content: "\e918";
|
||||
}
|
||||
.icon-settings:before {
|
||||
content: "\e919";
|
||||
}
|
||||
.icon-sliders:before {
|
||||
content: "\e91a";
|
||||
}
|
||||
.icon-sun:before {
|
||||
content: "\e91b";
|
||||
}
|
||||
.icon-tool:before {
|
||||
content: "\e91c";
|
||||
}
|
||||
.icon-user:before {
|
||||
content: "\e91d";
|
||||
}
|
||||
.icon-wifi:before {
|
||||
content: "\e91e";
|
||||
}
|
||||
.icon-spinner3:before {
|
||||
content: "\e602";
|
||||
}
|
||||
.icon-spinner6:before {
|
||||
content: "\e603";
|
||||
}
|
||||
.icon-github:before {
|
||||
content: "\eab0";
|
||||
}
|
||||
.icon-appleinc:before {
|
||||
content: "\eabe";
|
||||
}
|
||||
.icon-eye1:before {
|
||||
content: "\e9ce";
|
||||
}
|
||||
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 15 KiB |
BIN
htdocs/luci-static/kucat/fonts/kucat.eot
Normal file
100
htdocs/luci-static/kucat/fonts/kucat.svg
Normal file
After Width: | Height: | Size: 76 KiB |
BIN
htdocs/luci-static/kucat/fonts/kucat.ttf
Normal file
BIN
htdocs/luci-static/kucat/fonts/kucat.woff
Normal file
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 13 KiB |
BIN
htdocs/luci-static/kucat/img/indo-wrt.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
157
htdocs/luci-static/kucat/js/menu-kucat.js
Normal file
@ -0,0 +1,157 @@
|
||||
/**
|
||||
* luci-theme-kucat
|
||||
* Copyright (C) 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-argon
|
||||
* Copyright 2023 Jerrykuku <jerrykuku@qq.com>
|
||||
*
|
||||
* luci-theme-material:
|
||||
* Copyright 2015 Lutty Yang
|
||||
*
|
||||
* luci-theme-bootstrap:
|
||||
* Copyright 2008 Steven Barth <steven@midlink.org>
|
||||
* Copyright 2008-2016 Jo-Philipp Wich <jow@openwrt.org>
|
||||
* Copyright 2012 David Menting <david@nut-bolt.nl>
|
||||
* MUI:
|
||||
* https://github.com/muicss/mui
|
||||
*
|
||||
* Licensed to the public under the Apache License 2.0
|
||||
*/
|
||||
|
||||
var lastNode = undefined;
|
||||
var mainNodeName = undefined;
|
||||
var nodeUrl = "";
|
||||
(function(node) {
|
||||
if (node[0] == "admin") {
|
||||
luciLocation = [node[1], node[2]]
|
||||
} else {
|
||||
luciLocation = node
|
||||
}
|
||||
for (var i in luciLocation) {
|
||||
nodeUrl += luciLocation[i];
|
||||
if (i != luciLocation.length - 1) {
|
||||
nodeUrl += "/";
|
||||
}
|
||||
}
|
||||
})(luciLocation);
|
||||
|
||||
|
||||
/**
|
||||
* get the current node by Burl (primary)
|
||||
* @returns {boolean} success?
|
||||
*/
|
||||
|
||||
function getCurrentNodeByUrl() {
|
||||
var ret = false;
|
||||
const urlReg = new RegExp(nodeUrl + "$")
|
||||
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);
|
||||
ulNode.next().find("a").each(function () {
|
||||
var that = $(this);
|
||||
var href = that.attr("href");
|
||||
if (urlReg.test(href)) {
|
||||
ulNode.click();
|
||||
ulNode.next(".slide-menu").stop(true, true);
|
||||
lastNode = that.parent();
|
||||
lastNode.addClass("active");
|
||||
ret = true;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
|
||||
$(".main > .main-left > .nav > .slide > .menu").click(function() {
|
||||
var ul = $(this).next(".slide-menu");
|
||||
var menu = $(this);
|
||||
if (!menu.hasClass("exit")) {
|
||||
$(".main > .main-left > .nav > .slide > .active").next(".slide-menu").stop(true).slideUp("fast");
|
||||
$(".main > .main-left > .nav > .slide > .menu").removeClass("active");
|
||||
if (!ul.is(":visible")) {
|
||||
menu.addClass("active");
|
||||
ul.addClass("active");
|
||||
ul.stop(true).slideDown("fast");
|
||||
} else {
|
||||
ul.stop(true).slideUp("fast", function() {
|
||||
menu.removeClass("active");
|
||||
ul.removeClass("active");
|
||||
});
|
||||
}
|
||||
return false
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* get current node and open it
|
||||
*/
|
||||
if (getCurrentNodeByUrl()) {
|
||||
mainNodeName = "node-" + luciLocation[0] + "-" + luciLocation[1];
|
||||
mainNodeName = mainNodeName.replace(/[ \t\n\r\/]+/g, "_").toLowerCase();
|
||||
$("body").addClass(mainNodeName);
|
||||
}
|
||||
|
||||
/**
|
||||
* hook menu click and add the hash
|
||||
*/
|
||||
$(".main > .main-left > .nav > .slide > .slide-menu > li > a").click(function() {
|
||||
if (lastNode != undefined)
|
||||
lastNode.removeClass("active");
|
||||
$(this).parent().addClass("active");
|
||||
$(".main > .loading").fadeIn("fast");
|
||||
return true
|
||||
});
|
||||
/**
|
||||
* fix menu click
|
||||
*/
|
||||
$(".main > .main-left > .nav > .slide > .slide-menu > li").click(function() {
|
||||
if (lastNode != undefined)
|
||||
lastNode.removeClass("active");
|
||||
$(this).addClass("active");
|
||||
$(".main > .loading").fadeIn("fast");
|
||||
window.location = $($(this).find("a")[0]).attr("href");
|
||||
return false
|
||||
});
|
||||
/**
|
||||
* fix submenu click
|
||||
*/
|
||||
$("#maincontent > .container > .tabs > li").click(function() {
|
||||
$(".main > .loading").fadeIn("fast");
|
||||
window.location = $($(this).find("a")[0]).attr("href");
|
||||
return false
|
||||
});
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
145
htdocs/luci-static/kucat/js/styles-kucat.js
Normal file
@ -0,0 +1,145 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Font generate by Icomoon<icomoon.io>
|
||||
*/
|
||||
(function ($) {
|
||||
$(".main > .loading").fadeOut();
|
||||
|
||||
/**
|
||||
* trim text, Remove spaces, wrap
|
||||
* @param text
|
||||
* @returns {string}
|
||||
*/
|
||||
function trimText(text) {
|
||||
return text.replace(/[ \t\n\r]+/g, " ");
|
||||
}
|
||||
|
||||
// define what element should be observed by the observer
|
||||
// and what types of mutations trigger the callback
|
||||
const observer = new MutationObserver(() => {
|
||||
console.log("callback that runs when observer is triggered");
|
||||
});
|
||||
if ($("#cbi-dhcp-lan-ignore").length > 0) {
|
||||
observer.observe(document.getElementById("cbi-dhcp-lan-ignore"), {
|
||||
subtree: true,
|
||||
attributes: true
|
||||
});
|
||||
}
|
||||
|
||||
$(".cbi-button-up").val("");
|
||||
$(".cbi-button-down").val("");
|
||||
|
||||
/**
|
||||
* hook other "A Label" and add hash to it.
|
||||
*/
|
||||
$("#maincontent > .container").find("a").each(function () {
|
||||
var that = $(this);
|
||||
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
|
||||
*/
|
||||
$("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("padding", "0px");
|
||||
}
|
||||
});
|
||||
|
||||
$(".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");
|
||||
|
||||
})(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"
|
||||
}
|
||||
|
||||
/**
|
||||
* Sidebar expand
|
||||
*/
|
||||
var showSide = false;
|
||||
$(".showSide").click(function () {
|
||||
if (showSide) {
|
||||
$(".darkMask").stop(true).fadeOut("fast");
|
||||
$(".main-left").width(0);
|
||||
$(".main-right").css("overflow-y", "auto");
|
||||
showSide = false;
|
||||
} else {
|
||||
$(".darkMask").stop(true).fadeIn("fast");
|
||||
$(".main-left").width("17rem");
|
||||
$(".main-right").css("overflow-y", "hidden");
|
||||
showSide = true;
|
||||
}
|
||||
});
|
||||
|
||||
$(".darkMask").click(function () {
|
||||
if (showSide) {
|
||||
showSide = false;
|
||||
$(".darkMask").stop(true).fadeOut("fast");
|
||||
$(".main-left").width(0);
|
||||
$(".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;
|
||||
}
|
||||
});
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 15 KiB |
10
htdocs/luci-static/kucat/logo.svg
Normal 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 |
@ -5,35 +5,10 @@
|
||||
"start_url":"/",
|
||||
"scope": "/",
|
||||
"orientation":"portrait",
|
||||
"prompt_message":"在主屏幕添加图标,以便快速访问 Kucat",
|
||||
"prompt_message":"fast read Kucat",
|
||||
"icons":[
|
||||
{
|
||||
"src":"img/logo16.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",
|
||||
"src":"img/apple-touch-icon.png",
|
||||
"sizes":"144x144",
|
||||
"type":"image/png"
|
||||
},
|
||||
|
@ -1,6 +1,5 @@
|
||||
<%#
|
||||
Copyright 2019-2021 sirpdboy <sirpdboy@qq.com>
|
||||
|
||||
Copyright (C) 2019-2024 The Sirpdboy Team <herboy2008@gmail.com>
|
||||
luci-theme-material:
|
||||
Copyright 2015 Lutty Yang <lutty@wcan.in>
|
||||
Licensed to the public under the Apache License 2.0
|
||||
@ -17,14 +16,16 @@
|
||||
</div>
|
||||
<footer class="mobile-hide">
|
||||
|
||||
<a class="luci-link" href="https://github.com/openwrt/luci">Powered by <%= ver.luciname %>
|
||||
<a class="luci-link" href="https://github.com/openwrt/luci" target="_blank">Powered by <%= ver.luciname %>
|
||||
(<%= ver.luciversion %>)</a> /
|
||||
<a href="https://github.com/sirpdboy/kucat" target="_blank">KuCatTheme <%# vPKG_VERSION %></a> /
|
||||
<a href="https://github.com/sirpdboy/luci-theme-kucat" target="_blank">KuCatTheme <%# vPKG_VERSION %></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>
|
||||
<% 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 %>
|
||||
@ -33,21 +34,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// thanks for Jo-Philipp Wich <jow@openwrt.org>
|
||||
var luciLocation = <%= luci.http.write_json(luci.dispatcher.context.path) %>;
|
||||
var winHeight = $(window).height();
|
||||
$(window).resize(function () {
|
||||
var winWidth = $(window).width()
|
||||
if(winWidth < 600){
|
||||
var newHeight = $(this).height();
|
||||
var keyboradHeight = newHeight - winHeight;
|
||||
$(".ftc").css("bottom", keyboradHeight + 30);
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="<%=media%>/js/script.js?v=<%=math.random(1,100000)%>"></script>
|
||||
<script src="<%=media%>/js/styles-kucat.js<%# ?v=PKG_VERSION %>"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<%#
|
||||
Copyright 2019-2023 sirpdboy <herboy2008@gmail.com>
|
||||
Copyright (C) 2019-2024 The Sirpdboy Team <herboy2008@gmail.com>
|
||||
luci-theme-material:
|
||||
Copyright 2015 Lutty Yang <lutty@wcan.in>
|
||||
luci-theme-bootstrap:
|
||||
@ -13,7 +13,6 @@
|
||||
-%>
|
||||
|
||||
<%
|
||||
local ver = require "luci.version"
|
||||
local sys = require "luci.sys"
|
||||
local util = require "luci.util"
|
||||
local http = require "luci.http"
|
||||
@ -23,7 +22,7 @@
|
||||
local nutil = require "nixio.util"
|
||||
local uci = require 'luci.model.uci'.cursor()
|
||||
local boardinfo = util.ubus("system", "board")
|
||||
local urlencode = luci.http.protocol and luci.http.protocol.urlencode or luci.util.urlencode
|
||||
|
||||
local request = disp.context.path
|
||||
local request2 = disp.context.request
|
||||
|
||||
@ -36,7 +35,6 @@
|
||||
local node = disp.context.dispatched
|
||||
|
||||
local categories = disp.node_childs(tree)
|
||||
local currentNode = luci.dispatcher.context.path
|
||||
local c = tree
|
||||
local i, r
|
||||
|
||||
@ -111,22 +109,17 @@
|
||||
end
|
||||
end
|
||||
|
||||
local function render_submenu(prefix,parent, node)
|
||||
local function render_submenu(prefix, node)
|
||||
local childs = disp.node_childs(node)
|
||||
if #childs > 0 then
|
||||
local active = (currentNode[2] == parent) and "active" or ""
|
||||
local display = (currentNode[2] == parent) and 'style="display: block;"' or ""
|
||||
|
||||
write('<ul class="slide-menu %s" %s>' %{
|
||||
active,
|
||||
display
|
||||
})
|
||||
write('<ul class="slide-menu">')
|
||||
|
||||
for i, r in ipairs(childs) do
|
||||
local nnode = node.nodes[r]
|
||||
local title = pcdata(striptags(translate(nnode.title)))
|
||||
local subactive = (currentNode[3] == r) and 'class="active"' or ""
|
||||
write('<li %s><a data-title="%s" href="%s">%s</a></li>' %{
|
||||
subactive,
|
||||
|
||||
write('<li><a data-title="%s" href="%s">%s</a></li>' %{
|
||||
title,
|
||||
nodeurl(prefix, r, nnode.query),
|
||||
title
|
||||
@ -147,16 +140,14 @@
|
||||
local grandchildren = disp.node_childs(nnode)
|
||||
|
||||
if #grandchildren > 0 then
|
||||
local active = (currentNode[2] == r) and "active" or ""
|
||||
local title = pcdata(striptags(translate(nnode.title)))
|
||||
local en_title = pcdata(striptags(string.gsub(nnode.title," ","_")))
|
||||
write('<li class="slide"><a class="menu %s" data-title="%s" href="#">%s</a>' %{
|
||||
active,
|
||||
write('<li class="slide"><a class="menu" data-title="%s" href="#">%s</a>' %{
|
||||
en_title,
|
||||
title
|
||||
})
|
||||
|
||||
render_submenu(category .. "/" .. r,r, nnode)
|
||||
render_submenu(category .. "/" .. r, nnode)
|
||||
write('</li>')
|
||||
else
|
||||
local title = pcdata(striptags(translate(nnode.title)))
|
||||
@ -194,28 +185,16 @@
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
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 bg_url = media.."/img/bg1.jpg"
|
||||
local bg_lock = bg_url
|
||||
local bar="/cgi-bin/luci/admin/"
|
||||
local bar='/cgi-bin/luci/admin/'
|
||||
local mode = 'light'
|
||||
local home = "overview"
|
||||
local user = "admin"
|
||||
local home = ''
|
||||
local user = ''
|
||||
local setbar = "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 gohome = bar .. "status/" ..home
|
||||
local gouser = bar .. "system/" ..user
|
||||
local gossr = bar .. "services/" ..ssr
|
||||
local ssr = ""
|
||||
local gohome = bar .. 'status/' ..home
|
||||
local gouser = bar .. 'system/' ..user
|
||||
local gossr = bar .. 'services/' ..ssr
|
||||
local background = '0'
|
||||
local fontd = '1.2rem'
|
||||
local fontz = '0.92rem'
|
||||
@ -227,133 +206,56 @@
|
||||
local primary_rgbs_ts = '0.1'
|
||||
local primary_opacity = '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 dayword = '0'
|
||||
if fs.access('/etc/config/advancedplus') then
|
||||
primary_rgbbody = uci:get_first('advancedplus', 'basic', 'primary_rgbbody')
|
||||
primary_rgbm = uci:get_first('advancedplus', 'basic', 'primary_rgbm')
|
||||
primary_rgbm_ts = uci:get_first('advancedplus', 'basic', 'primary_rgbm_ts')
|
||||
primary_opacity = uci:get_first('advancedplus', 'basic', 'primary_opacity')
|
||||
primary_rgbs = uci:get_first('advancedplus', 'basic', 'primary_rgbs')
|
||||
primary_rgbs_ts = uci:get_first('advancedplus', 'basic', 'primary_rgbs_ts')
|
||||
mode = uci:get_first('advancedplus', 'basic', 'mode')
|
||||
setbar = uci:get_first('advancedplus', 'basic', 'setbar')
|
||||
home = uci:get_first('advancedplus', 'basic', 'gohome')
|
||||
user = uci:get_first('advancedplus', 'basic', 'gouser')
|
||||
ssr = uci:get_first('advancedplus', 'basic', 'gossr')
|
||||
local kucat = ''
|
||||
if fs.access('/etc/config/advancedplus') then
|
||||
kucat = 'advancedplus'
|
||||
elseif fs.access('/etc/config/kucat') then
|
||||
kucat = 'kucat'
|
||||
end
|
||||
if (kucat and kucat ~= '') then
|
||||
primary_rgbbody = uci:get_first(kucat, 'basic', 'primary_rgbbody')
|
||||
primary_rgbm = uci:get_first(kucat, 'basic', 'primary_rgbm')
|
||||
primary_rgbm_ts = uci:get_first(kucat, 'basic', 'primary_rgbm_ts')
|
||||
primary_opacity = uci:get_first(kucat, 'basic', 'primary_opacity')
|
||||
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
|
||||
gouser = bar .. "system/" .. user
|
||||
gossr = bar .. "services/" .. ssr
|
||||
background = uci:get_first('advancedplus', 'basic', 'background')
|
||||
bkuse = uci:get_first('advancedplus', 'basic', 'bkuse')
|
||||
bklock = uci:get_first('advancedplus', 'basic', 'bklock')
|
||||
fontd = uci:get_first('advancedplus', 'basic', 'font_d')
|
||||
fontz = uci:get_first('advancedplus', 'basic', 'font_z')
|
||||
fontx = uci:get_first('advancedplus', 'basic', 'font_x')
|
||||
bgqs = uci:get_first('advancedplus', 'basic', 'bgqs')
|
||||
dayword = uci:get_first('advancedplus', 'basic', 'dayword')
|
||||
background = uci:get_first(kucat, 'basic', 'background')
|
||||
bkuse = uci:get_first(kucat, 'basic', 'bkuse')
|
||||
bklock = uci:get_first(kucat, 'basic', 'bklock')
|
||||
fontd = uci:get_first(kucat, 'basic', 'font_d')
|
||||
fontz = uci:get_first(kucat, 'basic', 'font_z')
|
||||
fontx = uci:get_first(kucat, 'basic', 'font_x')
|
||||
bgqs = uci:get_first(kucat, 'basic', 'bgqs')
|
||||
dayword = uci:get_first(kucat, 'basic', 'dayword')
|
||||
end
|
||||
local primary_ufilter = "saturate(150%) contrast(50%) blur(" .. primary_opacity .. "px)"
|
||||
if primary_opacity == '0' then
|
||||
primary_ufilter = 'none'
|
||||
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_color = 'rgba(var(--primary-rgbm),var(--primary-rgbm-ts))'
|
||||
if bgqs == '1' then
|
||||
bgqs_image = 'none'
|
||||
bgqs_image = 'rgba(var(--primary-rgbm),var(--primary-rgbm-ts))'
|
||||
end
|
||||
|
||||
function downunsplashUrl()
|
||||
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
|
||||
local bg_url = media..'/img/bg1.jpg'
|
||||
if background == '0' then
|
||||
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 currentBg = {}
|
||||
local bgs,attr = {}
|
||||
@ -372,19 +274,16 @@ if ( background == "0" ) then
|
||||
end
|
||||
if bgcount > 0 then
|
||||
currentBg = bgs[math.random(1,bgcount)]
|
||||
bg_url = currentBg.url
|
||||
picurl = currentBg.url
|
||||
end
|
||||
elseif ( background == "2" ) then
|
||||
pcall(downunsplashUrl)
|
||||
elseif background == "3" then
|
||||
pcall(downbingUrl)
|
||||
elseif background == "4" then
|
||||
pcall(downbirdUrl)
|
||||
end
|
||||
|
||||
if bklock == '1' then
|
||||
bg_lock = bg_url
|
||||
else
|
||||
else
|
||||
picurl = sys.exec("/usr/libexec/kucat/kucat_wallpaper")
|
||||
end
|
||||
if (picurl and picurl ~= '') then
|
||||
bg_url = picurl
|
||||
end
|
||||
local bg_lock = bg_url
|
||||
if bklock == '0' then
|
||||
math.randomseed(os.time())
|
||||
local bk_dir = media .. "/bg/"
|
||||
local bkcount = 0
|
||||
@ -407,55 +306,52 @@ else
|
||||
currentbk = bgs[math.random(1,bkcount)]
|
||||
bg_lock = currentbk.url
|
||||
end
|
||||
end
|
||||
if dayword == '1' then
|
||||
pcall(downIcibaword)
|
||||
end
|
||||
if bkuse == '1' then
|
||||
bk_use='url('..bg_lock..')'
|
||||
end
|
||||
%>
|
||||
end
|
||||
if dayword == '1' then
|
||||
showword = sys.exec("/usr/libexec/kucat/kucat_word")
|
||||
end
|
||||
if bkuse == '1' then
|
||||
bk_use='url('..bg_lock..') no-repeat center center fixed'
|
||||
loginbk_use = "background-image:url(" .. bg_url .. ")"
|
||||
end
|
||||
-%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="<%=luci.i18n.context.lang%>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
|
||||
<link rel="manifest" href="<%=media%>/manifest.json">
|
||||
<link rel="manifest" href="<%=media%>/manifest.json" crossorigin="use-credentials">
|
||||
|
||||
<title> <%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI</title>
|
||||
<meta name="format-detection" content="telephone=no, email=no" />
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<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="msapplication-tap-highlight" content="no">
|
||||
<meta name="msapplication-TileColor" content="<%=bar_color%>">
|
||||
<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 "?") ) %> - LuCI">
|
||||
<meta name="apple-mobile-web-app-title" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
|
||||
<meta name="msapplication-TileImage" content="<%=media%>/logo.png"/>
|
||||
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="<%=media%>/img/apple-touch-icon.png">
|
||||
<link rel="apple-touch-icon-precomposed" href="<%=media%>/img/apple-touch-icon.png" sizes="144x144">
|
||||
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="<%=media%>/logo.png">
|
||||
<meta name="msapplication-TileColor" content="<%=bar_color%>">
|
||||
<meta name="msapplication-TileImage" content="<%=media%>/logo.png"/>
|
||||
<meta name="theme-color" content="<%=bar_color%>">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<link rel="shortcut icon" href="<%=media%>/favicon.ico" type="image/x-icon">
|
||||
<link rel="icon" href="<%=media%>/logo.png" type="image/png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="<%=media%>/img/apple-touch-icon.png">
|
||||
<link rel="apple-touch-icon-precomposed" href="<%=media%>/img/applelogo144.png" sizes="144x144">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="<%=media%>/img/logo16.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="<%=media%>/img/logo32.png">
|
||||
<link rel="icon" type="image/png" sizes="48x48" href="<%=media%>/img/logo48.png">
|
||||
<link rel="icon" type="image/png" sizes="64x64" href="<%=media%>/img/logo64.png">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="<%=media%>/img/logo96.png">
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="<%=media%>/logo.png">
|
||||
<script src="<%=resource%>/cbi.js<%# ?v=PKG_VERSION %>"></script>
|
||||
<script src="<%=resource%>/xhr.js<%# ?v=PKG_VERSION %>"></script>
|
||||
<script src="<%=media%>/js/jquery.min.js<%# ?v=PKG_VERSION %>"></script>
|
||||
<link rel="icon" href="<%=media%>/logo.svg" sizes="any">
|
||||
<link rel="stylesheet" href="<%=media%>/css/style.css?v=<%=math.random(1,100000)%>">
|
||||
<style title="text/css">
|
||||
<% if mode == 'dark' then %>
|
||||
<%=dark_css%>
|
||||
<% end -%>
|
||||
|
||||
:root {
|
||||
--primary-rgbbody:<%=primary_rgbbody%>;
|
||||
--primary-rgbm: <%=primary_rgbm%>;
|
||||
@ -468,7 +364,6 @@ end
|
||||
--font-x: <%=fontx%>;
|
||||
--theme-background: <%=bk_use%>;
|
||||
--bgqs-image: <%=bgqs_image%>;
|
||||
--bgqs-color: <%=bgqs_color%>;
|
||||
}
|
||||
img[src*="/luci-static/resources/cbi/add.gif"] {
|
||||
background-image: url(<%=media%>/img/add.png);
|
||||
@ -499,23 +394,40 @@ end
|
||||
width: 50px;
|
||||
display: block;
|
||||
}
|
||||
<% end -%>
|
||||
<% if css then %>
|
||||
<%=css %>
|
||||
<% end -%>
|
||||
</style>
|
||||
<% 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="<%=resource%>/cbi.js<%# ?v=PKG_VERSION %>"></script>
|
||||
<script src="<%=resource%>/xhr.js<%# ?v=PKG_VERSION %>"></script>
|
||||
<script src="<%=media%>/js/jquery.min.js?v=3.5.1"></script>
|
||||
</head>
|
||||
<body class="lang_<%=luci.i18n.context.lang%> <%- if node then %> <%= striptags( node.title ) %><%- end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %> <%=mode %> ">
|
||||
<body
|
||||
class="<%- if node then %><%= striptags( node.title ) %><%- end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %> lang_<%=luci.i18n.context.lang%> "
|
||||
<% 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">
|
||||
<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-gohome" href="<%=gohome%>" title="<%=home%>"></a>
|
||||
<a class="labelbar pdboy-goadvanced" href="<%=gouser%>" title="<%=user%>"></a>
|
||||
<a class="labelbar pdboy-gossr" href="<%=gossr%>" title="<%=ssr%>"></a>
|
||||
<a class="labelbar pdboy-gohome" href="<%=gohome%>" title="<%=Status%>"></a>
|
||||
<a class="labelbar pdboy-goadvanced" href="<%=gouser%>" title="<%=System%>"></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-gopoweroff" href="<%=url("admin/system/reboot")%>" title="<%:Reboot%>"></a>
|
||||
</div>
|
||||
@ -541,7 +453,7 @@ end
|
||||
<a class="brand" href="#"><%=striptags(boardinfo.hostname or "OpenWrt")%></a>
|
||||
</div>
|
||||
<% if dayword == '1' then %>
|
||||
<a class="showWord" href="<%=showurl%>"><%=showword%></a>
|
||||
<a class="showWord" href="#"><%=showword%></a>
|
||||
<% end -%>
|
||||
<% render_changes() %>
|
||||
<span id="xhr_poll_status" style="display:none" onclick="XHR.running() ? XHR.halt() : XHR.run()">
|
||||
@ -554,14 +466,16 @@ end
|
||||
</div>
|
||||
</header>
|
||||
<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 class="container">
|
||||
<%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
|
||||
<div class="alert-message warning">
|
||||
<h4><%:No password set!%></h4>
|
||||
<p><%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%></p>
|
||||
<div class="right"><a class="btn" href="<%=url("admin/system/admin")%>"><%:Go to password configuration...%></a></div>
|
||||
<p><%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%>
|
||||
</p>
|
||||
<div class="right"><a class="btn"
|
||||
href="<%=url("admin/system/admin")%>"><%:Go to password configuration...%></a></div>
|
||||
</div>
|
||||
<%- end -%>
|
||||
|
||||
@ -571,5 +485,8 @@ end
|
||||
<p><%:You must enable JavaScript in your browser or LuCI will not work properly.%></p>
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<% if category then render_tabmenu(category, cattree) end %>
|
||||
<script>
|
||||
var luciLocation = <%= luci.http.write_json(luci.dispatcher.context.path) %>;
|
||||
</script>
|
||||
<script src="<%=media%>/js/menu-kucat.js<%# ?v=PKG_VERSION %>"></script>
|
||||
|
@ -1,10 +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
|
||||
|
71
root/usr/libexec/kucat/kucat_wallpaper
Normal file
@ -0,0 +1,71 @@
|
||||
#!/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"
|
||||
|
||||
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
|
||||
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
|
96
root/usr/libexec/kucat/kucat_word
Normal 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
|