Phase 8 Complete: Sync Audit Log + Frontend Integration

- Thêm audit/sync_audit.py: Ghi lịch sử sync vào audit/sync_log.json
- Thêm API endpoints: /sync/history, /sync/history/{run_id}
- Frontend: Nút 'Lịch sử đồng bộ' + panel expand chi tiết từng file
- Sửa frontend served từ backend (http://localhost:8000)
- Cập nhật DEPLOYMENT_GUIDE với hướng dẫn chạy localhost
- Cập nhật ARCHITECTURE_MAP: Phase 8 hoàn thành
This commit is contained in:
2026-05-11 08:49:10 +00:00
parent f937d1a98e
commit 78372d18ee
8 changed files with 577 additions and 18 deletions

View File

@@ -344,6 +344,122 @@ textarea {
.source-item h4 { font-size: 14px; margin-bottom: 5px; color: var(--primary); }
.source-item p { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
/* History Panel */
.history-item {
background: rgba(255, 255, 255, 0.05);
border: 1px solid var(--glass-border);
border-radius: 12px;
padding: 15px;
margin-bottom: 12px;
cursor: pointer;
transition: 0.3s;
}
.history-item:hover {
background: rgba(255, 255, 255, 0.08);
}
.history-item .history-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
.history-item .history-time {
font-size: 12px;
color: var(--text-muted);
}
.history-item .history-status {
font-size: 11px;
padding: 2px 8px;
border-radius: 6px;
font-weight: 600;
}
.history-item .history-status.completed {
background: rgba(16, 185, 129, 0.2);
color: #10b981;
}
.history-item .history-status.failed {
background: rgba(239, 68, 68, 0.2);
color: #ef4444;
}
.history-item .history-status.running {
background: rgba(139, 92, 246, 0.2);
color: #8b5cf6;
}
.history-item .history-summary {
display: flex;
gap: 12px;
font-size: 12px;
color: var(--text-muted);
}
.history-item .history-summary span {
display: flex;
align-items: center;
gap: 4px;
}
.history-files {
margin-top: 10px;
padding-top: 10px;
border-top: 1px solid var(--glass-border);
display: none;
}
.history-item.expanded .history-files {
display: block;
}
.history-file {
display: flex;
justify-content: space-between;
align-items: center;
padding: 6px 0;
font-size: 12px;
border-bottom: 1px solid rgba(255,255,255,0.03);
}
.history-file:last-child {
border-bottom: none;
}
.history-file-name {
color: var(--text-main);
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.history-file-status {
font-size: 10px;
padding: 2px 6px;
border-radius: 4px;
margin-left: 8px;
}
.history-file-status.indexed {
background: rgba(16, 185, 129, 0.2);
color: #10b981;
}
.history-file-status.skipped {
background: rgba(234, 179, 8, 0.2);
color: #eab308;
}
.history-file-status.error {
background: rgba(239, 68, 68, 0.2);
color: #ef4444;
}
/* Login Screen */
.login-screen {
position: fixed;