Files
Munich-news/frontend/public/admin.html
2025-11-12 22:33:56 +01:00

282 lines
8.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard - Munich News Daily</title>
<link rel="stylesheet" href="styles.css">
<style>
.admin-container {
max-width: 1400px;
margin: 0 auto;
padding: 20px;
}
.admin-header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 30px;
border-radius: 10px;
margin-bottom: 30px;
}
.dashboard-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.card {
background: white;
border-radius: 10px;
padding: 20px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.card h3 {
margin-top: 0;
color: #333;
border-bottom: 2px solid #667eea;
padding-bottom: 10px;
}
.stat-row {
display: flex;
justify-content: space-between;
padding: 10px 0;
border-bottom: 1px solid #eee;
}
.stat-row:last-child {
border-bottom: none;
}
.stat-label {
color: #666;
}
.stat-value {
font-weight: bold;
color: #333;
}
.status-indicator {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 50%;
margin-right: 5px;
}
.status-active {
background: #10b981;
}
.status-inactive {
background: #ef4444;
}
.status-warning {
background: #f59e0b;
}
.btn {
background: #667eea;
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
margin: 5px;
}
.btn:hover {
background: #5568d3;
}
.btn-secondary {
background: #6b7280;
}
.btn-secondary:hover {
background: #4b5563;
}
.performance-badge {
display: inline-block;
padding: 5px 10px;
border-radius: 5px;
font-size: 12px;
font-weight: bold;
}
.badge-excellent {
background: #d1fae5;
color: #065f46;
}
.badge-good {
background: #dbeafe;
color: #1e40af;
}
.badge-fair {
background: #fef3c7;
color: #92400e;
}
.badge-slow {
background: #fee2e2;
color: #991b1b;
}
.loading {
text-align: center;
padding: 20px;
color: #666;
}
.error {
background: #fee2e2;
color: #991b1b;
padding: 15px;
border-radius: 5px;
margin: 10px 0;
}
.success {
background: #d1fae5;
color: #065f46;
padding: 15px;
border-radius: 5px;
margin: 10px 0;
}
.model-list {
list-style: none;
padding: 0;
}
.model-list li {
padding: 8px;
background: #f3f4f6;
margin: 5px 0;
border-radius: 5px;
}
.current-model {
background: #dbeafe;
font-weight: bold;
}
</style>
</head>
<body>
<div class="admin-container">
<div class="admin-header">
<h1>🛠️ Admin Dashboard</h1>
<p>Munich News Daily - System Status & Configuration</p>
<button class="btn btn-secondary" onclick="window.location.href='/'">← Back to Home</button>
<button class="btn" onclick="refreshAll()">🔄 Refresh All</button>
</div>
<div class="dashboard-grid">
<!-- System Stats -->
<div class="card">
<h3>📊 System Statistics</h3>
<div id="systemStats" class="loading">Loading...</div>
</div>
<!-- Ollama Status -->
<div class="card">
<h3>🤖 AI Status (Ollama)</h3>
<div id="ollamaStatus" class="loading">Loading...</div>
</div>
<!-- GPU Status -->
<div class="card">
<h3>⚡ GPU Status</h3>
<div id="gpuStatus" class="loading">Loading...</div>
</div>
</div>
<div class="dashboard-grid">
<!-- Performance Test -->
<div class="card">
<h3>🚀 Performance Test</h3>
<div id="performanceTest" class="loading">Loading...</div>
<button class="btn" onclick="runPerformanceTest()">Run Test</button>
</div>
<!-- Available Models -->
<div class="card">
<h3>📦 Available Models</h3>
<div id="modelsList" class="loading">Loading...</div>
</div>
<!-- Configuration -->
<div class="card">
<h3>⚙️ Configuration</h3>
<div id="configInfo" class="loading">Loading...</div>
</div>
</div>
<!-- Clustering Stats -->
<div class="card">
<h3>🔗 AI Clustering & Aggregation</h3>
<div id="clusteringStats" class="loading">Loading...</div>
</div>
<!-- Subscriber Management -->
<div class="card">
<h3>👥 Subscriber Management</h3>
<div style="margin-bottom: 20px;">
<button onclick="viewSubscribers()" class="btn btn-primary" style="margin-right: 10px;">
📋 View All Subscribers
</button>
<button onclick="deleteAllSubscribers()" class="btn btn-danger">
🗑️ Delete All Subscribers
</button>
</div>
<div id="subscriberList"></div>
<div id="subscriberMessage"></div>
</div>
<!-- RSS Feed Management -->
<div class="card">
<h3>📡 RSS Feed Management</h3>
<div style="margin-bottom: 20px;">
<button onclick="exportRSSFeeds()" class="btn btn-primary" style="margin-right: 10px;">
📥 Export RSS Feeds
</button>
<label class="btn btn-primary" style="margin-right: 10px; cursor: pointer;">
📤 Import RSS Feeds
<input type="file" id="rssImportFile" accept=".json" style="display: none;" onchange="importRSSFeeds(event)">
</label>
<button onclick="viewRSSFeeds()" class="btn btn-secondary">
📋 View All Feeds
</button>
</div>
<div id="rssFeedList"></div>
<div id="rssFeedMessage"></div>
</div>
<!-- Recent Summarization Activity -->
<div class="card">
<h3>🤖 Recent AI Summarization Activity</h3>
<div style="margin-bottom: 15px;">
<button onclick="loadRecentArticles()" class="btn btn-primary">
🔄 Refresh
</button>
<label style="margin-left: 15px;">
<input type="checkbox" id="autoRefresh" onchange="toggleAutoRefresh()"> Auto-refresh (10s)
</label>
</div>
<div id="recentArticles" class="loading">Loading...</div>
</div>
</div>
<script src="admin.js"></script>
</body>
</html>