v2.0.22-20230523

This commit is contained in:
MI15\Win
2023-05-23 19:57:48 +08:00
parent c24b348f30
commit d3a28db12d
25 changed files with 591 additions and 71 deletions

View File

@@ -40,7 +40,7 @@ define('libs',$global_config['Libs']);
define('SysVer',Get_Version());
define('Debug',$global_config['Debug'] == 1);
if($c != $global_config["Register"]){
if(!in_array($c,[$global_config["Register"],'ico','icon'])){
$u = Get('u');
if(empty($u) && $global_config['Sub_domain'] == 1 && is_subscribe('bool')){
$cut = explode('.',$_SERVER["HTTP_HOST"]);
@@ -72,7 +72,7 @@ if(empty($c) || $c == 'index'){
require "./system/Register.php";//注册
}elseif($c == $global_config['Login'] || $c == $USER_DB['Login']){
require "./system/login.php";//登陆
}elseif(in_array($c,['admin','click','api','ico','verify'])){
}elseif(in_array($c,['admin','click','api','ico','icon','verify'])){
require "./system/{$c}.php";
}elseif(in_array($c,['apply','guestbook'])){
if($global_config['Maintenance'] != 0){Amsg(-1,'网站正在进行维护,请稍后再试!');}

23
system/MySQL/20230522.php Normal file
View File

@@ -0,0 +1,23 @@
<?php if(!defined('DIR')){header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit;}
$sql ="
CREATE TABLE IF NOT EXISTS `global_icon` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`url_md5` varchar(32) NOT NULL COMMENT 'url_md5',
`url` text NOT NULL COMMENT 'url',
`ico_url` text NOT NULL COMMENT 'url_ico',
`add_time` int(10) UNSIGNED NOT NULL COMMENT '创建时间',
`update_time` int(10) UNSIGNED NOT NULL COMMENT '更新时间',
`file_name` text NOT NULL COMMENT '文件名',
`file_mime` text NOT NULL COMMENT 'MIME类型',
`extend` text NOT NULL COMMENT '预留扩展',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
INSERT INTO `purview_list` (`code`, `name`, `description`) VALUES
('icon_pull', '图标拉取', '允许用户拉取链接图标');
";
if(exe_sql($sql)){
insert_db('updatadb_logs',['file_name'=>$file_name,'update_time'=>time(),'status'=>'TRUE','extra'=>'']);
}else{
msg(-1,'数据库更新失败');
}

View File

@@ -0,0 +1,22 @@
<?php if(!defined('DIR')){header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit;}
$sql =<<<EOF
CREATE TABLE IF NOT EXISTS "global_icon" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"url_md5" text(32) NOT NULL DEFAULT "",
"url" text NOT NULL DEFAULT "",
"ico_url" text NOT NULL DEFAULT "",
"add_time" integer(10) NOT NULL,
"update_time" integer(10) NOT NULL,
"file_name" text NOT NULL DEFAULT "",
"file_mime" text NOT NULL DEFAULT "",
"extend" text NOT NULL DEFAULT "",
CONSTRAINT "id" UNIQUE ("id" ASC)
);
INSERT INTO `purview_list` (`code`, `name`, `description`) VALUES
('icon_pull', '图标拉取', '允许用户拉取链接图标');
EOF;
if(exe_sql($sql)){
insert_db('updatadb_logs',['file_name'=>$file_name,'update_time'=>time(),'status'=>'TRUE','extra'=>'']);
}else{
msg(-1,'数据库更新失败');
}

View File

@@ -330,6 +330,10 @@ if(!defined('DIR')){
deldir($temp_dir);
msg(-1,'tar文件效验失败');
}
//检查目录
if(!Check_Path(DIR."/data/backup/".U)){
msg(-1,'创建backup目录失败,请检查权限');
}
//复制到用户数据
try {
$backup_dir = DIR."/data/backup/".U."/";

View File

@@ -674,40 +674,40 @@ function write_link(){
if(empty($fid)){msg(-1,'分类ID错误');}
//加一个查找分类是否存在
update_db('user_links',['fid'=>$fid],['uid'=>UID ,"lid" => json_decode($_POST['lid']) ],[1,'设置成功']);
//图标拉取(不完善,未开放使用)
//图标拉取
}elseif($_GET['type'] === 'icon_pull'){
$link = get_db('user_links','url',['uid'=>UID,'lid'=>$_POST['id']]);
if($global_config['offline']){
msg(-1,"离线模式禁止下载主题!");
}
if(!is_subscribe('bool')){
msg(-1,"未检测到有效授权,无法使用该功能!");
}
if(!check_purview('icon_pull',1)){
msg(-1,'无权限');
}
$link = get_db('user_links','*',['uid'=>UID,'lid'=>$_POST['id']]);
if(empty($link)){
msg(-1,'请求的链接id不存在');
}
$s_site = unserialize(get_db("user_config","v",["k"=>"s_site","uid"=>UID]));
if(empty($s_site['link_icon']) || $s_site['link_icon'] == 0){
msg(-1,'站点设置链接图标不能是离线图标!请先修改配置!');
if(empty($_POST['cover']) && !empty($link['icon'])){
msg(1,'skip');//跳过存在图标的链接
}
$icon = $s_site['link_icon'];
if($icon ==2){
function base64($url){
$urls = parse_url($url);
$scheme = empty( $urls['scheme'] ) ? 'http://' : $urls['scheme'].'://'; //获取请求协议
$host = $urls['host']; //获取主机名
$port = empty( $urls['port'] ) ? '' : ':'.$urls['port']; //获取端口
$new_url = $scheme.$host.$port;
return base64_encode($new_url);
}
$api = 'https://favicon.rss.ink/v1/'.base64($link);
}elseif($icon ==4){
$api = 'https://api.15777.cn/get.php?url='.$link;
}elseif($icon ==5){
$api = 'https://favicon.cccyun.cc/'.$link;
}elseif($icon ==6){
$api = 'https://api.iowen.cn/favicon/'.parse_url($link)['host'].'.png';
}elseif($icon ==7){
$api = 'https://toolb.cn/favicon/'.parse_url($link)['host'];
$path = DIR ."/data/user/".U."/favicon";
if(!Check_Path($path)){
msg(-1,'创建目录失败,请检查权限');
}
if(downFile($api,$_POST['id'].'.ico',DIR ."/data/user/".U."/favicon/")){
update_db('user_links',['icon'=>"./data/user/".U.'/favicon/'.$_POST['id'].'.ico'],['uid'=>UID ,"lid" => $_POST['id'] ],[1,'获取成功']);
$api = Get_Index_URL().'?c=icon&url='.base64_encode($link['url']);
$res = ccurl($api);
$data = get_db('global_icon','*',['url_md5'=>md5($link['url'])]);
if(empty($data)){
msg(-1,'fail');
}
msg(-1,'获取失败');
$new_path = "./data/user/".U.'/favicon/'.$data['file_name'];
if(copy("./data/icon/{$data['file_name']}",$new_path)){
update_db('user_links',['icon'=>$new_path],['uid'=>UID ,"lid" => $_POST['id'] ],[1,'success']);
}
msg(-1,'fail');
}elseif($_GET['type'] == 'extend_list'){
if($GLOBALS['global_config']['link_extend'] != 1 ||!check_purview('link_extend',1)){
@@ -952,7 +952,7 @@ function write_site_setting(){
'description'=>['empty'=>true],
'link_model'=>['v'=>['direct','Privacy','Privacy_js','Privacy_meta','301','302','Transition'],'msg'=>'链接模式参数错误'],
'main_link_priority'=>['int'=>true,'min'=>0,'max'=>3,'msg'=>'主链优先参数错误'],
'link_icon'=>['int'=>true,'min'=>0,'max'=>10,'msg'=>'链接图标参数错误'],
'link_icon'=>['int'=>true,'min'=>0,'max'=>30,'msg'=>'链接图标参数错误'],
'site_icon'=>['empty'=>true],
'top_link'=>['int'=>true,'min'=>0,'max'=>20,'msg'=>'热门链接参数错误'],
'new_link'=>['int'=>true,'min'=>0,'max'=>20,'msg'=>'最新链接参数错误'],

View File

@@ -718,6 +718,11 @@ function other_root(){
$_POST['Subject'] = 'TwoNav 测试邮件' . time();
$_POST['Body'] = '<h1>TwoNav 测试邮件</h1>' . date('Y-m-d H:i:s');
send_email($_POST);
}elseif($_GET['type'] == 'write_icon_config'){
if($GLOBALS['global_config']['offline'] == '1'){msg(-1,"离线模式无法使用此功能");}
if(!is_subscribe('bool')){msg(-1,"未检测到有效授权,无法使用该功能!");}
write_global_config('icon_config',$_POST,'图标配置');
msg(1,'保存成功');
}
}

296
system/icon.php Normal file
View File

@@ -0,0 +1,296 @@
<?php
//读取配置
$config = unserialize( get_db("global_config", "v", ["k" => "icon_config"])) ?? [];
$config['analysis_timeout'] = (intval($config['analysis_timeout']) >= 3 && intval($config['analysis_timeout']) <= 20) ? intval($config['analysis_timeout']) : 6; //解析超时
$config['download_timeout'] = (intval($config['download_timeout']) >= 3 && intval($config['download_timeout']) <= 20) ? intval($config['download_timeout']) : 6; //下载超时
$config['icon_size'] = (intval($config['icon_size']) >= 5 && intval($config['icon_size']) <= 1024) ? intval($config['icon_size']) : 256; //大小限制
$favicon_url = '';
//防盗链
if($config['referer_test'] == 1){
if(empty($_SERVER['HTTP_REFERER']) || !strstr($_SERVER['HTTP_REFERER'],$_SERVER['HTTP_HOST'])){
header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit('404 Not Found');
}
}
//获取URL
$url = base64_decode($_GET['url']);
$url_md5 = md5($url);
//维护模式/离线模式/关闭服务 > 输出固定图标
if($global_config['Maintenance'] != 0 || $global_config['offline'] == '1' || $config['o_switch'] == '0' || !is_subscribe('bool')){
echo_link_type_icon();
}
//如果不是http(s)则根据类型输出固定图标
if(!preg_match("/^(http:\/\/|https:\/\/)/",$url)){
echo_link_type_icon();
}else{
$uri_part = parse_url($url);
$url_root = $uri_part['scheme'] . '://' . $uri_part['host'] . (isset($uri_part['port']) ? ':' . $uri_part['port'] : '');
}
//检查目录 > 不存在则自动创建 > 创建失败显示错误图标
if(!Check_Path(DIR.'/data/icon')){
echo_icon(DIR . '/templates/admin/img/error.svg',$config);
}
//读取缓存 > 存在且可用则输出
$cache_data = get_db('global_icon','*',['url_md5'=>$url_md5]);
if(!empty($cache_data) && $cache_data['update_time'] > time() - intval($config['server_cache_time']) && is_file(DIR . '/data/icon/' . $cache_data['file_name'])){
echo_icon(DIR . '/data/icon/' . $cache_data['file_name'],$config,$cache_data);
}
//缓存不可用
//获取URL的html内容
$html = get_html($url,$config['analysis_timeout']);
//获取html失败
if(empty($html)){
backup_api($url,$config); //调用备选接口
}
//html获取成功>尝试解析
try {
$doc = new DOMDocument();
@$doc->loadHTML($html);
$links = $doc->getElementsByTagName('link');
//后续可以考虑将所有声明的图标加入数组,然后按特定规则排序,实现多图标时获取较大尺寸的图标
foreach ($links as $link) {
if (in_array($link->getAttribute('rel'),['shortcut icon','icon','alternate icon','apple-touch-icon'])) {
$favicon_url = $link->getAttribute('href');
break;
}
}
}catch (Exception $e) {
//解析异常,不做处理!下面继续尝试其他方法获取!
}
//解析失败(可能是未设置图标)
if(empty($favicon_url)){
//尝试获取根目录的favicon.ico
$res = down_ico($url_root.'/favicon.ico','./data/icon/',$url,$config['download_timeout']);
if($res){
echo_icon(DIR . '/data/icon/'.$url_md5.".ico",$config);
}
//调用备选接口
backup_api($url,$config);
}
//解析到图标
$favicon_url = url_patch($favicon_url,$url);
//if 如果图标类型是base64或者svg则不需要下载
//匹配图标类型>下载>输出
$suffix = strtolower(end(explode('.',$favicon_url)));
$suffix = preg_match('/^(jpg|jpeg|png|ico|bmp|svg|webp)$/i',$suffix) ? $suffix : 'ico';
//下载图标 > 成功则输出
$res = down_ico($favicon_url,'./data/icon/',$url,$config['download_timeout']);
if($res){
echo_icon(DIR . '/data/icon/'.$url_md5.".$suffix",$config);
}else{
echo_link_type_icon();
}
//使用备用接口
function backup_api($url,$config){
global $uri_part,$url_root;
//未设置时直接输出ie图标
$backup_api = intval($config['backup_api']);
if($backup_api == 0){
echo_icon(DIR . '/templates/admin/img/ie.svg',$config);
}elseif($backup_api == 6){
$res = down_ico('https://api.iowen.cn/favicon/'.parse_url($url)['host'].'.png','./data/icon/','',$config['download_timeout']);
if($res){
echo_icon(DIR . '/data/icon/'.$GLOBALS['url_md5'].".png",$config);
}
}elseif($backup_api == 2){
$res = down_ico('https://favicon.png.pub/v1/'.base64_encode($url_root),'./data/icon/','',$config['download_timeout']);
if($res){
echo_icon(DIR . '/data/icon/'.$GLOBALS['url_md5'].".png",$config);
}
}
//如果都失败,则输出默认图标
echo_icon(DIR . '/templates/admin/img/ie.svg',$config);
}
//检测URL自动补全
function url_patch($favicon_url,$url){
global $uri_part,$url_root;
//包含协议表示URL完整,直接返回
if(strpos($favicon_url, '://')){
return $favicon_url;
}
//忽略协议的绝对路径
if(strpos($favicon_url, '//') === 0 ) {
return $uri_part['scheme'] . ':' . $favicon_url;
}
//位于根目录
if(strpos($favicon_url, '/') === 0 ){
return $url_root.$favicon_url;
}
//当前目录
if(strpos($favicon_url, './') === 0){
return $url_root . $uri_part['path'] . substr($favicon_url, 2);
}
//向上N级目录
if(strpos($favicon_url, '../') === 0){
$N = substr_count($favicon_url,'../');
$url_temp = $uri_part['path'];
for ($i = 0; $i < $N; $i++) {
$url_temp = dirname($url_temp);
$favicon_url = preg_replace('/^\.\.\//', '', $favicon_url);
}
return $url_root . $url_temp . $favicon_url;
}
//base64
//SVG
//默认路径
return $url_root . $uri_part['path'] . $favicon_url;
}
//获取html
function get_html($url,$TIMEOUT = 5){
try {
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $url);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_FAILONERROR, 1);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($c, CURLOPT_TIMEOUT, $TIMEOUT);
curl_setopt($c, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36');
$data = curl_exec($c);
//如果是gzip则解压
$prefix = dechex(ord($data[0])) . dechex(ord($data[1]));
if(strtolower($prefix) == '1f8b'){
$data = gzdecode($data);
}
curl_close($c);
return $data;
}catch (Exception $e) {
return false;
}
}
function down_ico($ico_url, $savePath = './data/temp/',$referer = '',$TIMEOUT = 60){
$suffix = strtolower(end(explode('.',$ico_url)));
if(!preg_match('/^(jpg|jpeg|png|ico|bmp|svg|webp)$/i',$suffix)){
$suffix = 'ico'; //没匹配到后缀名则默认为ico
}
$file = "{$GLOBALS['url_md5']}.{$suffix}";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $ico_url);
curl_setopt($c, CURLOPT_TIMEOUT, $TIMEOUT);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_HEADER, FALSE);
curl_setopt($c, CURLOPT_NOBODY, FALSE);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($c, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36');
if(!empty($referer)){
curl_setopt($c, CURLOPT_REFERER, $referer);
}
try{
$res = curl_exec($c);
}finally{
$code = curl_getinfo($c, CURLINFO_HTTP_CODE);
curl_close($c);
}
if ($code == '200') { //状态码正常
//十六进制取文件头
$prefix = strtolower( dechex(ord($res[0])) . dechex(ord($res[1])) );
//根据头判断类型
if($prefix == '1f8b'){ //gzip解码
$res = gzdecode($res);
}elseif( $prefix != '3c73' && strpos($prefix, '3c') === 0){ // <开头视为文本 <?开头是svg除外
return false;
}
//3c73>svg 3c21>html 1f8b>gzip
//文件大小限制
if((strlen($res) / 1024)> $GLOBALS['config']['icon_size']){
return false;
}
$fullName = rtrim($savePath, '/') . '/' . $file;
$type = ['jpg'=>'jpeg','jpeg'=>'jpeg','svg'=>'svg+xml','ico'=>'x-icon']; //类型表
$mime = $type[$suffix] ?? 'x-icon';
//黑名单(后期考虑使用在线名单缓存到本地,以便以更好的维护)
$_md5 = md5($res);
if($_md5 == 'c531ffbdad1ba93bd84f2398052958dc') return false; //阿里云
if($_md5 == '05231fb6b69aff47c3f35efe09c11ba0') return false; //一为默认
if($_md5 == '3ca64f83fdcf25135d87e08af65e68c9') return false; //小z默认
$data = ['update_time'=>time(),'file_name'=>$file,'file_mime'=>$mime,'ico_url'=>$ico_url,'extend'=>''];
if(!has_db('global_icon',['url_md5'=>$GLOBALS['url_md5']])){
$data['url_md5'] = $GLOBALS['url_md5'];
$data['url'] = $GLOBALS['url'];
$data['add_time'] = time();
insert_db('global_icon',$data);
}else{
update_db('global_icon',$data,['url_md5'=>$GLOBALS['url_md5']]);
}
return file_put_contents($fullName, $res);
}else{
return false;
}
}
function echo_icon($path,$config,$db = false){
//文件不存在时输出固定图标(理论上执行到这里不会出现文件不存在)
if(!is_file($path)){
echo_icon(DIR . '/templates/admin/img/ie.svg',$config);
}
//如果存在mime类型则直接读取,否则根据文件类型声明(从缓存读取时才会有mime)
if(empty($db['mime'])){
$suffix = strtolower(end(explode('.',$path))); //文件类型
$type = ['jpg'=>'jpeg','jpeg'=>'jpeg','svg'=>'svg+xml','ico'=>'x-icon']; //类型表
$mime = $type[$suffix] ?? 'x-icon';
}else{
$mime = $db['mime'];
}
//MIME类型
header("Content-Type: image/{$mime};text/html; charset=utf-8");
//缓存时间
$cache_time = intval($config['browse_cache_time']);
if($cache_time > 0 ){
header ("Last-Modified: " .gmdate("D, d M Y H:i:s", empty($db['mime']) ? filemtime($path):$db['mime'] )." GMT"); //更新时间
header("Expires: " .gmdate("D, d M Y H:i:s", time() + $cache_time)." GMT"); //过期时间 HTTP1.0
header("Cache-Control: public, max-age={$cache_time}"); //存活时间 HTTP1.1
}
//输出文件
exit(file_get_contents($path,true));
}
//根据链接类型输出图标
function echo_link_type_icon(){
global $config;$config['browse_cache_time'] = 60;
if(preg_match("/^(http:\/\/|https:\/\/)/",$GLOBALS['url'])){
echo_icon(DIR . '/templates/admin/img/ie.svg',$config);
}elseif(preg_match("/^(ftp:\/\/|ftps:\/\/|sftp:\/\/)/",$GLOBALS['url'])){
echo_icon(DIR . '/templates/admin/img/ftp.svg',$config);
}elseif(preg_match("/^magnet:?/",$GLOBALS['url'])){
echo_icon(DIR . '/templates/admin/img/magnet.svg',$config);
}elseif(preg_match("/^(tcp:\/\/|udp:\/\/|rtsp:\/\)/",$GLOBALS['url'])){
echo_icon(DIR . '/templates/admin/img/tcpudp.svg',$config);
}elseif(preg_match("/^thunder:\/\//",$GLOBALS['url'])){
echo_icon(DIR . '/templates/admin/img/xunlei.png',$config);
}else{
echo_icon(DIR . '/templates/admin/img/ie.svg',$config);
}
exit;
}

View File

@@ -536,17 +536,19 @@ function ccurl($url,$overtime = 3){
return $Res;
}
function downFile($url, $file = '', $savePath = './data/temp/'){
function downFile($url, $file = '', $savePath = './data/temp/',$referer = '',$TIMEOUT = 60){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 60); //超时/秒
curl_setopt($ch, CURLOPT_TIMEOUT, $TIMEOUT); //超时/秒
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //不直接输出
curl_setopt($ch, CURLOPT_HEADER, FALSE); //不需要response header
curl_setopt($ch, CURLOPT_NOBODY, FALSE); //需要response body
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); //允许重定向(适应网盘下载)
if(!empty($referer)){
curl_setopt($ch, CURLOPT_REFERER, $referer);
}
try{
$res = curl_exec($ch);
}finally{

View File

@@ -48,8 +48,10 @@ if(empty($c) || in_array($c,['index','click'])){
}
if ($site['link_icon'] == 'default'){
return($GLOBALS['libs'].'/Other/default.ico');
}elseif ($icon ==1){
return('./favicon/index2.php?url='.$link['real_url']);
}elseif ($icon ==20){
return('./index.php?c=icon&url='.base64_encode($link['real_url']));
}elseif ($icon ==21){
return('./ico/'.base64_encode($link['real_url']));
}elseif($icon ==2){
return('//favicon.png.pub/v1/'.base64($link['real_url']));
}elseif($icon ==4){

View File

@@ -1 +1 @@
v2.0.21-20230521
v2.0.22-20230523

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1684742765171" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8745" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M0 511.19a512 511.19 0 1 0 1024 0 512 511.19 0 1 0-1024 0z" fill="#FF3333" p-id="8746"></path><path d="M512.768 460.245l129.28-129.28a36.65 36.65 0 1 1 51.797 51.798l-129.28 129.28 129.579 129.536a36.565 36.565 0 0 1-51.755 51.712L512.853 563.755l-129.28 129.28a36.65 36.65 0 0 1-51.754-51.798l129.28-129.28L331.52 382.421a36.565 36.565 0 0 1 51.712-51.754l129.536 129.536z" fill="#FFFFFF" p-id="8747"></path></svg>

After

Width:  |  Height:  |  Size: 746 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1684722792069" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5418" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M748 183.5V0H96v1024h836V183.5z" fill="#68B2FC" p-id="5419"></path><path d="M932 184H748V0" fill="#86CAEF" p-id="5420"></path><path d="M331.5 344.9H391v315.7h-59.5V344.9z m26.1 258.3h100.7c13.6 0 24.1-3.3 31.6-9.9 7.5-6.6 11.2-15.8 11.2-27.7v-0.6c0-8-1.7-14.8-5-20.4-3.3-5.6-8.2-9.9-14.7-12.9-6.4-3-14.1-4.5-23.1-4.5H357.6v-57.3h100.7c12.3 0 21.8-3.1 28.5-9.3 6.7-6.2 10.1-15 10.1-26.3 0-10.1-3.4-18-10.1-23.7s-16.2-8.5-28.5-8.5H357.6v-57.3h102.7c20.4 0 37.8 3.4 52.3 10.1 14.5 6.7 25.5 16.5 33 29.3s11.3 28.2 11.3 46.1c0 12.3-2.4 23.2-7.3 32.7-4.9 9.5-11.9 17.3-21.2 23.3-9.3 6.1-20.4 10.2-33.4 12.4 13.9 1.9 25.8 6.1 35.7 12.7 9.9 6.6 17.4 15.2 22.6 25.7 5.1 10.6 7.7 22.8 7.7 36.7v0.7c0 18.1-3.8 33.6-11.4 46.5-7.6 12.9-18.7 22.7-33.2 29.4-14.5 6.7-32 10.1-52.4 10.1H357.6v-57.3zM596.8 435.2h110.3V486H596.8v-50.8z m37 211.4c-9.2-10.1-13.8-24.9-13.8-44.6V369.7h59.5v217.5c0 5.5 1.1 9.7 3.3 12.7 2.2 3 5.4 4.5 9.6 4.5h14.8v57.3h-30c-19.7-0.1-34.2-5.1-43.4-15.1z" fill="#FFFFFF" p-id="5421"></path></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1684722980058" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6352" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M575.829333 211.057778L458.296889 79.644444H79.644444v659.911112h864.711112V211.057778z m-140.856889-79.644445l70.656 79.644445H131.982222v-79.644445zM892.017778 687.217778H131.982222V263.395556h760.035556z" fill="#F5A333" p-id="6353"></path><path d="M485.831111 713.272889h52.337778v204.8h-52.337778z" fill="#F5A333" p-id="6354"></path><path d="M79.644444 838.542222h864.711112v52.337778H79.644444z" fill="#F5A333" p-id="6355"></path><path d="M273.521778 807.822222h456.362666v113.777778H273.521778zM240.298667 591.644444V371.712h150.755555v37.205333H284.444444v52.110223h91.818667v37.205333H284.444444V591.644444zM477.184 591.644444V408.917333H411.875556v-37.205333h174.762666v37.205333h-65.080889V591.644444zM615.310222 591.644444V371.712h71.224889A261.688889 261.688889 0 0 1 739.555556 375.466667a57.685333 57.685333 0 0 1 31.630222 21.504 68.266667 68.266667 0 0 1 12.743111 42.894222 72.021333 72.021333 0 0 1-7.281778 34.133333 61.44 61.44 0 0 1-18.659555 21.731556 64.967111 64.967111 0 0 1-22.755556 10.353778 247.239111 247.239111 0 0 1-45.511111 3.185777H659.911111V591.644444zM659.911111 408.917333v62.464h24.234667a111.616 111.616 0 0 0 35.157333-3.527111 28.103111 28.103111 0 0 0 13.880889-10.808889 29.809778 29.809778 0 0 0 5.006222-17.066666 28.672 28.672 0 0 0-7.054222-19.797334 30.606222 30.606222 0 0 0-17.863111-9.784889 227.555556 227.555556 0 0 0-31.971556-1.479111z" fill="#F5A333" p-id="6356"></path></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1684722468651" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3256" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M511.500488 512.499512m-511.500488 0a511.500488 511.500488 0 1 0 1023.000976 0 511.500488 511.500488 0 1 0-1023.000976 0Z" fill="#1BC1FA" p-id="3257"></path><path d="M627.84487 635.935969c46.679415-41.745233 105.950533-55.146146 147.110338-37.076792a271.239118 271.239118 0 0 0 8.025163-28.063595H606.727493c-5.224898 25.43616-22.521007 61.271165-78.893955 61.271165-87.284761 0-89.78432-86.027988-89.78432-86.027988h170.81319v0.175828h178.51367c1.582455-11.920359 2.675387-23.990572 2.675387-36.325526 0-121.298544-79.270587-223.983266-188.799625-259.353724 234.507988-164.407446 192.141362 66.50905 192.141362 66.509049 48.220909-132.993124-8.31488-194.503056-186.188176-98.074224-13.778544 7.448726-26.942689 15.198158-39.855079 23.074466-16.204176-3.002068-32.846923-4.77234-49.929241-4.772339-146.408023 0-265.546677 115.508199-272.003371 260.370731 81.419489-119.615188 220.491676-187.255134 220.491676-187.255133l0.138864 3.981112C370.74894 393.839391 306.249928 484.227122 259.750338 571.385007c-66.50905 124.665257-53.182064 234.409085-8.289905 264.315879 67.501081 44.992062 161.166611-11.480788 219.272867-57.351992 15.173182 2.637424 30.748972 4.169928 46.688405 4.169927 19.477979 0 38.468433-2.05799 56.780551-5.942197-12.501791-42.754248 7.480695-99.357971 53.642614-140.640655zM519.104062 382.698271c87.271774 0 89.759344 86.040976 89.759345 86.040976h-170.81319s-6.230915-86.040976 81.053845-86.040976zM286.366345 662.828706l2.687376-4.836277c37.481397 57.867489 96.190064 100.573783 165.161709 117.028714-278.421104 160.752016-167.849085-112.192437-167.849085-112.192437z" fill="#FFFFFF" p-id="3258"></path><path d="M774.955208 598.858178c-41.159805-18.069354-100.430923-4.668441-147.110338 37.076792-46.16192 41.282685-66.144406 97.886408-53.642614 140.640655 93.943259-19.92754 169.895087-88.292777 200.752952-177.717447z" fill="#FFFFFF" opacity=".4" p-id="3259"></path></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1684722857208" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6433" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M728.817346 446.041567L416.705043 758.091873c-41.55991 41.621907-109.244506 41.621907-150.804416 0-41.623907-41.55991-41.623907-109.244506 0-150.806415l312.046306-312.110303-165.927655-165.899657L99.968972 441.353803c-133.307296 133.307296-133.307296 349.392428 0 482.665725 133.307296 133.307296 349.422427 133.307296 482.665726 0l312.112303-312.048306-165.929655-165.929655z" fill="#DA4453" p-id="6434"></path><path d="M261.212863 280.111912l165.929655 165.929655 150.804415-150.868412-165.927655-165.897657z" fill="#CCD1D9" p-id="6435"></path><path d="M932.371108 438.479948a21.294929 21.294929 0 0 0 6.249686-15.12324c0-11.781407-9.561519-21.310928-21.310928-21.310928a21.352926 21.352926 0 0 0-15.12324 6.249686l-60.308967 60.308966a21.222933 21.222933 0 0 0-6.249685 15.091242c0 11.781407 9.561519 21.342927 21.310928 21.342926 5.937701 0 11.249434-2.405879 15.123239-6.281684l60.308967-60.276968zM1017.678818 528.945398a21.220933 21.220933 0 0 0-15.061243-6.249686h-85.307709a21.220933 21.220933 0 0 0-15.061243 6.249686c-8.375579 8.34358-8.375579 21.842901 0 30.154483 4.123793 4.187789 9.623516 6.249686 15.061243 6.249686h85.307709c5.437727 0 10.93745-2.061896 15.061243-6.249686 8.375579-8.311582 8.375579-21.810903 0-30.154483zM811.689178 322.953758c-8.311582-8.34358-21.810903-8.34358-30.122485 0-4.187789 4.155791-6.249686 9.623516-6.249686 15.093241v85.309709c0 5.437727 2.061896 10.93745 6.249686 15.061243a21.196934 21.196934 0 0 0 30.122485 0c4.187789-4.123793 6.249686-9.623516 6.249685-15.061243v-85.309709c0-5.469725-2.061896-10.93745-6.249685-15.093241z" fill="#AAB2BD" p-id="6436"></path><path d="M615.695035 121.741877a21.206933 21.206933 0 0 0 6.251685-15.061242c0-11.811406-9.563519-21.342927-21.374925-21.342927-5.875704 0-11.187437 2.405879-15.061242 6.249686v-0.031999l-60.308967 60.372964a21.148936 21.148936 0 0 0-6.249686 15.061243c0 11.781407 9.561519 21.342927 21.310929 21.342926 5.875704 0 11.249434-2.405879 15.061242-6.249685l60.370964-60.340966zM701.006744 212.239326a21.330927 21.330927 0 0 0-15.061242-6.249686h-85.30971c-5.499723 0-10.93745 2.093895-15.123239 6.249686-8.311582 8.34358-8.311582 21.842901 0 30.186482a21.366925 21.366925 0 0 0 15.123239 6.249685h85.30971c5.437727 0 10.875453-2.093895 15.061242-6.249685 8.311582-8.34358 8.311582-21.842901 0-30.186482zM495.015104 6.247686c-8.311582-8.313582-21.810903-8.313582-30.186482 0-4.123793 4.187789-6.249686 9.623516-6.249685 15.123239v85.245713c0 5.499723 2.123893 10.93745 6.249685 15.123239 8.375579 8.313582 21.8749 8.313582 30.186482 0a21.214933 21.214933 0 0 0 6.249686-15.093241V21.340927c0-5.467725-2.063896-10.905452-6.249686-15.093241z" fill="#AAB2BD" p-id="6437"></path><path d="M894.747001 611.971222l-165.929655-165.929655-150.870413 150.806416 165.931655 165.931655z" fill="#CCD1D9" p-id="6438"></path></svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1684724768873" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="20171" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M960 511.1c0-125.5-52-238.7-135.4-319.9-83.5-81.5-195.7-127.1-312.6-127-116.9-0.1-229.1 45.5-312.6 127.1-13.6 13.2-26.2 27.3-38.1 42.2-63 78.8-97.3 176.7-97.2 277.6 0 246.8 200.5 447 448 447 116.9 0.1 229.1-45.6 312.6-127.1 13.6-13.2 26.3-27.3 38.1-42.2C925.7 710 960 612 960 511.1zM405.6 128.9c-29.7 40.2-54.7 84.1-74.4 130.7-30.4-10.4-59.8-23.7-88-39.7 46.1-44.3 101.9-75.6 162.4-91zM345.3 480c2.7-49.7 12.8-97.4 29.5-142.3 34.1 7.4 69.3 12 105.3 13.6V480H345.3z m134.3 64.4v126.4c-35.3 1.5-70.4 6-104.9 13.3-17-45.1-26.9-92.1-29.5-139.8h134.4zM208 276.2c33 18.8 67.7 34.2 103.7 46.1-17.2 51-27.2 104.2-29.6 158.1H127.5c5.1-74.9 33.3-146.2 80.5-204.2z m0 470.9c-47.2-57.3-75.4-127.7-80.5-201.5H282c2.6 54.4 12.7 106.7 29.7 156.1-36 11.6-70.7 26.9-103.7 45.4z m35.2 57c28.2-16 57.6-29.3 88-39.7 19.7 46.6 44.7 90.5 74.4 130.7-60.5-15.5-116.3-46.8-162.4-91zM484 879.8c-35.1-40-64.4-84.7-87-132.9 28.7-6.1 57.8-10 87-11.5v144.4z m0-592.9c-29.3-1.5-58.4-5.4-87-11.5 22.6-48.2 51.9-92.9 87-132.9v144.4zM815.9 276c46.6 58.1 74.3 129.5 79.4 204.4H742.9c-2.4-53.9-12.3-107.2-29.3-158.3 35.5-11.8 69.7-27.3 102.3-46.1-0.1 0-0.1 0 0 0z m-34.3-56.4c-28 16-57.2 29.3-87.4 39.8-19.6-46.7-44.4-90.6-73.9-130.9 61.1 15.7 116.2 47.5 161.3 91.1zM544.1 479.9V351.3c35.4-1.6 70.6-6.1 105.1-13.6 17 45.8 26.9 93.7 29.5 142.2H544.1z m134.7 64.6c-2.6 47.6-12.5 94.6-29.5 139.6-34.5-7.3-69.7-11.8-105.1-13.3V544.5h134.6zM540 142.4c35.1 40 64.4 84.7 87 132.9-28.3 6-57.3 10-87 11.5V142.4z m0 593c29.7 1.6 58.7 5.5 87 11.5-22.6 48.2-51.8 92.9-87 132.9V735.4z m80.3 160.3c29.5-40.2 54.3-84.2 73.9-130.9 30.4 10.5 59.6 23.9 87.3 39.8-45.7 44.3-101.1 75.6-161.2 91.1z m195.5-148.2c-32.5-18.6-66.8-33.8-102.3-45.6 17-50.4 26.9-103 29.3-156.2h152.4c-5 74-32.8 144.5-79.4 201.8z" fill="#4AAF47" p-id="20172"></path></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -129,7 +129,7 @@ layui.define(['table', 'jquery', 'form'], function (exports) {
for (var j=0;j<checkedData.length;j++) {
if(res.data[i][opt.checkedKey] == checkedData[j][opt.checkedKey]){
res.data[i].LAY_CHECKED = true;
var index= res.data[i]['LAY_TABLE_INDEX'];
var index= res.data[i]['LAY_INDEX'];
var checkbox = $('#'+tableName+'').next().find('tr[data-index=' + index + '] input[type="checkbox"]');
checkbox.prop('checked', true).next().addClass('layui-form-checked');
var radio = $('#'+tableName+'').next().find('tr[data-index=' + index + '] input[type="radio"]');

View File

@@ -201,7 +201,8 @@ layui.use(['form','table','dropdown','miniTab'], function () {
var current = 0 ,fail = 0 ,INDEX = 0;
var testapi = get_api('other_testing_link');
var div = "div[lay-id='table'] .layui-table-main table tbody tr";
layer.load(2, {shade: [0.1,'#fff']});//加载层
layer.load(1, {shade: [0.5,'#fff']});//加载层
layer.msg('正在检测死链接中,请稍后...', {icon: 16,time: 1000*300});
$("#testing_tip").show();//显示进度提示
layer.close(open_index); //关闭小窗口
layer.tips("正在检测中,请勿操作页面...","#testing_tip",{tips: [3, "#3595CC"],time: 9000});
@@ -210,7 +211,7 @@ layui.use(['form','table','dropdown','miniTab'], function () {
//未勾选的跳过
if(trs[i].LAY_CHECKED != true){continue;}
$.post(testapi,{url:trs[i].url},function(re,status){
INDEX = trs[i].LAY_TABLE_INDEX; //行索引
INDEX = trs[i].LAY_INDEX; //行索引
if(re.StatusCode == 200 || re.StatusCode == 301 || re.StatusCode == 302 ){
$("div[lay-id='table'] td .layui-form-checkbox").eq(INDEX).click();//正常的取消勾选
if (re.StatusCode == 200){
@@ -249,27 +250,39 @@ layui.use(['form','table','dropdown','miniTab'], function () {
}
})
}else if(event === 'icon_pull'){
let i = 0;
let total = checkStatus.data.length;
layer.load(1, {shade:[0.3,'#fff']});//加载层
let msg_id = layer.msg('正在拉取中', {icon: 16,time: 1000*300});
icon_pull(i);
function icon_pull(id){
if(i >= total){
layer.closeAll();
layer.alert('拉取完毕',{icon:1,title:'信息',anim: 2,shadeClose: false,closeBtn: 0});
return true;
}
$("#layui-layer"+ msg_id+" .layui-layer-padding").html('<i class="layui-layer-ico layui-layer-ico16"></i>[ ' + i + ' / ' + total + ' ] 正在拉取图标');
$.post(get_api('write_link','icon_pull'),{id:checkStatus.data[i].lid},function(data,status){
if(data.code == 1){
layer.alert('存在链接图标时如何处理 ?', {icon: 3, title:'请选择',btn: ['保持原样', '重新拉取', '取消'],
btnAlign: 'c',
btn1: function(){icon_pull_test('0')}, //跳过
btn2: function(){icon_pull_test('1')} //覆盖
});
function icon_pull_test(cover){
let i = 0;
let success = 0;
let skip = 0;
let fail = 0;
let total = checkStatus.data.length;
layer.load(1, {shade:[0.5,'#fff']});//加载层
let msg_id = layer.msg('正在拉取中', {icon: 16,time: 1000*300});
icon_pull(i);
function icon_pull(id){
if(i >= total){
layer.closeAll();
layer.alert('总计:' + total +',成功:' + success + ',失败:'+ fail + (skip > 0 ? (',跳过:' + skip):'' ),{icon:1,title:'信息',anim: 2,shadeClose: false,closeBtn: 0});
return true;
}
$("#layui-layer"+ msg_id+" .layui-layer-padding").html('<i class="layui-layer-face layui-icon layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop"></i>[ ' + i + ' / ' + total + ' ] 正在拉取图标');
$.post(get_api('write_link','icon_pull'),{id:checkStatus.data[i].lid,cover:cover},function(data,status){
if(data.msg == 'success'){
success ++;
}else if(data.msg == 'fail'){
fail ++;
}else if(data.msg == 'skip'){
skip ++;
}
i ++;
icon_pull(i);
} else{
layer.closeAll();
layer.alert(data.msg,{icon:5,title:'信息',anim: 2,shadeClose: false,closeBtn: 0});
}
});
});
}
}
}else if(event === 'link_extend'){
extend_data = '';
@@ -468,7 +481,7 @@ layui.use(['form','table','dropdown','miniTab'], function () {
var tableBak = table.cache.link_extend_list;
for (var i = 0; i < tableBak.length; i++) {
//过滤掉被删除的空数据
if(typeof tableBak[i].LAY_TABLE_INDEX == 'number'){
if(typeof tableBak[i].LAY_INDEX == 'number'){
data.push(tableBak[i]);
}
}

View File

@@ -70,7 +70,8 @@
<div class="layui-input-inline" >
<select name="link_icon">
<option value="0" selected>离线图标</option>
<!--<option value="1" >本地服务(支持缓存)</option>-->
<option value="20" >本地服务</option>
<option value="21" >本地服务(伪静态)</option>
<option value="2" >favicon.png.pub (小图标)</option>
<option value="4" >api.15777.cn</option>
<option value="5" >favicon.cccyun.cc</option>

View File

@@ -110,7 +110,8 @@
<button class="layui-btn layui-btn-disabled" lay-submit lay-filter="imp_link">开始导入</button>
</div>
</form>
<?php if(!preg_match('/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i',$_SERVER['HTTP_USER_AGENT'])){ ?>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;"><legend>一键添加</legend></fieldset>
<blockquote class="layui-elem-quote" style="margin-top: 10px;border-left: 5px solid #5FB878; color: #333;">1.按需选择参数 > 将下方蓝色的「一键添加」拖拽到浏览器书签栏(收藏夹)<br />2.点击书签栏中的一键添加,即可将正在浏览的页面快速添加到TwoNav</blockquote>
<form class="layui-form layui-form-pane" id="one">
@@ -163,6 +164,7 @@
<a class="layui-btn layui-btn-primary layui-border-blue" style="cursor:pointer;color: #1e9fff;" title="将此链接拖拽到书签栏" id="one-click-add" href=''>一键添加</a>
</div>
</form>
<?php }?>
<!--书签导出-->
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;"><legend>书签导出</legend></fieldset>
<blockquote class="layui-elem-quote" style="margin-top: 30px;">
@@ -226,13 +228,13 @@
</blockquote>
<div class="layui-form-item">
<div class="layui-input-block" style="margin-left: 32px;">
<input type="checkbox" name="TABLE[user_categorys]" title="分类" checked="">
<input type="checkbox" name="TABLE[user_links]" title="链接" checked="">
<input type="checkbox" name="TABLE[user_pwd_group]" title="加密" checked="">
<input type="checkbox" name="TABLE[user_share]" title="分享" checked="">
<input type="checkbox" name="TABLE[user_apply]" title="收录" checked="">
<input type="checkbox" name="FILE[MessageBoard]" title="留言" checked="">
<input type="checkbox" name="FILE[favicon]" title="图标" checked="">
<input type="checkbox" name="TABLE[user_categorys]" title="分类" checked>
<input type="checkbox" name="TABLE[user_links]" title="链接" checked>
<input type="checkbox" name="TABLE[user_pwd_group]" title="加密" checked>
<input type="checkbox" name="TABLE[user_share]" title="分享" checked>
<input type="checkbox" name="TABLE[user_apply]" title="收录" checked>
<input type="checkbox" name="FILE[MessageBoard]" title="留言" checked>
<input type="checkbox" name="FILE[favicon]" title="图标" checked>
</div>
</div>
<div class="layui-form-item">
@@ -386,7 +388,7 @@ layui.use(['layer','element','upload','form','table'], function(){
//数据清空>弹窗
$('#data_empty').on('click', function(){
index = layer.open({type: 1,scrollbar: false,shadeClose: true,title: '数据清空',area : ['500px', '300px'],content: $('.data_empty')});
index = layer.open({type: 1,scrollbar: false,shadeClose: true,title: '数据清空',area : ['auto', '300px'],content: $('.data_empty')});
});
//数据清空>确定
form.on('submit(define_data_empty)', function(data){
@@ -465,7 +467,7 @@ layui.use(['layer','element','upload','form','table'], function(){
,response: {statusCode: 1 }
,cols: [[
{width:60, type:'numbers', title: '序号'}
,{field:'name', title:'数据库文件名 / 备注',templet:function(d){
,{field:'name', title:'数据库文件名 / 备注',minWidth:400,templet:function(d){
if(d.desc != '' && d.desc != null){
return d.name + '&emsp;&emsp;[&nbsp;' + d.desc+'&nbsp;]';
}else{
@@ -475,7 +477,7 @@ layui.use(['layer','element','upload','form','table'], function(){
,{ width:180, title: '备份时间',templet:function(d){
return timestampToTime(d.backup_time);
}}
,{field:'size', width:80, title: '大小',templet:function(d){return bytesToSize(d.db_size + d.tar_size);}}
,{field:'size', width:100, title: '大小',templet:function(d){return bytesToSize(d.db_size + d.tar_size);}}
,{width:70, title: '分类',templet:function(d){return d.user_categorys.count;}}
,{width:80, title: '链接',templet:function(d){return d.user_links.count;}}
,{width:160, title:'操作', toolbar: '#tooloption'}

View File

@@ -74,6 +74,7 @@
<?php }?>
<?php if($global_config['offline'] != 1 ){ ?>
<button class="layui-btn layui-btn-sm layui-btn-normal layui-btn-danger layui-hide-xs" lay-event="testing" id="testing">检测</button>
<button class="layui-btn layui-btn-sm layui-btn-normal layui-btn-danger layui-hide-xs" lay-event="icon_pull" id="icon_pull">图标拉取</button>
<?php }?>
<button class="layui-btn layui-btn-sm layui-btn-normal layui-btn-danger" layuimini-content-href="link_sort" data-title="链接排序">排序模式</button>
</div>

View File

@@ -0,0 +1,125 @@
<?php
if($USER_DB['UserGroup'] != 'root'){$content='您没有权限访问此页面'; require(DIR.'/templates/admin/page/404.php');exit;}
$title='系统设置';require(dirname(__DIR__).'/header.php');
?>
<body>
<div class="layuimini-container">
<div class="layuimini-main">
<form class="layui-form" lay-filter="form">
<div class="layui-form layuimini-form layui-form-pane">
<blockquote class="layui-elem-quote layui-text" style="">
1.此功能<a href="https://gitee.com/tznb/OneNav/wikis/%E8%AE%A2%E9%98%85%E6%9C%8D%E5%8A%A1%E6%8C%87%E5%BC%95" target="_blank">授权用户</a>专享,请仔细阅读本页说明<br />
2.缓存时间视自身需求而定,希望及时更新则短一点(实际上站点很少会更新图标),建议值: 604800 (7天)<br />
3.修改缓存时间可能不会立即生效,因为浏览器已经缓存的图标会等过期后再刷新 (可以清理浏览器缓存来强制刷新)<br />
4.用户需在站点设置>链接图标>选择本地服务或本地服务(伪静态),后者需要从站长工具生成伪静态并正确配置<br />
5.站点处于维护模式/离线模式或下方全局开关处于关闭时调用此接口则返回默认图标<br />
6.当显示默认图标会忽略下方浏览器缓存时间的设置,时间将被设为60秒<br />
7.受限于网络的复杂性无法百分百获取成功,当获取失败时会显示默认图标
</blockquote>
<div class="layui-form-item">
<label class="layui-form-label">全局开关</label>
<div class="layui-input-inline" >
<select name="o_switch">
<option value="0" selected="">关闭</option>
<option value="1" >开启</option>
</select>
</div>
<div class="layui-form-mid layui-word-aux">关闭时请求本地图标将得到默认图标</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">防盗链</label>
<div class="layui-input-inline" >
<select name="referer_test">
<option value="0" >关闭</option>
<option value="1" selected="">开启</option>
</select>
</div>
<div class="layui-form-mid layui-word-aux">Referer防盗链,即来路检测</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">服务器缓存</label>
<div class="layui-input-inline">
<input type="number" name="server_cache_time" lay-verify="required" placeholder='服务器缓存时间,单位:秒' value="604800" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">单位:秒,可节省服务器资源,值为0表示禁止缓存</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">浏览器缓存</label>
<div class="layui-input-inline">
<input type="number" name="browse_cache_time" lay-verify="required" placeholder='浏览器缓存时间,单位:秒' value="604800" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">单位:秒,可节省服务器资源,值为0表示禁止缓存</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">解析超时</label>
<div class="layui-input-inline">
<input type="number" name="analysis_timeout" lay-verify="required" placeholder='解析超时,单位:秒' value="6" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">单位:秒,范围:3 - 20,默认6秒</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">下载超时</label>
<div class="layui-input-inline">
<input type="number" name="download_timeout" lay-verify="required" placeholder='下载超时,单位:秒' value="6" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">单位:秒,范围:3 - 20,默认6秒</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">大小限制</label>
<div class="layui-input-inline">
<input type="number" name="icon_size" lay-verify="required" placeholder='下载超时,单位:KB' value="256" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">单位:KB,范围:5 - 1024,默认256</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">备选接口</label>
<div class="layui-input-inline" >
<select name="backup_api">
<option value="0" selected="">关闭</option>
<option value="6" >api.iowen.cn</option>
<option value="2" >favicon.png.pub</option>
</select>
</div>
<div class="layui-form-mid layui-word-aux">本地解析失败时尝试使用备选第三方API接口获取(由其他大佬提供)</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="save">确认保存</button>
</div>
</div>
</div>
</form>
</div>
</div>
<?php load_static('js.layui');?>
<script src="./templates/admin/js/public.js?v=<?php echo $Ver;?>"></script>
<script>
layui.use(['jquery','form'], function () {
var form = layui.form;
var layer = layui.layer;
var $ = layui.jquery;
//表单赋值
form.val('form', <?php echo json_encode(unserialize( get_db("global_config", "v", ["k" => "icon_config"])));?>);
//监听提交
form.on('submit(save)', function (data) {
$.post(get_api('other_root','write_icon_config'),data.field,function(data,status){
if(data.code == 1) {
if(data.msg!="保存成功"){
layer.alert(data.msg)
}else{
layer.msg(data.msg, {icon: 1});
}
}else{
layer.msg(data.msg, {icon: 5});
}
});
return false;
});
});
</script>
</body>
</html>

View File

@@ -28,6 +28,7 @@ require(dirname(__DIR__).'/header.php');
<button type="button" class="layui-btn" layuimini-content-href="updatelog" data-title="更新日志">更新日志</button>
<button type="button" class="layui-btn" layuimini-content-href="root/import_data" data-title="导入数据">导入数据</button>
<button type="button" class="layui-btn" layuimini-content-href="root/mail_set" data-title="邮件配置">邮件配置</button>
<button type="button" class="layui-btn" layuimini-content-href="root/icon_set" data-title="图标配置">图标配置</button>
</div>
<pre class="layui-code" id="console_log" >
1.功能都集中在上方的按钮了,需要那个就点击那个!
@@ -96,9 +97,11 @@ layui.use(['layer','form','miniTab'], function () {
$("#console_log").append(`#伪静态\n`);
$("#console_log").append(`rewrite ^${pathname}login$ ${pathname}index.php?c=login break;\n`);
$("#console_log").append(`rewrite ^${pathname}admin$ ${pathname}index.php?c=admin break;\n`);
$("#console_log").append(`rewrite ^${pathname}ico/(.+) ${pathname}index.php?c=icon&url=$1 break;\n`);
$("#console_log").append(`rewrite ^${pathname}([A-Za-z0-9]+)$ ${pathname}index.php?u=$1 break; #HOST/USER\n`);
$("#console_log").append(`rewrite ^${pathname}(.+)/(click)/([A-Za-z0-9]+)$ ${pathname}index.php?c=$2&id=$3&u=$1 break;\n`);
$("#console_log").append(`rewrite ^${pathname}(.+)/(click)/(.+) ${pathname}$3 break; #static\n`);
});
//清理缓存
$('.CleanCache').on('click', function(){

View File

@@ -2,6 +2,21 @@
<body>
<div class="layuimini-container">
<div class="layuimini-main" style=" margin-left: 20px;">
<li class="layui-timeline-item">
<i class="layui-icon layui-timeline-axis"></i>
<div class="layui-timeline-content layui-text">
<h4 class="layui-timeline-title">v2.0.22-20230523</h4>
<ul>
<li>[升级] 更新数据库,增加图标缓存记录/用户组权限列表增加图标拉取</li>
<li>[新增] 本地获取链接图标功能,功能在网站管理>站长工具>图标配置,开启并设置参数 [ 需授权 ]</li>
<li>[新增] 链接列表新增图标拉取,用于下载链接图标到本地储存 [ 需授权 ]</li>
<li>[修复] v2.0.21 安装页面异常导致无法安装的问题</li>
<li>[修复] 本地备份在未使用过备份时导入,因未自动创建目录造成导入失败</li>
<li>[修复] 升级layui导致的链接检测无法标记异常数据/扩展字段无法保存/用户组权限/书签分享等异常</li>
<li>[优化] 导出导入页面自适应能力,移动端访问时不显示一键添加(因为不支持)</li>
</ul>
</div>
</li>
<li class="layui-timeline-item">
<i class="layui-icon layui-timeline-axis"></i>
<div class="layui-timeline-content layui-text">