This commit adds a dedicated task list page to view and manage all video learning sessions, solving the issue where users couldn't find their background tasks after navigating away. Features: - New sessions.html page with card-based layout for all sessions - Real-time polling for session status updates (every 3 seconds) - Session control buttons (pause/resume/stop/delete) - localStorage integration for session persistence across page refreshes - Navigation links added to main page and video learning page - Empty state UI when no sessions exist New files: - dashboard/static/sessions.html - Task list page - dashboard/static/js/sessions.js - Sessions module with API calls - dashboard/static/css/sessions.css - Styling for sessions page Modified files: - dashboard/api/video_learning.py - Added /sessions/list endpoint - dashboard/static/index.html - Added "任务列表" button - dashboard/static/video-learning.html - Added "任务列表" button and localStorage Co-Authored-By: Claude <noreply@anthropic.com>
233 lines
3.7 KiB
CSS
233 lines
3.7 KiB
CSS
/**
|
|
* Video Learning Sessions Page Styles
|
|
*/
|
|
|
|
/* Sessions Grid */
|
|
.sessions-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
|
|
gap: 20px;
|
|
padding: 20px;
|
|
}
|
|
|
|
/* Session Card */
|
|
.session-card {
|
|
background: white;
|
|
border-radius: 8px;
|
|
padding: 20px;
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
transition: transform 0.2s, box-shadow 0.2s;
|
|
}
|
|
|
|
.session-card:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
.session-card.completed {
|
|
opacity: 0.8;
|
|
}
|
|
|
|
/* Session Header */
|
|
.session-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.session-platform {
|
|
font-weight: 600;
|
|
font-size: 16px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.session-platform::before {
|
|
content: '';
|
|
width: 24px;
|
|
height: 24px;
|
|
background-size: contain;
|
|
background-repeat: no-repeat;
|
|
}
|
|
|
|
/* Session Status */
|
|
.session-status {
|
|
padding: 4px 12px;
|
|
border-radius: 12px;
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.session-status.status-active {
|
|
background: #10b981;
|
|
color: white;
|
|
}
|
|
|
|
.session-status.status-paused {
|
|
background: #f59e0b;
|
|
color: white;
|
|
}
|
|
|
|
.session-status.status-completed {
|
|
background: #6b7280;
|
|
color: white;
|
|
}
|
|
|
|
/* Session ID */
|
|
.session-id {
|
|
margin-bottom: 12px;
|
|
padding: 8px 12px;
|
|
background: #f3f4f6;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.session-id small {
|
|
display: block;
|
|
font-size: 11px;
|
|
color: #6b7280;
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.session-id code {
|
|
font-family: 'Monaco', 'Consolas', monospace;
|
|
font-size: 12px;
|
|
color: #374151;
|
|
}
|
|
|
|
/* Session Progress */
|
|
.session-progress {
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.progress-info {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
font-size: 14px;
|
|
color: #374151;
|
|
margin-bottom: 6px;
|
|
}
|
|
|
|
.progress-bar {
|
|
height: 8px;
|
|
background: #e5e7eb;
|
|
border-radius: 4px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.progress-fill {
|
|
height: 100%;
|
|
background: linear-gradient(90deg, #3b82f6, #8b5cf6);
|
|
transition: width 0.3s ease;
|
|
}
|
|
|
|
/* Session Duration */
|
|
.session-duration {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
margin-bottom: 16px;
|
|
font-size: 14px;
|
|
color: #6b7280;
|
|
}
|
|
|
|
/* Session Actions */
|
|
.session-actions {
|
|
display: flex;
|
|
gap: 8px;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.session-actions .btn {
|
|
flex: 1;
|
|
min-width: 80px;
|
|
}
|
|
|
|
/* Empty State */
|
|
.empty-state {
|
|
text-align: center;
|
|
padding: 80px 20px;
|
|
color: #6b7280;
|
|
}
|
|
|
|
.empty-state svg {
|
|
margin-bottom: 20px;
|
|
color: #d1d5db;
|
|
}
|
|
|
|
.empty-state h2 {
|
|
font-size: 24px;
|
|
margin-bottom: 8px;
|
|
color: #374151;
|
|
}
|
|
|
|
.empty-state p {
|
|
font-size: 16px;
|
|
margin-bottom: 24px;
|
|
}
|
|
|
|
/* Button Styles */
|
|
.btn-sm {
|
|
padding: 6px 12px;
|
|
font-size: 13px;
|
|
}
|
|
|
|
/* Toast Notifications */
|
|
.toast-container {
|
|
position: fixed;
|
|
bottom: 20px;
|
|
right: 20px;
|
|
z-index: 1000;
|
|
}
|
|
|
|
.toast {
|
|
padding: 12px 20px;
|
|
border-radius: 6px;
|
|
margin-bottom: 10px;
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
animation: slideIn 0.3s ease;
|
|
}
|
|
|
|
.toast.info {
|
|
background: #3b82f6;
|
|
color: white;
|
|
}
|
|
|
|
.toast.success {
|
|
background: #10b981;
|
|
color: white;
|
|
}
|
|
|
|
.toast.error {
|
|
background: #ef4444;
|
|
color: white;
|
|
}
|
|
|
|
@keyframes slideIn {
|
|
from {
|
|
transform: translateX(100%);
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
transform: translateX(0);
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
/* Responsive Design */
|
|
@media (max-width: 768px) {
|
|
.sessions-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.session-actions {
|
|
flex-direction: column;
|
|
}
|
|
|
|
.session-actions .btn {
|
|
width: 100%;
|
|
}
|
|
}
|