mirror of
https://github.com/KingHWJ/WeReadBoard.git
synced 2026-11-03 18:24:58 +08:00
添加书架刷新按钮 + 后端服务保活方案
前端: - 书架筛选栏新增「↻ 刷新」按钮,点击重新加载分类和书架数据 - 新增 refreshShelf() 函数,带 loading 状态反馈 - 新增 .shelf-refresh-btn CSS 样式 后端保活: - 新增 start_server.sh 启动脚本 (start/daemon/stop/restart/status) - 新增 com.weread-dashboard.plist launchd 服务配置 - KeepAlive=true: 崩溃自动重启 - RunAtLoad=true: 开机自动启动 - 日志输出到 /tmp/weread_server.log
This commit is contained in:
1 parent
7d983e38da
commit
8333230f77
6 files changed
+161
No files matched your search
@@ -318,6 +318,23 @@ function filterByCategory(fullCategory) {
|
||||
loadShelf(1);
|
||||
}
|
||||
|
||||
// ===== 书架刷新 =====
|
||||
|
||||
async function refreshShelf() {
|
||||
const btn = document.getElementById("shelfRefreshBtn");
|
||||
btn.disabled = true;
|
||||
btn.classList.add("loading");
|
||||
btn.textContent = "↻ 刷新中...";
|
||||
try {
|
||||
await loadShelfCategories();
|
||||
await loadShelf(1);
|
||||
} finally {
|
||||
btn.disabled = false;
|
||||
btn.classList.remove("loading");
|
||||
btn.textContent = "↻ 刷新";
|
||||
}
|
||||
}
|
||||
|
||||
// ===== 初始化 =====
|
||||
|
||||
document.addEventListener("DOMContentLoaded", async () => {
|
||||
|
||||
Reference in new issue
Block a user