()
| 1447 | } |
| 1448 | |
| 1449 | async function boot() { |
| 1450 | bindEvents(); |
| 1451 | const health = await api("/api/health"); |
| 1452 | $("healthText").textContent = DEMO_MODE |
| 1453 | ? "GitHub Pages 预览模式" |
| 1454 | : health.database_exists ? "运行环境就绪" : "请先运行 paperflow init"; |
| 1455 | await loadUsers(); |
| 1456 | await loadRoles(); |
| 1457 | await Promise.allSettled([ |
| 1458 | refreshDashboard(), |
| 1459 | refreshWikiStats(), |
| 1460 | refreshSettings(), |
| 1461 | loadSourceOptions(), |
| 1462 | loadLatestPush(), |
| 1463 | refreshProfile(), |
| 1464 | refreshMustRead(), |
| 1465 | ]); |
| 1466 | await refreshDailyTaskStatus({ silent: true }); |
| 1467 | if (!["queued", "running"].includes(state.dailyTaskStatus)) { |
| 1468 | setStatus("就绪"); |
| 1469 | } |
| 1470 | } |
| 1471 | |
| 1472 | boot().catch((error) => { |
| 1473 | setStatus(localizeError(error.message || String(error))); |
no test coverage detected