v2.6.3 deving

pull/141/head
icret 2022-05-22 15:06:50 +08:00
parent 7378057cca
commit b323664526
12 changed files with 265 additions and 100 deletions

21
README.md Executable file → Normal file
View File

@ -180,15 +180,15 @@ $HTTP["url"] =~ "^/(i|public)/" {
<details><summary>点击查看2.0版更新日志</summary>
* 2022-05-18 v2.6.3 Deving 此版本正在开发中, 尚未发布
* 2022-05-22 v2.6.3 Deving 此版本正在开发中, 更新到此版本需要删除上传日志
- 增加读取上传日志
- 增加广场浏览往日限制
- 有助于防爬虫抓取
- 删除图片详情页Exif信息
- 文件管理中图片使用缩略图显示
- 更改广场->信息中图片长宽获取方式
- 删除图片详情页Exif信息
- 优化图片详情页
- 优化广场UI
- 优化图片详情页/广场UI/日志/用户/api 列表
* 2022-05-04 v2.6.2
- 增加API/用户文件浏览和删除
@ -572,15 +572,16 @@ RewriteRule config/(.*).(php)$ [F]
|支付宝支持|微信支持|
|:----:|:----:|
|![支付宝支持](https://gitee.com/icret/EasyImages2.0/raw/2.6.2/public/images/alipay.jpg)|![微信支持](https://gitee.com/icret/EasyImages2.0/raw/2.6.2/public/images/wechat.jpg)|
|![支付宝支持](https://raw.githubusercontent.com/icret/EasyImages2.0/master/public/images/alipay.jpg)|![微信支持](https://raw.githubusercontent.com/icret/EasyImages2.0/master/public/images/wechat.jpg)|
## 界面演示
![简单图床 - 上传界面](https://gitee.com/icret/EasyImages2.0/raw/2.6.2/install/README/674074848.png)
![简单图床 - 广场界面](https://gitee.com/icret/EasyImages2.0/raw/2.6.2/install/README/3053540273.png)
![简单图床 - 后台界面](https://gitee.com/icret/EasyImages2.0/raw/2.6.2/install/README/2657944724.png)
![简单图床 - 统计界面](https://gitee.com/icret/EasyImages2.0/raw/2.6.2/install/README/1305032567.png)
![简单图床 - 图片信息](https://gitee.com/icret/EasyImages2.0/raw/2.6.2/install/README/info.png)
![简单图床 - 上传界面](https://raw.githubusercontent.com/icret/EasyImages2.0/install/README/674074848.png)
![简单图床 - 广场界面](https://raw.githubusercontent.com/icret/EasyImages2.0/master/install/README/3053540273.png)
![简单图床 - 后台界面](https://raw.githubusercontent.com/icret/EasyImages2.0/master/install/README/2657944724.png)
![简单图床 - 统计界面](https://raw.githubusercontent.com/icret/EasyImages2.0/master/install/README/1305032567.png)
![简单图床 - 图片信息](https://raw.githubusercontent.com/icret/EasyImages2.0/master/install/README/info.png)
![简单图床 - 上传日志](https://raw.githubusercontent.com/icret/EasyImages2.0/master/install/README/log.png)
## 兼容

View File

@ -453,40 +453,7 @@ if (isset($_GET['recycle_reimg'])) {
</form>
<h5 class="page-header">Token列表: <?php if (!$config['token_path_status']) echo '<small>* 部分按钮需开启Token分离才能激活, 删除后不可恢复</small>'; ?></h5>
<p class="text-primary">API调用地址: <code><?php echo $config['domain']; ?>/api/index.php</code></p>
<div class="table-responsive table-condensed">
<table class="table table-hover table-bordered visible-xs visible-sm" style="margin-top: 10px;">
<thead>
<tr>
<th>ID</th>
<th>列表</th>
<th>添加时间</th>
<th>有效期至</th>
<th>上传数量</th>
<th>管理Token</th>
</tr>
</thead>
<tbody>
<?php foreach ($tokenList as $key => $value) :
$expired = $value['expired'] < time() ? '<p class="text-gray">已过期</p>' : '<p class="text-green">' . date('Y-m-d H:i:s', $value['expired']) . '</p>';
?>
<tr>
<td><?php echo $value['id']; ?></td>
<td><?php echo $key; ?></td>
<td><?php echo date('Y年m月d日 H:i:s', $value['add_time']); ?></td>
<td><?php echo get_file_by_glob(APP_ROOT . $config['path'] . $value['id'], $type = 'number'); ?></td>
<td><?php echo $expired; ?></td>
<td>
<a href='/admin/manager.php?p=<?php echo $value['id']; ?>' target='_blank' class='btn btn-mini btn-primary <?php if (!$config['token_path_status']) echo 'disabled'; ?>'>文件</a>
<a href='admin.inc.php?stop_token=<?php echo $key; ?>' class='btn btn-mini btn-danger'>禁用</a>
<a href='admin.inc.php?delete_token=<?php echo $key; ?>' class='btn btn-mini btn-danger'>删除</a>
<a href='admin.inc.php?delDir=<?php echo $value['id']; ?>' class='btn btn-mini btn-primary <?php if (!$config['token_path_status']) echo 'disabled'; ?>'>删除上传</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div id="myDataGrid" class="datagrid table-bordered visible-md visible-lg">
<div id="myDataGrid" class="datagrid table-bordered">
<div class="input-control search-box search-box-circle has-icon-left has-icon-right" id="searchboxExample2" style="margin-bottom: 10px;">
<input id="inputSearchExample2" type="search" class="form-control search-input input-sm" placeholder="搜索Token">
<label for="inputSearchExample2" class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label>
@ -693,7 +660,7 @@ if (isset($_GET['recycle_reimg'])) {
</div>
</div>
</div>
<button type="button" class="btn btn-mini btn-primary" data-moveable="true" data-remote="/application/read_upload_logs.php" data-toggle="modal" data-scroll-inside="true" data-title="可以使用 Ctrl+F 搜索指定信息" data-icon="info"><i class="icon icon-info" data-toggle="tooltip" title="最大读取壹佰万上传日志">当月日志</i></button>
<button type="button" class="btn btn-mini btn-primary" data-moveable="true" data-remote="/application/read_log.php?session=<?php echo md5($config['password'] . date('YMDH')); ?>" data-toggle="modal" data-scroll-inside="true" data-width="95%" data-height="768px" data-title="建议使用分辨率 ≥ 1366*768px" data-icon="info"><i class="icon icon-info" data-toggle="tooltip" title="最大读取壹佰万上传日志">当月日志</i></button>
<div class="form-group">
<input type="hidden" class="form-control" name="update" value="<?php echo date("Y-m-d H:i:s"); ?>" placeholder="隐藏的保存">
</div>
@ -736,7 +703,7 @@ if (isset($_GET['recycle_reimg'])) {
<td><?php echo $filen_name; ?></td>
<td><?php echo $file_size; ?></td>
<td>
<a class="btn btn-mini" href="<?php echo $url; ?>" target="_blank">源图</a>
<a class="btn btn-mini" href="<?php echo $url; ?>" target="_blank">查看</a>
<a class="btn btn-mini" href="/application/info.php?img=<?php echo $file_path; ?>" target="_blank">信息</a>
<a class="btn btn-mini btn-success" href="?suspic_reimg=<?php echo $filen_name; ?>">恢复</a>
<a class="btn btn-mini btn-danger" href="<?php echo $unlink_img; ?>" target="_blank">删除</a>
@ -966,38 +933,13 @@ if (isset($_GET['recycle_reimg'])) {
</div>
</form>
<h5>* 开启用户分离后删除上传按钮激活, 删除后不可恢复</h5>
<div class="table-responsive table-condensed">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>登录账号</th>
<th>登录密码 (经过MD5加密)</th>
<th>添加时间</th>
<th>有效期至</th>
<th>上传数量</th>
<th>管理账号</th>
</tr>
</thead>
<tbody>
<?php foreach ($guestConfig as $key => $value) :
$expired = $value['expired'] < time() ? '<p class="text-gray">已过期</p>' : '<p class="text-green">' . date('Y-m-d H:i:s', $value['expired']) . '</p>';
?>
<tr>
<td><?php echo $key; ?></td>
<td><?php echo $value['password']; ?></td>
<td> <?php echo date('Y年m月d日 H:i:s', $value['add_time']); ?></td>
<td> <?php echo $expired; ?></td>
<td><?php echo get_file_by_glob(APP_ROOT . $config['path'] . $key, $type = 'number'); ?></td>
<td>
<a href='/admin/manager.php?p=<?php echo $key; ?>' target='_blank' class='btn btn-mini btn-primary <?php if (!$config['guest_path_status']) echo 'disabled'; ?>'>文件</a>
<a href='admin.inc.php?stop_guest=<?php echo $key; ?>' class='btn btn-mini btn-danger'>禁用</a>
<a class='btn btn-mini btn-danger' href='admin.inc.php?delete_guest=<?php echo $key; ?>'>删除</a>
<a class='btn btn-mini btn-primary <?php if (!$config['guest_path_status']) echo 'disabled'; ?>' href='admin.inc.php?delDir=<?php echo $key; ?>'>删除上传</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div id="guest" class="datagrid table-bordered">
<div class="input-control search-box search-box-circle has-icon-left has-icon-right" id="searchboxExample2" style="margin-bottom: 10px;">
<input id="inputSearchExample2" type="search" class="form-control search-input input-sm" placeholder="上传用户搜索...">
<label for="inputSearchExample2" class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label>
<a href="#" class="input-control-icon-right search-clear-btn"><i class="icon icon-remove"></i></a>
</div>
<div class="datagrid-container"></div>
</div>
<!-- 源图加密Key start-->
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
@ -1046,7 +988,7 @@ if (isset($_GET['recycle_reimg'])) {
<td><?php echo $filen_name; ?></td>
<td><?php echo $file_size; ?></td>
<td>
<a class="btn btn-mini" href="<?php echo $url; ?>" target="_blank">源图</a>
<a class="btn btn-mini" href="<?php echo $url; ?>" target="_blank">查看</a>
<a class="btn btn-mini" href="/application/info.php?img=<?php echo $file_path; ?>" target="_blank">信息</a>
<a class="btn btn-mini btn-success" href="?recycle_reimg=<?php echo $filen_name; ?>">恢复</a>
<a class="btn btn-mini btn-danger" href="<?php echo $unlink_img; ?>" target="_blank">删除</a>
@ -1297,8 +1239,9 @@ if (isset($_GET['recycle_reimg'])) {
width: 0.02
},
{
name: 'list',
label: '列表',
name: 'token',
label: 'Token',
html: true,
width: 0.28
},
{
@ -1321,7 +1264,7 @@ if (isset($_GET['recycle_reimg'])) {
},
{
name: 'manage',
label: '管理Token',
label: '管理',
html: true,
width: 0.25
},
@ -1330,11 +1273,11 @@ if (isset($_GET['recycle_reimg'])) {
<?php foreach ($tokenList as $key => $value) :
$expired = $value['expired'] < time() ? '<p class="text-gray">已过期</p>' : '<p class="text-green">' . date('Y-m-d H:i:s', $value['expired']) . '</p>'; ?> {
id: '<?php echo $value['id']; ?>',
list: '<?php echo $key; ?>',
token: '<input class="form-control input-sm" type="text" value="<?php echo $key; ?>" readonly>',
add_time: '<?php echo date('Y年m月d日 H:i:s', $value['add_time']); ?>',
expired: '<?php echo $expired; ?>',
number: <?php echo get_file_by_glob(APP_ROOT . $config['path'] . $value['id'], $type = 'number'); ?>,
manage: "<a href='/admin/manager.php?p=<?php echo $value['id']; ?>' target='_blank' class='btn btn-mini btn-primary <?php if (!$config['token_path_status']) echo 'disabled'; ?>'>文件</a> <a href='admin.inc.php?stop_token=<?php echo $key; ?>' class='btn btn-mini btn-danger'>禁用</a> <a href='admin.inc.php?delete_token=<?php echo $key; ?>' class='btn btn-mini btn-danger'>删除</a> <a href='admin.inc.php?delDir=<?php echo $value['id']; ?>' class='btn btn-mini btn-primary <?php if (!$config['token_path_status']) echo 'disabled'; ?>'>删除上传</a>"
manage: "<a href='/admin/manager.php?p=<?php echo $value['id']; ?>' target='_blank' class='btn btn-mini btn-success <?php if (!$config['token_path_status']) echo 'disabled'; ?>'>文件</a> <a href='admin.inc.php?stop_token=<?php echo $key; ?>' class='btn btn-mini btn-danger'>禁用</a> <a href='admin.inc.php?delete_token=<?php echo $key; ?>' class='btn btn-mini btn-danger'>删除</a> <a href='admin.inc.php?delDir=<?php echo $value['id']; ?>' class='btn btn-mini btn-primary <?php if (!$config['token_path_status']) echo 'disabled'; ?>'>删除上传</a>"
},
<?php endforeach; ?>
]
@ -1343,13 +1286,101 @@ if (isset($_GET['recycle_reimg'])) {
hoverCell: true,
showRowIndex: false,
responsive: true,
height: 200,
// ... 其他初始化选项
configs: {
R1: {
style: {
color: '#00b8d4',
backgroundColor: '#e0f7fa'
}
},
}
});
// 获取数据表格实例
var myDataGrid = $('#myDataGrid').data('zui.datagrid');
var tokenMyDataGrid = $('#myDataGrid').data('zui.datagrid');
// 按照 `name` 列降序排序
myDataGrid.sortBy('expired', 'desc');
tokenMyDataGrid.sortBy('expired', 'desc');
// guest 上传用户数据表格
$('#guest').datagrid({
dataSource: {
height: 800,
cols: [{
label: '账号',
name: 'guest',
html: true,
width: 0.1
},
{
label: '密码(md5)',
name: 'password',
html: true,
width: 0.1
},
{
label: '添加时间',
name: 'add_time',
html: true,
width: 0.2
},
{
label: '有效期至',
name: 'expired',
html: true,
width: 0.2
},
{
label: '上传数量',
name: 'files',
html: true,
width: 0.1
},
{
label: '管理账号',
name: 'manage',
html: true,
width: 0.3
},
],
array: [
<?php foreach ($guestConfig as $k => $v) :
$expired = $v['expired'] < time() ? '<p class="text-gray">已过期</p>' : '<p class="text-green">' . date('Y-m-d H:i:s', $v['expired']) . '</p>'; ?> {
guest: '<?php echo $k; ?>',
password: '<input class="form-control input-sm" type="text" value="<?php echo $v['password']; ?>" readonly>',
add_time: '<?php echo date('Y年m月d日 H:i:s', $v['add_time']); ?>',
expired: '<?php echo $expired; ?>',
files: <?php echo get_file_by_glob(APP_ROOT . $config['path'] . $k, $type = 'number'); ?>,
manage: "<a href='/admin/manager.php?p=<?php echo $k; ?>' target='_blank' class='btn btn-mini btn-success <?php if (!$config['guest_path_status']) echo 'disabled'; ?>'>文件</a> <a href='admin.inc.php?stop_guest=<?php echo $k; ?>' class='btn btn-mini btn-danger'>禁用</a> <a class='btn btn-mini btn-danger' href='admin.inc.php?delete_guest=<?php echo $k; ?>'>删除</a> <a class='btn btn-mini btn-primary <?php if (!$config['guest_path_status']) echo 'disabled'; ?>' href='admin.inc.php?delDir=<?php echo $k; ?>'>删除上传</a>",
},
<?php endforeach; ?>
]
},
sortable: true,
hoverCell: true,
showRowIndex: true,
responsive: true,
height: 200,
// ... 其他初始化选项
configs: {
R1: {
style: {
color: '#00b8d4',
backgroundColor: '#e0f7fa'
}
},
}
});
// 获取数据表格实例
var guestMyDataGrid = $('#guest').data('zui.datagrid');
// 按照 `name` 列降序排序
guestMyDataGrid.sortBy('add_time', 'desc');
// 更改网页标题
document.title = "图床设置 - <?php echo $config['title']; ?>"

View File

@ -119,29 +119,31 @@ function write_log($filePath, $sourceName, $absolutePath, $fileSize, $from = "we
'from' => $from, // 图片上传来源
));
$logFileName = APP_ROOT . '/admin/logs/upload/' . date('Y-m') . '.php';
// 创建日志文件夹
if (!is_dir(APP_ROOT . '/admin/logs/upload/')) {
mkdir(APP_ROOT . '/admin/logs/upload', 0755, true);
}
// 写入禁止浏览器直接访问
if (filesize($logFileName) == 0) {
$php_exit = '<?php /** {图片名称{source:源文件名称,date:上传日期(Asia/Shanghai),ip:上传者IP,port:IP端口,user_agent:上传者浏览器信息,path:文件相对路径,size:文件大小(格式化),md5:文件MD5,checkImg:鉴黄状态,form:上传方式web/API ID}} */ exit;?>';
file_put_contents($logFileName, $php_exit);
}
// logs文件组成
$logFileName = APP_ROOT . '/admin/logs/upload/' . date('Y-m') . '.php';
$log = json_encode($log, JSON_UNESCAPED_UNICODE);
file_put_contents($logFileName, PHP_EOL . $log, FILE_APPEND | LOCK_EX);
/* 以数组存放 并发会丢日志
// 创建logs文件
if (!is_file($logFileName)) {
file_put_contents($logFileName, '<?php $logs=Array();?>');
}
// 引入logs
include $logFileName;
// // 写入禁止浏览器直接访问
// if (filesize($logFileName) == 0) {
// $php_exit = '<?php /** {图片名称{source:源文件名称,date:上传日期(Asia/Shanghai),ip:上传者IP,port:IP端口,user_agent:上传者浏览器信息,path:文件相对路径,size:文件大小(格式化),md5:文件MD5,checkImg:鉴黄状态,form:上传方式web/API ID}} */ exit;? >';
// file_put_contents($logFileName, $php_exit);
// }
// $log = json_encode($log, JSON_UNESCAPED_UNICODE);
// file_put_contents($logFileName, PHP_EOL . $log, FILE_APPEND | LOCK_EX);
$log = array_replace($logs, $log);
cache_write($logFileName, $log, 'logs');
*/
}

131
application/read_log.php Normal file
View File

@ -0,0 +1,131 @@
<?php
/**
* 读取上传日志
*/
require_once __DIR__ . '/function.php';
// 非管理员不可访问!
if (!is_who_login('admin')) {
exit;
}
// 禁止直接访问
if (empty($_GET['session']) || $_GET['session'] !== md5($config['password'] . date('YMDH'))) exit;
require APP_ROOT . '/admin/logs/upload/' . date('Y-m') . '.php';
?>
<div id="logs" class="datagrid table-bordered">
<div class="input-control search-box search-box-circle has-icon-left has-icon-right" id="searchboxExample2" style="margin-bottom: 10px;">
<input id="inputSearchExample2" type="search" class="form-control search-input input-sm" placeholder="日志搜索...">
<label for="inputSearchExample2" class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label>
<a href="#" class="input-control-icon-right search-clear-btn"><i class="icon icon-remove"></i></a>
</div>
<div class="datagrid-container"></div>
</div>
<p class="text-muted" style="font-size:10px;">当前日志路径: /admin/logs/upload/<?php echo date('Y-m'); ?>.php</p>
<script>
// logs 数据表格
$('#logs').datagrid({
dataSource: {
height: 800,
cols: [{
label: '当前名称',
name: 'orgin',
},
{
label: '源文件名',
name: 'source',
html: true,
},
{
label: '上传时间',
name: 'date',
html: true,
},
{
label: '上传IP及端口',
name: 'ip',
html: true,
},
{
label: 'User-Agent',
name: 'user_agent',
html: true,
},
{
label: '路径',
name: 'path',
html: true,
},
{
label: '大小',
name: 'size',
html: true,
},
{
label: 'MD5',
name: 'md5',
html: true,
},
{
label: '鉴黄状态',
name: 'checkImg',
html: true,
},
{
label: '来源',
name: 'from',
html: true,
},
{
label: '管理',
name: 'manage',
html: true,
},
],
array: [
<?php foreach ($logs as $k => $v) : ?> {
orgin: '<?php echo $k; ?>',
source: '<input class="form-control input-sm" type="text" value="<?php echo $v['source']; ?>" readonly>',
date: '<?php echo $v['date']; ?>',
ip: '<a href="http://ip.tool.chinaz.com/<?php echo $v['ip']; ?>" target="_blank"><?php echo $v['ip'] . ':' . $v['port']; ?></a>',
// 备用 ip: '<a href="https://www.ip138.com/iplookup.asp?ip=< ?php echo $v['ip']; ?>&action=2" target="_blank">< ?php echo $v['ip'] . ':' . $v['port']; ?></a>',
user_agent: '<input class="form-control input-sm" type="text" value="<?php echo $v['user_agent']; ?>" readonly>',
path: '<input class="form-control input-sm" type="text" value="<?php echo $v['path']; ?>" readonly>',
size: '<?php echo $v['size']; ?>',
md5: '<input class="form-control input-sm" type="text" value="<?php echo $v['md5']; ?>" readonly>',
checkImg: '<?php echo $v['checkImg']; ?>',
from: '<?php echo $v['from']; ?>',
manage: "<a href='<?php echo $config['domain'] . $v['path']; ?>' target='_blank' class='btn btn-mini btn-success'>查看</a> <a href='/application/del.php?recycle_url=<?php echo $v['path']; ?>' target='_blank' class='btn btn-mini btn-info'>回收</a> <a href='/application/del.php?url=<?php echo $v['path']; ?>' target='_blank' class='btn btn-mini btn-danger'>删除</a> ",
},
<?php endforeach; ?>
]
},
sortable: true,
hoverCell: true,
showRowIndex: true,
responsive: true,
height: 640,
// ... 其他初始化选项
configs: {
R1: {
style: {
color: '#00b8d4',
backgroundColor: '#e0f7fa'
}
},
}
});
// 获取数据表格实例
var logMyDataGrid = $('#logs').data('zui.datagrid');
var myDate = new Date();
logMyDataGrid.showMessage(myDate.getFullYear() + '年' + (myDate.getMonth() + 1) + '月上传日志已加载...... ', 'primary', 2500);
// 按照 `name` 列降序排序
logMyDataGrid.sortBy('date', 'desc');
</script>

View File

@ -81,7 +81,7 @@ $config=Array
9=>'month'
),
'language'=>0,
'login_bg'=>'https://tva3.sinaimg.cn/large/718153f4gy1gzpmuymj1rj20sg0nr76c.jpg',
'login_bg'=>'https://img.paulzzh.com/touhou/random',
'image_recycl'=>1,
'tinyfilemanager'=>1,
'delDir'=>'thumbnails/',
@ -93,7 +93,7 @@ $config=Array
'token_path_status'=>0,
'admin_path'=>'u',
'version'=>'2.6.2',
'update'=>'2022-05-18 21:32:50',
'update'=>'2022-05-22 14:39:20',
'footer'=>'<a href="/admin/terms.php" target="_blank">请勿上传违反中国政策的图片</a>
<script>
var _hmt = _hmt || [];

BIN
install/README/1305032567.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 119 KiB

BIN
install/README/2657944724.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 108 KiB

BIN
install/README/3053540273.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
install/README/674074848.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 73 KiB

0
install/README/chmod.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

BIN
install/README/info.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 164 KiB

BIN
install/README/log.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB