Files
yu-zhi-ran/platform/frontend/logs.html
T

230 lines
12 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>宇之然内容创作平台 - 系统日志</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f5f7fa; min-height: 100vh; }
/* 导航栏 */
.navbar { background: linear-gradient(to right, #2563eb, #1d4ed8); color: white; padding: 1rem 2rem; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.nav-title { font-size: 1.5rem; font-weight: bold; text-align: center; }
/* 侧边栏 */
.sidebar { width: 160px; position: fixed; height: 100vh; left: 0; top: 0; background: #f3f4f6; border-right: 1px solid #e5e7eb; z-index: 10; }
.sidebar a { display: block; padding: 0.75rem 1rem; color: #4b5563; text-decoration: none; border-radius: 0.5rem; margin-bottom: 0.25rem; transition: all 0.2s; }
.sidebar a:hover { background-color: #e5e7eb; }
.sidebar a.active { background-color: #dbeafe; color: #2563eb; font-weight: 600; }
/* 主内容区 */
.main-content { margin-left: 160px; min-height: 100vh; padding: 2rem; max-width: calc(100vw - 160px); }
/* 卡片 */
.card { background: white; border-radius: 0.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); padding: 1.5rem; margin-bottom: 1.5rem; }
.card h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 1rem; }
/* 按钮 */
.btn { padding: 0.5rem 1rem; border: none; border-radius: 0.375rem; cursor: pointer; font-size: 0.875rem; transition: all 0.2s; }
.btn-primary { background-color: #3b82f6; color: white; }
.btn-primary:hover { background-color: #2563eb; }
.btn-success { background-color: #10b981; color: white; }
.btn-success:hover { background-color: #059669; }
.btn-warning { background-color: #f59e0b; color: white; }
.btn-warning:hover { background-color: #d97706; }
.btn-danger { background-color: #ef4444; color: white; }
.btn-danger:hover { background-color: #dc2626; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
/* 批量操作按钮组 */
.batch-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.batch-buttons button { min-width: 80px; }
/* 筛选标签 */
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filter-tag { padding: 0.25rem 0.75rem; border: 1px solid #d1d5db; border-radius: 9999px; cursor: pointer; font-size: 0.875rem; transition: all 0.2s; }
.filter-tag:hover { background-color: #f3f4f6; }
.filter-tag.active { background-color: #3b82f6; color: white; border-color: #3b82f6; }
/* 表格 */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem; text-align: left; border-bottom: 1px solid #e5e7eb; }
th { background-color: #f9fafb; font-weight: 600; }
tr:hover { background-color: #f9fafb; }
/* 状态徽章 */
.status-badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.125rem 0.5rem; border-radius: 9999px; font-size: 0.75rem; }
.status-pending { background-color: #fef3c7; color: #92400e; }
.status-review { background-color: #dbeafe; color: #1e40af; }
.status-ready { background-color: #d1fae5; color: #065f46; }
.status-published { background-color: #ddd6fe; color: #5b21b6; }
/* 进度条 */
.progress-bar { width: 100%; height: 0.5rem; background-color: #e5e7eb; border-radius: 9999px; overflow: hidden; }
.progress-fill { height: 100%; background-color: #3b82f6; transition: width 0.3s ease; }
/* 响应式 */
@media (max-width: 768px) {
.sidebar { display: none; }
.main-content { margin-left: 0; max-width: 100vw; padding: 1rem; }
}
/* 加载覆盖层 */
.loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.8); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.loading-text { margin-left: 1rem; font-size: 1.125rem; }
</style>
</head>
<body>
<!-- 导航栏 -->
<div class="navbar">
<div class="nav-title">宇之然内容创作平台 - 系统日志</div>
</div>
<!-- 侧边栏 -->
<div class="sidebar">
<a href="/" class="">📊 系统概览</a>
<a href="/topics.html" class="">📋 选题管理</a>
<a href="/logs.html" class="active">📄 系统日志</a>
<a href="/users.html" class="">👥 用户管理</a>
</div>
<!-- 主内容区 -->
<div class="main-content">
<!-- 系统日志 页面内容将在这里动态生成 -->
</div>
<script>
// 极简 JavaScript - 动态生成页面内容
document.addEventListener('DOMContentLoaded', function() {
const mainContent = document.querySelector('.main-content');
// 系统日志 页面的具体内容
switch(logs) {
case 'topics':
generateTopicsPage();
break;
case 'logs':
generateLogsPage();
break;
case 'users':
generateUsersPage();
break;
default:
mainContent.innerHTML = '<h2>页面加载中...</h2>';
}
});
function generateTopicsPage() {
var topicsData = [
{ id: 'A01', title: '可持续发展趋势分析', field: '环保', status: 'pending', compliance: 85, created_at: '2026-04-27 10:30', generated_at: '-', published_at: '-', updated_at: '2026-04-27 10:30' },
{ id: 'B02', title: 'AI在内容创作中的应用', field: '科技', status: 'review', compliance: 92, created_at: '2026-04-27 11:15', generated_at: '2026-04-27 11:45', published_at: '-', updated_at: '2026-04-27 11:45' },
{ id: 'C03', title: '数字化转型案例研究', field: '商业', status: 'ready', compliance: 78, created_at: '2026-04-27 12:00', generated_at: '2026-04-27 12:30', published_at: '2026-04-27 13:00', updated_at: '2026-04-27 13:00' }
];
var html = '';
html += '<div class="card">';
html += '<h2>📋 选题管理</h2>';
// 批量操作
html += '<div class="batch-buttons">';
html += '<button class="btn btn-primary" onclick="alert(\'批量刷新功能\')">🔄 批量刷新</button>';
html += '<button class="btn btn-success" onclick="alert(\'批量创作功能\')">▶ 批量创作</button>';
html += '<button class="btn btn-warning" onclick="alert(\'批量优化功能\')">🔍 批量优化</button>';
html += '<span style="margin-left: auto; color: #6b7280; font-size: 0.875rem;">已选 0 项</span>';
html += '</div>';
// 筛选标签
html += '<div class="filters">';
html += '<div class="filter-tag active" onclick="filterTopics(\'all\')">全部 (3)</div>';
html += '<div class="filter-tag" onclick="filterTopics(\'pending\')">待处理 (1)</div>';
html += '<div class="filter-tag" onclick="filterTopics(\'review\')">待审查 (1)</div>';
html += '<div class="filter-tag" onclick="filterTopics(\'ready\')">待发布 (1)</div>';
html += '<div class="filter-tag" onclick="filterTopics(\'published\')">已发布 (0)</div>';
html += '</div>';
// 表格
html += '<div class="table-container">';
html += '<table>';
html += '<thead><tr><th><input type="checkbox" onclick="toggleSelectAll(this)"></th><th>ID</th><th>标题</th><th>领域</th><th>优先级</th><th>状态</th><th>合规分</th><th>创建时间</th><th>创作时间</th><th>发布时间</th><th>更新时间</th><th>操作</th></tr></thead>';
html += '<tbody>';
for (var i = 0; i < topicsData.length; i++) {
var topic = topicsData[i];
html += '<tr data-status="' + topic.status + '">';
html += '<td><input type="checkbox" onclick="toggleSelectTopic('' + topic.id + '')"></td>';
html += '<td>' + topic.id + '</td>';
html += '<td>' + topic.title + '</td>';
html += '<td>' + topic.field + '</td>';
html += '<td>' + topic.compliance + '%</td>';
html += '<td><span class="status-badge status-' + topic.status + '">' + getStatusText(topic.status) + '</span></td>';
html += '<td><div class="progress-bar"><div class="progress-fill" style="width: ' + topic.compliance + '%"></div></div></td>';
html += '<td>' + formatDate(topic.created_at) + '</td>';
html += '<td>' + (topic.generated_at === '-' ? '-' : formatDate(topic.generated_at)) + '</td>';
html += '<td>' + (topic.published_at === '-' ? '-' : formatDate(topic.published_at)) + '</td>';
html += '<td>' + formatDate(topic.updated_at) + '</td>';
html += '<td><button class="btn btn-primary btn-sm" onclick="previewTopic('' + topic.id + '')">预览</button>';
html += '<button class="btn btn-success btn-sm" onclick="createTopic('' + topic.id + '')">创作</button>';
html += '<button class="btn btn-warning btn-sm" onclick="optimizeTopic('' + topic.id + '')">审查</button>';
html += '<button class="btn btn-primary btn-sm" onclick="publishTopic('' + topic.id + '')">发布</button>';
html += '<button class="btn btn-danger btn-sm" onclick="deleteTopic('' + topic.id + '')">删除</button></td>';
html += '</tr>';
}
html += '</tbody></table></div></div>';
mainContent.innerHTML = html;
}
function getStatusText(status) {
var statusMap = {
pending: '待处理',
review: '待审查',
ready: '待发布',
published: '已发布'
};
return statusMap[status] || status;
}
function formatDate(dateStr) {
if (!dateStr || dateStr === '-') return '-';
var date = new Date(dateStr);
return date.toLocaleString('zh-CN', {
year: 'numeric', month: '2-digit', day: '2-digit',
hour: '2-digit', minute: '2-digit'
});
}
function filterTopics(filter) {
var rows = document.querySelectorAll('tbody tr');
rows.forEach(function(row) {
if (filter === 'all') {
row.style.display = '';
} else {
var status = row.getAttribute('data-status');
row.style.display = (status === filter) ? '' : 'none';
}
});
}
function toggleSelectAll(checkbox) {
var checkboxes = document.querySelectorAll('tbody input[type="checkbox"]');
checkboxes.forEach(function(cb) { cb.checked = checkbox.checked; });
}
function toggleSelectTopic(id) {
console.log('选中选题:', id);
}
function previewTopic(id) { alert('预览选题: ' + id); }
function createTopic(id) { alert('创作选题: ' + id); }
function optimizeTopic(id) { alert('优化选题: ' + id); }
function publishTopic(id) { alert('发布选题: ' + id); }
function deleteTopic(id) {
if (confirm('确定删除该选题?删除后无法恢复。')) {
alert('删除选题: ' + id);
}
}
</script>
</body>
</html>