auto-sync: 2026-05-17 11:26:28

This commit is contained in:
cfdaily
2026-05-17 11:26:28 +08:00
parent 3c5d2db008
commit 044a3d1a63
+20
View File
@@ -24,6 +24,9 @@ export default function App() {
const countdown = useStore((s) => s.countdown);
const loadAll = useStore((s) => s.loadAll);
const toast = useStore((s) => s.toast);
const projects = useStore((s) => s.projects);
const selectedProjectId = useStore((s) => s.selectedProjectId);
const setSelectedProjectId = useStore((s) => s.setSelectedProjectId);
useEffect(() => {
startPolling();
@@ -74,6 +77,23 @@ export default function App() {
{syncOk ? '✅ 同步正常' : syncOk === false ? '❌ 服务器未启动' : '⏳ 连接中…'}
</span>
<span className="chip">{activeTasks.length} </span>
{/* v2.6: 项目切换器 */}
{Object.keys(projects).length > 0 && (
<select
value={selectedProjectId || ''}
onChange={(e) => setSelectedProjectId(e.target.value || null)}
style={{
fontSize: 11, padding: '3px 8px', borderRadius: 6,
border: '1px solid var(--line)', background: 'var(--panel)',
color: 'var(--fg)', cursor: 'pointer',
}}
>
<option value=""></option>
{Object.entries(projects).map(([pid, info]: [string, any]) => (
<option key={pid} value={pid}>{info.name || pid}</option>
))}
</select>
)}
<button className="btn-refresh" onClick={() => loadAll()}>
</button>