File size: 13,511 Bytes
f5eddc6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | <!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>新闻管理后台</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<style>
.sidebar {
background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
}
.content-card {
background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
}
.btn-primary {
background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}
.btn-primary:hover {
background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
}
</style>
</head>
<body class="bg-gray-100 font-sans">
<!-- Admin Header -->
<header class="bg-white shadow-sm">
<div class="container mx-auto px-4 py-4">
<div class="flex justify-between items-center">
<div class="flex items-center space-x-3">
<div class="w-3 h-8 bg-red-600 rounded"></div>
<h1 class="text-2xl font-bold text-gray-800">新闻管理后台</h1>
</div>
<div class="flex items-center space-x-4">
<div class="flex items-center space-x-2">
<img class="w-8 h-8 rounded-full" src="http://static.photos/people/200x200/88" alt="Admin">
<span class="text-sm font-medium text-gray-700">管理员</span>
</div>
<a href="index.html" class="text-gray-600 hover:text-red-600 transition-colors">
<i data-feather="home" class="w-5 h-5"></i>
</a>
</div>
</div>
</div>
</header>
<div class="flex h-screen pt-16">
<!-- Sidebar -->
<aside class="sidebar w-64 text-white">
<nav class="p-4">
<div class="mb-8">
<h2 class="text-lg font-semibold mb-4">主要内容</h2>
<ul class="space-y-2">
<li>
<a href="#" class="flex items-center space-x-2 p-2 rounded-lg bg-red-600 text-white">
<i data-feather="file-text" class="w-4 h-4"></i>
<span>文章管理</span>
</a>
</li>
<li>
<a href="#" class="flex items-center space-x-2 p-2 rounded-lg hover:bg-gray-700">
<i data-feather="users" class="w-4 h-4"></i>
<span>用户管理</span>
</a>
</li>
<li>
<a href="#" class="flex items-center space-x-2 p-2 rounded-lg hover:bg-gray-700">
<i data-feather="grid" class="w-4 h-4"></i>
<span>分类管理</span>
</a>
</li>
<li>
<a href="#" class="flex items-center space-x-2 p-2 rounded-lg hover:bg-gray-700">
<i data-feather="settings" class="w-4 h-4"></i>
<span>系统设置</span>
</a>
</li>
</ul>
</div>
<div>
<h2 class="text-lg font-semibold mb-4">统计信息</h2>
<div class="space-y-3">
<div class="bg-gray-800 p-3 rounded-lg">
<div class="text-sm text-gray-400">总文章数</div>
<div class="text-xl font-bold">1,247</div>
</div>
<div class="bg-gray-800 p-3 rounded-lg">
<div class="text-sm text-gray-400">今日发布</div>
<div class="text-xl font-bold">23</div>
</div>
</div>
</div>
</nav>
</aside>
<!-- Main Content -->
<main class="flex-1 p-6 overflow-auto">
<!-- Action Bar -->
<div class="flex justify-between items-center mb-6">
<h2 class="text-2xl font-bold text-gray-800">文章管理</h2>
<button class="btn-primary text-white px-6 py-2 rounded-lg font-semibold flex items-center space-x-2">
<i data-feather="plus" class="w-4 h-4"></i>
<span>新建文章</span>
</button>
</div>
<!-- Filters -->
<div class="bg-white rounded-lg shadow-sm p-4 mb-6">
<div class="flex flex-wrap gap-4">
<select class="px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500">
<option>所有分类</option>
<option>政治</option>
<option>科技</option>
<option>体育</option>
<option>娱乐</option>
<option>商业</option>
</select>
<select class="px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500">
<option>所有状态</option>
<option>已发布</option>
<option>草稿</option>
<option>待审核</option>
</select>
<input type="text" placeholder="搜索文章..." class="px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500">
<button class="bg-gray-200 px-4 py-2 rounded-lg hover:bg-gray-300 transition-colors">
<i data-feather="search" class="w-4 h-4"></i>
</button>
</div>
</div>
<!-- Articles Table -->
<div class="content-card rounded-lg shadow-sm overflow-hidden">
<table class="w-full">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">标题</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">分类</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">状态</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">发布时间</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">操作</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm font-medium text-gray-900">气候研究取得重大突破</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs font-semibold text-red-600 bg-red-100 rounded-full">科技</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs font-semibold text-green-600 bg-green-100 rounded-full">已发布</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2小时前</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<div class="flex space-x-2">
<button class="text-blue-600 hover:text-blue-800">
<i data-feather="edit" class="w-4 h-4"></i>
</button>
<button class="text-red-600 hover:text-red-800">
<i data-feather="trash-2" class="w-4 h-4"></i>
</button>
</div>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm font-medium text-gray-900">人工智能革新医疗健康</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs font-semibold text-blue-600 bg-blue-100 rounded-full">科技</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs font-semibold text-green-600 bg-green-100 rounded-full">已发布</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">4小时前</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<div class="flex space-x-2">
<button class="text-blue-600 hover:text-blue-800">
<i data-feather="edit" class="w-4 h-4"></i>
</button>
<button class="text-red-600 hover:text-red-800">
<i data-feather="trash-2" class="w-4 h-4"></i>
</button>
</div>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm font-medium text-gray-900">冠军总决赛即将开赛</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs font-semibold text-green-600 bg-green-100 rounded-full">体育</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs font-semibold text-yellow-600 bg-yellow-100 rounded-full">待审核</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">6小时前</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<div class="flex space-x-2">
<button class="text-blue-600 hover:text-blue-800">
<i data-feather="edit" class="w-4 h-4"></i>
</button>
<button class="text-red-600 hover:text-red-800">
<i data-feather="trash-2" class="w-4 h-4"></i>
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Pagination -->
<div class="flex justify-center items-center mt-6 space-x-2">
<button class="px-3 py-1 border border-gray-300 rounded-lg hover:bg-gray-100">
<i data-feather="chevron-left" class="w-4 h-4"></i>
</button>
<button class="px-3 py-1 bg-red-600 text-white rounded-lg">1</button>
<button class="px-3 py-1 border border-gray-300 rounded-lg hover:bg-gray-100">2</button>
<button class="px-3 py-1 border border-gray-300 rounded-lg hover:bg-gray-100">3</button>
<button class="px-3 py-1 border border-gray-300 rounded-lg hover:bg-gray-100">
<i data-feather="chevron-right" class="w-4 h-4"></i>
</button>
</div>
</main>
</div>
<script>
feather.replace();
// Simple demo functionality
document.addEventListener('DOMContentLoaded', function() {
const deleteButtons = document.querySelectorAll('button.text-red-600');
deleteButtons.forEach(button => {
button.addEventListener('click', function() {
if (confirm('确定要删除这篇文章吗?')) {
const row = this.closest('tr');
row.style.opacity = '0';
setTimeout(() => row.remove(), 300);
}
});
});
});
</script>
</body>
</html> |