diff --git a/README.md b/README.md index 26a5aca..17d401b 100644 --- a/README.md +++ b/README.md @@ -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 | Feature | Description | diff --git a/app.py b/app.py index ec5cb05..d859e16 100644 --- a/app.py +++ b/app.py @@ -1173,10 +1173,13 @@ def shared_files(): shares_list = [] 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({ 'share_id': share['share_id'], - 'name': os.path.basename(share['original_path']), + 'name': name, 'path': share['original_path'], + 'ext': ext, 'created_at': share['created_at'], 'downloads': share['downloads'], 'is_dir': bool(share['is_dir']) diff --git a/templates/base.html b/templates/base.html index 08cfdbd..10b2e9f 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,742 +1,742 @@ - - - - - - {% block title %}DVS云盘{% endblock %} - - - - - - - - - - - - - - - - - - {% block extra_css %}{% endblock %} - - - - - - -
- {% block content %}{% endblock %} -
- - - - - - - - - - - {% block extra_js %}{% endblock %} - - - - + + + + + + {% block title %}DVS云盘{% endblock %} + + + + + + + + + + + + + + + + + + {% block extra_css %}{% endblock %} + + + + + + +
+ {% block content %}{% endblock %} +
+ + + + + + + + + + + {% block extra_js %}{% endblock %} + + + + \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 71536ce..abe7bcc 100644 --- a/templates/index.html +++ b/templates/index.html @@ -57,186 +57,201 @@ {% endif %} {% endwith %} - +

我的文件

管理你的文件与文件夹

-
+
+ +
+ +
+ + +
+ +
+ + + 分享 +
- + +{% if items and items|length > 0 %} +
+ + | + + + 已选 0 项 +
+{% endif %} + +
- 文件列表 + + 文件列表
共 {{ items|length if items else 0 }} 项
+
{% if items and items|length > 0 %} - {% for item in items %} -
- -
+
+ {% for item in items %} +
+ +
+ +
- - {% if item.is_dir %} - - {% elif item.ext in ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg', 'ico'] %} - - {% elif item.ext in ['mp4', 'avi', 'mov', 'mkv', 'flv', 'wmv', 'webm', 'm4v'] %} - - {% elif item.ext in ['mp3', 'wav', 'flac', 'aac', 'ogg', 'm4a', 'wma'] %} - - {% elif item.ext == 'pdf' %} - - {% elif item.ext in ['doc', 'docx'] %} - - {% elif item.ext in ['xls', 'xlsx', 'csv'] %} - - {% elif item.ext in ['ppt', 'pptx'] %} - - {% elif item.ext in ['zip', 'rar', '7z', 'tar', 'gz', 'bz2'] %} - - {% elif item.ext in ['py', 'js', 'java', 'c', 'cpp', 'h', 'html', 'css', 'php', 'rb', 'go', 'rs', 'swift', 'kt'] %} - - {% elif item.ext in ['txt', 'md', 'log', 'ini', 'cfg', 'conf'] %} - - {% elif item.ext in ['exe', 'msi', 'dmg', 'pkg', 'deb', 'rpm', 'appimage'] %} - - {% elif item.ext in ['iso', 'img', 'vhd', 'vmdk'] %} - - {% elif item.ext in ['psd', 'ai', 'eps'] %} - - {% elif item.ext in ['bin', 'dat', 'db'] %} - - {% else %} - - {% endif %} -
- - -
-
- -
- {% if item.is_dir %} - {{ item.name }} - {% else %} - {{ item.name }} - {% endif %} - - - {% if not item.is_dir %} - - - {% if item.ext %} - {{ item.ext|upper }} - - {% if item.ext in ['mp3', 'wav', 'flac', 'aac', 'ogg', 'm4a', 'wma'] %}音频文件 - {% elif item.ext in ['mp4', 'avi', 'mov', 'mkv', 'flv', 'wmv', 'webm', 'm4v'] %}视频文件 - {% elif item.ext in ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg', 'ico'] %}图片文件 - {% elif item.ext == 'pdf' %}PDF文档 - {% elif item.ext in ['doc', 'docx'] %}Word文档 - {% elif item.ext in ['xls', 'xlsx', 'csv'] %}Excel表格 - {% elif item.ext in ['ppt', 'pptx'] %}演示文稿 - {% elif item.ext in ['zip', 'rar', '7z', 'tar', 'gz', 'bz2'] %}压缩文件 - {% elif item.ext in ['py', 'js', 'java', 'c', 'cpp', 'h', 'html', 'css', 'php', 'rb', 'go', 'rs', 'swift', 'kt'] %}代码文件 - {% elif item.ext in ['txt', 'md', 'log', 'ini', 'cfg', 'conf'] %}文本文件 - {% elif item.ext in ['exe', 'msi', 'dmg', 'pkg', 'deb', 'rpm', 'appimage'] %}可执行文件 - {% elif item.ext in ['iso', 'img', 'vhd', 'vmdk'] %}磁盘镜像 - {% elif item.ext in ['psd', 'ai', 'eps'] %}设计文件 - {% elif item.ext in ['bin', 'dat', 'db'] %}二进制文件 - {% else %}其他文件 - {% endif %} - {% else %} - 未知类型 - {% endif %} - - {% else %} - - - 文件夹目录 - - {% endif %} - - {% if item.previewable %} - 可预览 - {% endif %} -
+ +
- -
- {% if item.is_dir %} - 文件夹 - {% else %} - {{ item.size or "未知大小" }} - {% endif %} - {{ item.modified or "未知" }} - {% if not item.is_dir %} - 扩展名: {{ item.ext|upper if item.ext else '无' }} - {% endif %} + {% if item.is_dir %} + + {% elif item.ext in ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg', 'ico'] %} + + {% elif item.ext in ['mp4', 'avi', 'mov', 'mkv', 'flv', 'wmv', 'webm', 'm4v'] %} + + {% elif item.ext in ['mp3', 'wav', 'flac', 'aac', 'ogg', 'm4a', 'wma'] %} + + {% elif item.ext == 'pdf' %} + + {% elif item.ext in ['doc', 'docx'] %} + + {% elif item.ext in ['xls', 'xlsx', 'csv'] %} + + {% elif item.ext in ['ppt', 'pptx'] %} + + {% elif item.ext in ['zip', 'rar', '7z', 'tar', 'gz', 'bz2'] %} + + {% elif item.ext in ['py', 'js', 'java', 'c', 'cpp', 'h', 'html', 'css', 'php', 'rb', 'go', 'rs', 'swift', 'kt'] %} + + {% elif item.ext in ['txt', 'md', 'log', 'ini', 'cfg', 'conf'] %} + + {% elif item.ext in ['exe', 'msi', 'dmg', 'pkg', 'deb', 'rpm', 'appimage'] %} + + {% else %} + + {% endif %} +
+ + +
+
+ +
+ {% if item.is_dir %} + {{ item.name }} + {% else %} + {{ item.name }} + {% endif %} + + {% if not item.is_dir %} + + + {{ item.ext|upper if item.ext else '文件' }} + + {% else %} + + 文件夹 + + {% endif %} + + {% if item.previewable %} + 预览 + {% endif %} +
+ + +
+ {% if item.is_dir %} + 文件夹 + {% else %} + {{ item.size or "未知大小" }} + {% endif %} + {{ item.modified or "未知" }} +
-
- -
- - {% if item.is_dir %} - - - - {% endif %} - - {% if not item.is_dir %} - - - - {% if item.previewable %} - - + +
+ {% if item.is_dir %} + + {% endif %} - {% endif %} - - - - + + {% if not item.is_dir %} + + + + {% if item.previewable %} + + + + {% endif %} + {% endif %} + + + + +
-
- {% endfor %} + {% endfor %} + + + + {% else %}
@@ -249,7 +264,7 @@
- +