Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

二级修改大部分二级目录不兼容的问题 #211

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions admin/admin.inc.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2108,7 +2108,7 @@ class="edit-file"><i class="fa fa-pencil-square-o"></i> <?php echo lng('Advanced
if (in_array(strtolower(pathinfo($f, PATHINFO_EXTENSION)), array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'ico', 'svg', 'webp', 'avif'))): ?>
<?php $imagePreview = fm_enc(FM_ROOT_URL . (FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $f); ?>
<!-- 分组图片浏览 -->
<a href="<?php echo $imagePreview;?>" data-toggle="lightbox" data-group="manager-group"><img src="/app/thumb.php?img=<?php echo parse_url($imagePreview)['path'];?>" class="img-rounded" width="100px" height="100px" alt="<?php echo fm_enc($f);?>"></a>
<a href="<?php echo $imagePreview;?>" data-toggle="lightbox" data-group="manager-group"><img src="<?php echo $config['domain']; ?>/app/thumb.php?img=<?php echo parse_url($imagePreview)['path'];?>" class="img-rounded" width="100px" height="100px" alt="<?php echo fm_enc($f);?>"></a>
<?php else: ?>
<a href="<?php echo $filelink ?>" title="<?php echo $f ?>">
<?php endif; ?>
Expand Down
42 changes: 25 additions & 17 deletions app/history.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
<script type="application/javascript" src="<?php static_cdn(); ?>/public/static/viewjs/viewer.min.js"></script>
<script type="application/javascript" src="<?php static_cdn(); ?>/public/static/zui/lib/clipboard/clipboard.min.js"></script>
<script>
if ($.zui.store.length() > 1) {
console.log('saved: ' + $.zui.store.length()) // 获取总数
$.zui.store.forEach(function(key, value) { // 遍历所有本地存储的条目
let history = $.zui.store.get("easy-image-history");
if (history) {
console.log('saved: ' + Object.keys(history).length) // 获取总数
Object.entries(history).forEach(([key, value]) => { // 遍历所有本地存储的条目
console.log('url list: ' + value['url']) // 获取所有链接
if (value['url'] !== undefined) {
let v_url = parseURL(value['url']); // 获取链接路径 console.log(parseURL(value['url']).path);
Expand All @@ -37,25 +38,32 @@
$('.Remove').on('click', function() {

let Remove = $('.Remove').attr("id");
$.zui.store.remove(Remove); // 删除指定存储条目
let history = $.zui.store.get("easy-image-history");
if (history) {
// 删除对象中的指定键
delete history[Remove];
// 更新存储
$.zui.store.set("easy-image-history", history);
new $.zui.Messager('已删除 ' + Remove + ' 上传记录', {
type: "success", // 定义颜色主题
icon: "ok-sign" // 定义消息图标
}).show();
}

new $.zui.Messager('已删除 ' + Remove + ' 上传记录', {
type: "success", // 定义颜色主题
icon: "ok-sign" // 定义消息图标
}).show();

setTimeout(location.reload.bind(location), 2000); // 延迟2秒刷新
setTimeout(location.reload.bind(location), 500); // 延迟5m秒刷新
})

// 清空所有本地存储的条目
$('button').on('click', function() {
new $.zui.Messager('已清空' + $.zui.store.length() + "条历史记录", {
type: "success", // 定义颜色主题
icon: "ok-sign" // 定义消息图标
}).show();

$.zui.store.clear(); // 清空上传记录
setTimeout(location.reload.bind(location), 2000); // 延迟2秒刷新
let history = $.zui.store.get("easy-image-history");
if (history) {
new $.zui.Messager('已清空' + Object.keys(history).length + "条历史记录", {
type: "success", // 定义颜色主题
icon: "ok-sign" // 定义消息图标
}).show();
$.zui.store.remove("easy-image-history"); // 清空上传记录
setTimeout(location.reload.bind(location), 500); // 延迟5m秒刷新
}
})

// 复制 文件名/URL
Expand Down
4 changes: 2 additions & 2 deletions app/info.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<a class="btn btn-mini btn-primary" href="<?php echo $img_url; ?>" target="_blank"><i class="icon icon-picture"> 查看</i></a>
<!-- <a class="btn btn-mini btn-primary" data-toggle="collapse" data-target="#collapseExample"><i class="icon icon-caret-down"> Exif</i></a> -->
<a class="btn btn-mini btn-primary" href="" onclick="window.location.replace;"><i class="icon icon-spin icon-refresh"></i> 刷新</a>
<a class="btn btn-mini btn-primary" href="/app/down.php?dw=<?php echo $getIMG; ?>" target="_blank"><i class="icon icon-cloud-download"> 下载</i></a>
<a class="btn btn-mini btn-primary" href="down.php?dw=<?php echo $getIMG; ?>" target="_blank"><i class="icon icon-cloud-download"> 下载</i></a>
<?php if (!empty($config['report']) && !is_who_login('admin')) : ?>
<a class="btn btn-mini btn-warning" href="<?php echo $config['report'] . '?Website1=' . $img_url; ?>" target="_blank"><i class="icon icon-question-sign"> 举报</i></a>
<?php endif; ?>
Expand All @@ -145,7 +145,7 @@
<div class="collapse" id="collapseExample">
<pre style="background-color: rgba(0, 0, 0, 0);" id="allMetaDataSpan"></pre>
</div>
<h4 class="with-padding hl-gray"><i class="icon icon-info-sign"> 此图片来自网友上传, 不代表<a href="/admin/terms.php" target="_blank">本站立场</a>, 若有侵权, 请举报或联系管理员!</i></h4>
<h4 class="with-padding hl-gray"><i class="icon icon-info-sign"> 此图片来自网友上传, 不代表<a href="<?php echo $config['domain']; ?>/admin/terms.php" target="_blank">本站立场</a>, 若有侵权, 请举报或联系管理员!</i></h4>
</div>
</div>
<div class="col-md-12" style="padding-bottom: 10px;">
Expand Down
15 changes: 9 additions & 6 deletions app/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
<a href="<?php echo $linkUrl; ?>" target="_blank"><i class="icon icon-picture" data-toggle="tooltip" title="打开" style="margin-left:10px;"></i></a>
<a href="#" class="copy" data-clipboard-text="<?php echo $linkUrl; ?>" data-toggle="tooltip" title="复制链接" style="margin-left:10px;"><i class="icon icon-copy"></i></a>
<?php if ($config['show_exif_info'] || is_who_login('admin')) : ?>
<a href="/app/info.php?img=<?php echo $relative_path; ?>" data-toggle="tooltip" title="详细信息" target="_blank" style="margin-left:10px;"><i class="icon icon-info-sign"></i></a>
<a href="info.php?img=<?php echo $relative_path; ?>" data-toggle="tooltip" title="详细信息" target="_blank" style="margin-left:10px;"><i class="icon icon-info-sign"></i></a>
<?php endif; ?>
<a href="/app/down.php?dw=<?php echo $relative_path; ?>" data-toggle="tooltip" title="下载文件" target="_blank" style="margin-left:10px;"><i class="icon icon-cloud-download"></i></a>
<a href="down.php?dw=<?php echo $relative_path; ?>" data-toggle="tooltip" title="下载文件" target="_blank" style="margin-left:10px;"><i class="icon icon-cloud-download"></i></a>
<?php if (!empty($config['report'])) : ?>
<a href="<?php echo $config['report'] . '?Website1=' . $linkUrl; ?>" target="_blank"><i class="icon icon-question-sign" data-toggle="tooltip" title="举报文件" style="margin-left:10px;"></i></a>
<?php endif; ?>
Expand Down Expand Up @@ -145,7 +145,7 @@
</div>
<!-- 按日期-->
<div class="col-md-2 col-xs-5">
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="get">
<form action="" method="get">
<div class="input-group">
<span class="input-group-addon fix-border fix-padding"></span>
<input type="text" class="form-control form-date input-sm" name="date" value="<?php echo date('Y/m/d/'); ?>" readonly="readonly">
Expand All @@ -169,9 +169,12 @@
<script type="application/javascript" src="<?php static_cdn(); ?>/public/static/zui/lib/datetimepicker/datetimepicker.min.js"></script>
<script>
// viewjs
new Viewer(document.getElementById('viewjs'), {
url: 'data-original',
});
const viewjsElement = document.getElementById('viewjs');
if (viewjsElement) {
new Viewer(viewjsElement, {
url: 'data-original',
});
}

// POST 删除提交
function ajax_post(url, mode = 'delete') {
Expand Down
2 changes: 1 addition & 1 deletion app/viewlog.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function(data, status) {
size: '<?php echo $v['size']; ?>',
checkImg: '<?php echo strstr('OFF', $v['checkImg']) ? '否' : '是'; ?>',
from: '<?php echo is_string($v['from']) ? "网页" : 'API: ' . $v['from']; ?>',
manage: '<div class="btn-group"><a href="<?php echo rand_imgurl() . $v['path']; ?>" target="_blank" class="btn btn-mini btn-success">查看</a> <a href="/app/info.php?img=<?php echo $v['path']; ?>" target="_blank" class="btn btn-mini">信息</a><a href="#" onclick="ajax_post(\'<?php echo $v['path']; ?>\',\'recycle\')" class="btn btn-mini btn-info">回收</a> <a href="#" onclick="ajax_post(\'<?php echo $v['path']; ?>\',\'delete\')" class="btn btn-mini btn-danger">删除</a></div>',
manage: '<div class="btn-group"><a href="<?php echo rand_imgurl() . $v['path']; ?>" target="_blank" class="btn btn-mini btn-success">查看</a> <a href="info.php?img=<?php echo $v['path']; ?>" target="_blank" class="btn btn-mini">信息</a><a href="#" onclick="ajax_post(\'<?php echo $v['path']; ?>\',\'recycle\')" class="btn btn-mini btn-info">回收</a> <a href="#" onclick="ajax_post(\'<?php echo $v['path']; ?>\',\'delete\')" class="btn btn-mini btn-danger">删除</a></div>',
},
<?php endforeach; ?>
]
Expand Down
11 changes: 10 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,16 @@

try { // 储存上传历史
console.log('history localStorage success');
$.zui.store.set(obj.srcName, obj)
// 获取现有的上传记录
let history = $.zui.store.get("easy-image-history");
// 如果不存在,则初始化为一个空对象
if (!history) {
history = {};
}
// 将新的记录添加到对象中,键为 obj.srcName,值为 obj
history[obj.srcName] = obj;
// 更新本地存储
$.zui.store.set("easy-image-history", history);
} catch (err) {
// 失败提示
$.zui.messager.show('存储上传记录失败' + err, {
Expand Down
11 changes: 10 additions & 1 deletion public/static/EasyImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,16 @@ function uploadCopy(copyID, loadClass) {

try { // 储存上传记录
console.log('history localStorage success');
$.zui.store.set(obj.srcName, obj)
// 获取现有的上传记录
let history = $.zui.store.get("easy-image-history");
// 如果不存在,则初始化为一个空对象
if (!history) {
history = {};
}
// 将新的记录添加到对象中,键为 obj.srcName,值为 obj
history[obj.srcName] = obj;
// 更新本地存储
$.zui.store.set("easy-image-history", history);
} catch (err) {
// 存储上传记录失败提示
$.zui.messager.show('存储上传记录失败' + err, { icon: 'bell', time: 4000, type: 'danger', placement: 'top' });
Expand Down