From 226135aea25e5da83f787a295de5314383bcdac6 Mon Sep 17 00:00:00 2001 From: wood chen Date: Mon, 2 Dec 2024 05:58:56 +0800 Subject: [PATCH] refactor(public, workflows): update public file paths and remove top referers display - Changed the file paths in the Docker workflow to reflect the new directory structure for public assets. - Removed the top referers display section from index.html to streamline the user interface and improve performance. - Ensured proper cleanup and permissions for the new public data directory in the Docker workflow. --- .github/workflows/docker.yml | 6 +++--- public/index.html | 17 ----------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c4c78b4..d1c6e63 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -80,13 +80,13 @@ jobs: unzip -o /tmp/public.zip -d /tmp/public_temp # 删除目标目录中的现有文件 - rm -rf /opt/1panel/docker/compose/random-api-go/public/* + rm -rf /opt/1panel/docker/compose/random-api-go/data/public/* # 移动新文件到目标目录 - mv -f /tmp/public_temp/public/* /opt/1panel/docker/compose/random-api-go/public/ + mv -f /tmp/public_temp/public/* /opt/1panel/docker/compose/random-api-go/data/public/ # 设置目录及其子文件的所有权和权限 - chmod -R 0755 /opt/1panel/docker/compose/random-api-go/public + chmod -R 0755 /opt/1panel/docker/compose/random-api-go/data/public # 清理临时文件 rm /tmp/public.zip diff --git a/public/index.html b/public/index.html index 79d2b80..7d00fe5 100644 --- a/public/index.html +++ b/public/index.html @@ -286,23 +286,6 @@ - ${Object.keys(data.top_referers).length > 0 ? ` -
-
-

🔗 访问来源

-
-
- ${Object.entries(data.top_referers) - .sort(([,a], [,b]) => b - a) - .map(([referer, count]) => ` -
- ${referer || '直接访问'} - ${count} -
- `).join('')} -
-
- ` : ''} `;