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.
This commit is contained in:
wood chen 2024-12-02 05:58:56 +08:00
parent 32fb07a2ee
commit 226135aea2
2 changed files with 3 additions and 20 deletions

View File

@ -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

View File

@ -286,23 +286,6 @@
</div>
</div>
</div>
${Object.keys(data.top_referers).length > 0 ? `
<div class="stats-summary">
<div class="stats-header">
<h2>🔗 访问来源</h2>
</div>
<div class="referers-list">
${Object.entries(data.top_referers)
.sort(([,a], [,b]) => b - a)
.map(([referer, count]) => `
<div class="referer-item">
<span class="referer">${referer || '直接访问'}</span>
<span class="count">${count}</span>
</div>
`).join('')}
</div>
</div>
` : ''}
</div>
`;