From f13328858616fdf8e497f62ecc0f35a17b57214e Mon Sep 17 00:00:00 2001 From: qing <1776177662@qq.com> Date: Thu, 23 Jul 2026 12:04:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=87=E6=A1=88=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/fsys.py | 10 +++++++++- static/public/__view.html | 4 ++++ static/public/css/theme.css | 18 +++++++++++++++++- static/public/css/view.css | 14 ++++++++++++++ static/public/dnfs.html | 3 +++ static/public/login.html | 3 +++ static/public/register.html | 3 +++ 7 files changed, 53 insertions(+), 2 deletions(-) diff --git a/static/fsys.py b/static/fsys.py index 566d313..221ea78 100644 --- a/static/fsys.py +++ b/static/fsys.py @@ -21,7 +21,7 @@ else: logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) -file_handler = RotatingFileHandler('app.log', maxBytes=10485760, backupCount=10) +file_handler = RotatingFileHandler(os.path.join(BASE_DIR, 'app.log'), maxBytes=10485760, backupCount=10) file_handler.setFormatter(logging.Formatter( '%(asctime)s %(levelname)s: %(message)s' )) @@ -37,6 +37,8 @@ CORS(app) # ==================== 配置文件加载 ==================== CONFIG_FILE = args.config +if not os.path.isabs(CONFIG_FILE): + CONFIG_FILE = os.path.join(BASE_DIR, CONFIG_FILE) file_config = { 'server': {'host': '0.0.0.0', 'port': '5000'}, @@ -54,6 +56,8 @@ if os.path.exists(CONFIG_FILE): file_config[section][key] = value HTML_ROOT_DIR = file_config['directory']['root'] +if HTML_ROOT_DIR and not os.path.isabs(HTML_ROOT_DIR): + HTML_ROOT_DIR = os.path.join(BASE_DIR, HTML_ROOT_DIR) FILESYSTEM_ENABLED = bool(HTML_ROOT_DIR and HTML_ROOT_DIR.strip()) if FILESYSTEM_ENABLED: @@ -67,6 +71,10 @@ if FILESYSTEM_ENABLED: SSL_ENABLED = file_config['ssl'].get('enabled', 'false').lower() == 'true' SSL_CERT_FILE = file_config['ssl'].get('cert_file', 'cert.pem') SSL_KEY_FILE = file_config['ssl'].get('key_file', 'key.pem') +if not os.path.isabs(SSL_CERT_FILE): + SSL_CERT_FILE = os.path.join(BASE_DIR, SSL_CERT_FILE) +if not os.path.isabs(SSL_KEY_FILE): + SSL_KEY_FILE = os.path.join(BASE_DIR, SSL_KEY_FILE) # 视图文件名:根路径与目录访问时固定返回此静态文件,由前端 JS 调用 /api/filelist 拉取数据 VIEW_FILE = '__view.html' diff --git a/static/public/__view.html b/static/public/__view.html index c9073ae..1690cd7 100644 --- a/static/public/__view.html +++ b/static/public/__view.html @@ -43,6 +43,10 @@ + + diff --git a/static/public/css/theme.css b/static/public/css/theme.css index adda535..e15794f 100644 --- a/static/public/css/theme.css +++ b/static/public/css/theme.css @@ -50,7 +50,8 @@ body { min-height: 100vh; display: flex; - justify-content: center; + flex-direction: column; + align-items: center; background: var(--bg); color: var(--fg); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', Roboto, Arial, sans-serif; @@ -245,6 +246,21 @@ blockquote { color: var(--fg-secondary); } +/* ===== Footer ===== */ +.footer { + margin-top: auto; + padding-top: 1.5rem; + text-align: center; + font-size: 0.75rem; + color: var(--muted); +} +.footer a { + color: var(--muted); + text-decoration: none; + transition: color 0.15s; +} +.footer a:hover { color: var(--accent); } + /* ===== Responsive ===== */ @media (max-width: 480px) { body { padding: 1rem 0.8rem; } diff --git a/static/public/css/view.css b/static/public/css/view.css index 4824821..2151ae2 100644 --- a/static/public/css/view.css +++ b/static/public/css/view.css @@ -331,6 +331,20 @@ body { line-height: 1.6; } +/* ===== 页脚 ===== */ +.footer { + text-align: center; + padding: 24px 20px 32px; + font-size: 12px; + color: var(--muted); +} +.footer a { + color: var(--muted); + text-decoration: none; + transition: color 0.15s; +} +.footer a:hover { color: var(--accent); } + /* ===== 响应式 ===== */ @media (max-width: 480px) { .header { padding: 0 14px; height: 50px; } diff --git a/static/public/dnfs.html b/static/public/dnfs.html index 7a6ef8d..59160d2 100644 --- a/static/public/dnfs.html +++ b/static/public/dnfs.html @@ -38,6 +38,9 @@ + diff --git a/static/public/login.html b/static/public/login.html index d218fa3..89b47f9 100644 --- a/static/public/login.html +++ b/static/public/login.html @@ -39,6 +39,9 @@ + diff --git a/static/public/register.html b/static/public/register.html index 361712b..3d03899 100644 --- a/static/public/register.html +++ b/static/public/register.html @@ -35,6 +35,9 @@ +