{% extends base.html %} {% block title %} File Server {% end %} {% block content %}

点击上传文件夹,或将文件拖拽到此处(截图可直接Ctrl+V粘贴上传)

{% import os, urllib.parse %}
{% set paths = handler.request.path.rstrip('/').split('/') %} {% for i, path in enumerate(paths) %} {% if i == 0 %} {% else %} {{ urllib.parse.unquote(path) }} {% end %} {% end %}
{% if handler.get_cookie('display') %} {% else %} {% for entry in entries %} {% end %}
{% if handler.get_cookie('preview') and entry[0].suffix.lower() in ['.jpg', '.jpeg', '.png', '.bmp', '.gif', '.webp'] %} {% elif handler.get_cookie('preview') and entry[0].suffix.lower() in [] %} {% elif handler.get_cookie('preview') and entry[0].suffix.lower() in ['.mp3', '.amr', '.ogg', '.wav'] %} {% else %} {% set icon = 'folder.png' if entry[3] else handler.icon.get(entry[0].suffix.lower(), 'file.png') %} {% end %} {{ entry[0].name }} {% if entry[0].suffix.lower() in ['.tar', '.gz', '.bz2', '.xz', '.tgz', '.bz2', '.bz', '.zip'] %} {% elif entry[0].suffix.lower() in ['.json', '.yml', '.yaml', '.jpg', '.jpeg', '.ico', '.bmp', '.png', '.mp3', '.mp4', '.ogg', '.pdf', '.txt', '.md', '.py', '.sh', '.h', '.c', '.cpp', '.js', '.css', '.html', '.java', '.go', '.ini', '.vue', '.ipynb'] %} {% elif entry[3] %} {% else %} 下载 {% end %} {{ entry[1] }} {{ entry[2] }}
{% end %}
{% end %} {% block js %} {% end %}