v1.0.1: fix search UI missing, delete share link, share page file icons

This commit is contained in:
dvs
2026-08-28 10:35:14 +08:00
parent ff2c63c0ce
commit 89f0c769b0
5 changed files with 1280 additions and 1328 deletions
+9
View File
@@ -6,6 +6,15 @@
--- ---
## ✅ v1.0.1 Fixes
Fixed bugs in v1.0.0:
- 🔍 **Search UI**: Added the missing file-search UI to the interface
- 🗑️ **Delete Share**: Fixed the inability to delete share links
- 🖼️ **Share Page Icons**: Fixed file icons displaying incorrectly on the shared-files page
---
## ✨ Features ## ✨ Features
| Feature | Description | | Feature | Description |
+4 -1
View File
@@ -1173,10 +1173,13 @@ def shared_files():
shares_list = [] shares_list = []
for share in user_shares: for share in user_shares:
name = os.path.basename(share['original_path'])
ext = name.rsplit('.', 1)[1].lower() if not share['is_dir'] and '.' in name else ''
shares_list.append({ shares_list.append({
'share_id': share['share_id'], 'share_id': share['share_id'],
'name': os.path.basename(share['original_path']), 'name': name,
'path': share['original_path'], 'path': share['original_path'],
'ext': ext,
'created_at': share['created_at'], 'created_at': share['created_at'],
'downloads': share['downloads'], 'downloads': share['downloads'],
'is_dir': bool(share['is_dir']) 'is_dir': bool(share['is_dir'])
+1 -1
View File
@@ -727,7 +727,7 @@
<!-- 页脚 -->␍␍ <!-- 页脚 -->␍␍
<footer class="mt-12 py-8 text-center border-t border-gray-200">␍␍ <footer class="mt-12 py-8 text-center border-t border-gray-200">␍␍
<div class="container mx-auto px-4">␍␍ <div class="container mx-auto px-4">␍␍
<p class="text-gray-600 mb-2 text-lg">🚀 DVS云盘 · 某个开发者的作品</p>␍ <p class="text-gray-600 mb-2 text-lg">DVSCloud</p>␍␍
<p class="text-gray-500 text-sm">␍␍ <p class="text-gray-500 text-sm">␍␍
安全的代码是优美的代码 · ␍␍ 安全的代码是优美的代码 · ␍␍
用户友好的设计是简单的设计 ·␍␍ 用户友好的设计是简单的设计 ·␍␍
+458 -552
View File
File diff suppressed because it is too large Load Diff
+62 -28
View File
@@ -64,11 +64,38 @@
{% for item in shared_items %} {% for item in shared_items %}
<div class="mac-file-item"> <div class="mac-file-item">
<!-- 图标区域 --> <!-- 图标区域 -->
<div class="mac-file-icon {% if item.is_dir %}folder{% else %}document{% endif %}"> <div class="mac-file-icon
{% if item.is_dir %}folder
{% elif item.ext in ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg', 'ico'] %}image
{% elif item.ext in ['mp4', 'avi', 'mov', 'mkv', 'flv', 'wmv', 'webm', 'm4v'] %}video
{% elif item.ext in ['mp3', 'wav', 'flac', 'aac', 'ogg', 'm4a', 'wma'] %}audio
{% elif item.ext == 'pdf' %}pdf
{% elif item.ext in ['zip', 'rar', '7z', 'tar', 'gz', 'bz2'] %}archive
{% elif item.ext in ['txt', 'md', 'log', 'ini', 'cfg', 'conf'] %}text
{% elif item.ext in ['py', 'js', 'java', 'c', 'cpp', 'h', 'html', 'css', 'php', 'rb', 'go', 'rs', 'swift', 'kt'] %}code
{% elif item.ext in ['exe', 'msi', 'dmg', 'pkg', 'deb', 'rpm', 'appimage'] %}executable
{% else %}document
{% endif %}">
{% if item.is_dir %} {% if item.is_dir %}
<i class="fas fa-folder"></i> <i class="fas fa-folder"></i>
{% elif item.ext in ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg', 'ico'] %}
<i class="fas fa-image"></i>
{% elif item.ext in ['mp4', 'avi', 'mov', 'mkv', 'flv', 'wmv', 'webm', 'm4v'] %}
<i class="fas fa-video"></i>
{% elif item.ext in ['mp3', 'wav', 'flac', 'aac', 'ogg', 'm4a', 'wma'] %}
<i class="fas fa-music"></i>
{% elif item.ext == 'pdf' %}
<i class="fas fa-file-pdf"></i>
{% elif item.ext in ['zip', 'rar', '7z', 'tar', 'gz', 'bz2'] %}
<i class="fas fa-file-archive"></i>
{% elif item.ext in ['txt', 'md', 'log', 'ini', 'cfg', 'conf'] %}
<i class="fas fa-file-alt"></i>
{% elif item.ext in ['py', 'js', 'java', 'c', 'cpp', 'h', 'html', 'css', 'php', 'rb', 'go', 'rs', 'swift', 'kt'] %}
<i class="fas fa-code"></i>
{% elif item.ext in ['exe', 'msi', 'dmg', 'pkg', 'deb', 'rpm', 'appimage'] %}
<i class="fas fa-cog"></i>
{% else %} {% else %}
<i class="fas fa-file-share"></i> <i class="fas fa-file"></i>
{% endif %} {% endif %}
</div> </div>
@@ -108,7 +135,7 @@
<a class="mac-action-btn mac-action-btn-share" data-tooltip="访问分享链接" href="{{ url_for('download_shared', share_id=item.share_id) }}" target="_blank"> <a class="mac-action-btn mac-action-btn-share" data-tooltip="访问分享链接" href="{{ url_for('download_shared', share_id=item.share_id) }}" target="_blank">
<i class="fas fa-external-link-alt"></i> <i class="fas fa-external-link-alt"></i>
</a> </a>
<button class="mac-action-btn mac-action-btn-delete unshare-btn" data-tooltip="取消分享" data-share-id="{{ item.share_id }}" data-item-name="{{ item.name }}"> <button type="button" class="mac-action-btn mac-action-btn-delete unshare-btn" data-tooltip="取消分享" data-share-id="{{ item.share_id }}" data-item-name="{{ item.name }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</button> </button>
</div> </div>
@@ -269,8 +296,19 @@ main {
} }
} }
/* 文件类型图标颜色 */ /* 文件类型图标颜色 - 和主页完全一致 */
.mac-file-icon.folder { background: linear-gradient(135deg, #60a5fa, #3b82f6); } .mac-file-icon.folder { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.mac-file-icon.image { background: linear-gradient(135deg, #38bdf8, #0ea5e9); }
.mac-file-icon.video { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.mac-file-icon.audio { background: linear-gradient(135deg, #10b981, #059669); }
.mac-file-icon.pdf { background: linear-gradient(135deg, #f87171, #ef4444); }
.mac-file-icon.word { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.mac-file-icon.excel { background: linear-gradient(135deg, #10b981, #059669); }
.mac-file-icon.powerpoint { background: linear-gradient(135deg, #f97316, #ea580c); }
.mac-file-icon.archive { background: linear-gradient(135deg, #f59e0b, #d97706); }
.mac-file-icon.code { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.mac-file-icon.text { background: linear-gradient(135deg, #94a3b8, #64748b); }
.mac-file-icon.executable { background: linear-gradient(135deg, #ef4444, #dc2626); }
.mac-file-icon.document { background: linear-gradient(135deg, #a855f7, #9333ea); } .mac-file-icon.document { background: linear-gradient(135deg, #a855f7, #9333ea); }
/* 文件列表项 */ /* 文件列表项 */
@@ -567,42 +605,38 @@ main {
</style> </style>
<script> <script>
$(document).ready(function() { (function() {
// 取消分享功能 - 显示弹窗 // 取消分享功能 - 纯JavaScript版本
$('.unshare-btn').click(function() { document.querySelectorAll('.unshare-btn').forEach(function(btn) {
var shareId = $(this).data('share-id'); btn.addEventListener('click', function() {
var itemName = $(this).data('item-name'); var shareId = this.getAttribute('data-share-id');
var itemName = this.getAttribute('data-item-name');
$('#unshare_share_id').val(shareId); document.getElementById('unshare_share_id').value = shareId;
$('#unshare_item_name').text(itemName); document.getElementById('unshare_item_name').textContent = itemName;
// 显示弹窗 // 显示弹窗
$('#unshareDialog').removeClass('hidden'); var dialog = document.getElementById('unshareDialog');
$('#unshareDialog').css({ dialog.classList.remove('hidden');
'display': 'flex', dialog.style.cssText = 'display:flex!important;position:fixed!important;inset:0!important;background-color:rgba(0,0,0,0.5)!important;align-items:center!important;justify-content:center!important;z-index:9999!important;';
'position': 'fixed', document.body.style.overflow = 'hidden';
'inset': '0',
'background-color': 'rgba(0, 0, 0, 0.5)',
'align-items': 'center',
'justify-content': 'center',
'z-index': '9999'
}); });
$('body').css('overflow', 'hidden');
}); });
// ESC键关闭弹窗 // ESC键关闭弹窗
$(document).keyup(function(e) { document.addEventListener('keyup', function(e) {
if (e.key === "Escape") { if (e.key === "Escape") {
closeDialog(); closeDialog();
} }
}); });
}); })();
// 关闭弹窗函数 // 关闭弹窗函数 - 纯JS版本
function closeDialog() { function closeDialog() {
$('#unshareDialog').addClass('hidden'); var dialog = document.getElementById('unshareDialog');
$('#unshareDialog').css('display', 'none'); dialog.classList.add('hidden');
$('body').css('overflow', 'auto'); dialog.style.display = 'none';
document.body.style.overflow = 'auto';
} }
// 点击遮罩层关闭弹窗 // 点击遮罩层关闭弹窗