BotWeb / page /dashboard.html
FikXzModzDeveloper
deploy awal
c20600f
Raw
History Blame Contribute Delete
19 kB
<!DOCTYPE html>
<html lang="id" class="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Dashboard - Botz Control Panel</title>
<link rel="icon" type="image/jpeg" href="https://cdn.yupra.my.id/yp/4r4oy0ze.jpg">
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
colors: {
primary: '#6366f1',
secondary: '#ec4899',
darkbg: '#0f172a',
cardbg: '#1e293b',
inputbg: '#334155',
sidebar: '#111827'
},
fontFamily: {
sans: ['Inter', 'sans-serif'],
mono: ['JetBrains Mono', 'monospace']
}
}
}
}
</script>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<style>
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 20px; }
.glass { background: rgba(30, 41, 59, 0.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.05); }
</style>
</head>
<body class="bg-[#020617] text-slate-300 font-sans h-screen flex overflow-hidden selection:bg-primary selection:text-white">
<div id="toast-container" class="fixed top-6 right-6 z-[100] flex flex-col gap-3 pointer-events-none"></div>
<aside class="hidden md:flex flex-col w-64 bg-sidebar border-r border-white/5 h-full relative z-20">
<div class="p-6 flex items-center gap-3">
<div class="w-10 h-10 rounded-xl bg-gradient-to-br from-primary to-indigo-700 flex items-center justify-center text-white shadow-lg shadow-primary/20">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/></svg>
</div>
<h1 class="text-lg font-bold text-white tracking-tight">Panel Botz</h1>
</div>
<nav class="flex-1 px-4 space-y-2 py-4">
<a href="/" class="nav-item active w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium text-slate-400 hover:bg-white/5 hover:text-white transition-all border border-transparent">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"/></svg>
Dashboard
</a>
<a href="/broadcast" class="nav-item w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium text-slate-400 hover:bg-white/5 hover:text-white transition-all border border-transparent">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5.882V19.24a1.76 1.76 0 01-3.417.592l-2.147-6.15M18 13a3 3 0 100-6M5.436 13.683A4.001 4.001 0 017 6h1.832c4.1 0 7.625-1.234 9.168-3v14c-1.543-1.766-5.067-3-9.168-3H7a3.988 3.988 0 01-1.564-.317z"/></svg>
Broadcast
</a>
<a href="/tools" class="nav-item w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium text-slate-400 hover:bg-white/5 hover:text-white transition-all border border-transparent">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/></svg>
Tools
</a>
<a href="/settings" class="nav-item w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-medium text-slate-400 hover:bg-white/5 hover:text-white transition-all border border-transparent">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/></svg>
Settings
</a>
</nav>
<div class="p-4 border-t border-white/5">
<div class="glass p-3 rounded-xl flex items-center gap-3">
<div id="status-dot" class="w-2.5 h-2.5 rounded-full bg-red-500 animate-pulse"></div>
<div>
<p id="status-text" class="text-[10px] font-bold uppercase tracking-widest text-red-500">DISCONNECTED</p>
<p id="bot-name-display" class="text-xs text-slate-400 truncate w-32">Connecting...</p>
</div>
</div>
</div>
</aside>
<main class="flex-1 flex flex-col h-full relative overflow-hidden bg-[#020617]">
<header class="glass sticky top-0 z-30 px-6 py-4 flex md:hidden items-center justify-between border-b border-white/5">
<div class="flex items-center gap-3">
<div class="w-9 h-9 rounded-lg bg-gradient-to-br from-primary to-indigo-700 flex items-center justify-center text-white shadow-lg shadow-primary/20">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/></svg>
</div>
<h1 class="text-lg font-bold text-white tracking-tight">Panel Botz</h1>
</div>
<div class="flex items-center gap-2">
<div id="status-dot-m" class="w-2 h-2 rounded-full bg-red-500 animate-pulse"></div>
</div>
</header>
<div class="flex-1 overflow-y-auto p-4 md:p-8 pb-24 md:pb-8 custom-scroll relative">
<div class="max-w-7xl mx-auto space-y-6">
<div>
<h2 class="text-3xl md:text-4xl font-bold text-white mb-2">Dashboard</h2>
<p class="text-slate-400 text-base">Monitoring real-time status bot</p>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6">
<div class="bg-cardbg/40 border border-white/5 p-6 rounded-2xl hover:bg-cardbg/60 transition-all duration-300">
<div class="flex justify-between items-start mb-4">
<p class="text-sm text-slate-500 font-bold uppercase tracking-wider">Total Hits</p>
<div class="p-3 rounded-lg bg-primary/10 text-primary"><svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"/></svg></div>
</div>
<h3 id="stat-total" class="text-4xl font-bold text-white">0</h3>
</div>
<div class="bg-cardbg/40 border border-white/5 p-6 rounded-2xl hover:bg-cardbg/60 transition-all duration-300">
<div class="flex justify-between items-start mb-4">
<p class="text-sm text-slate-500 font-bold uppercase tracking-wider">Success Rate</p>
<div class="p-3 rounded-lg bg-green-500/10 text-green-500"><svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/></svg></div>
</div>
<h3 id="stat-success" class="text-4xl font-bold text-white">0%</h3>
<div class="w-full bg-slate-800 h-2 mt-4 rounded-full overflow-hidden"><div id="bar-success" class="bg-green-500 h-full w-0 transition-all duration-1000"></div></div>
</div>
<div class="bg-cardbg/40 border border-white/5 p-6 rounded-2xl hover:bg-cardbg/60 transition-all duration-300">
<div class="flex justify-between items-start mb-4">
<p class="text-sm text-slate-500 font-bold uppercase tracking-wider">Memory</p>
<div class="p-3 rounded-lg bg-secondary/10 text-secondary"><svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"/></svg></div>
</div>
<h3 id="stat-ram" class="text-4xl font-bold text-white">0 MB</h3>
<div class="w-full bg-slate-800 h-2 mt-4 rounded-full overflow-hidden"><div id="bar-ram" class="bg-secondary h-full w-0 transition-all duration-1000"></div></div>
</div>
<div class="bg-cardbg/40 border border-white/5 p-6 rounded-2xl hover:bg-cardbg/60 transition-all duration-300">
<div class="flex justify-between items-start mb-4">
<p class="text-sm text-slate-500 font-bold uppercase tracking-wider">Uptime</p>
<div class="p-3 rounded-lg bg-blue-500/10 text-blue-500"><svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/></svg></div>
</div>
<h3 id="stat-uptime" class="text-2xl font-mono font-bold text-white mt-1">00:00:00</h3>
<p id="platform-info" class="text-xs text-slate-500 mt-2 uppercase">SYSTEM CHECKING...</p>
</div>
</div>
<div class="glass p-6 md:p-8 rounded-2xl shadow-xl">
<h2 class="text-white font-bold mb-6 flex items-center gap-3 text-lg uppercase tracking-wide">
<span class="w-2 h-7 bg-orange-500 rounded-full"></span> Traffic Statistics
</h2>
<div id="api-list" class="space-y-3 max-h-96 overflow-y-auto pr-3">
<div class="text-center text-sm text-slate-500 py-12 italic">Waiting for data stream...</div>
</div>
</div>
</div>
</div>
</main>
<div class="md:hidden fixed bottom-0 inset-x-0 bg-sidebar border-t border-white/5 z-50 flex justify-around items-center p-2 pb-5">
<a href="/" class="nav-item flex flex-col items-center gap-1 p-2 rounded-xl text-slate-400">
<svg class="w-7 h-7" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"/></svg>
<span class="text-[11px] font-medium">Home</span>
</a>
<a href="/broadcast" class="nav-item flex flex-col items-center gap-1 p-2 rounded-xl text-slate-400">
<svg class="w-7 h-7" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5.882V19.24a1.76 1.76 0 01-3.417.592l-2.147-6.15M18 13a3 3 0 100-6M5.436 13.683A4.001 4.001 0 017 6h1.832c4.1 0 7.625-1.234 9.168-3v14c-1.543-1.766-5.067-3-9.168-3H7a3.988 3.988 0 01-1.564-.317z"/></svg>
<span class="text-[11px] font-medium">Broad</span>
</a>
<a href="/tools" class="nav-item flex flex-col items-center gap-1 p-2 rounded-xl text-slate-400">
<svg class="w-7 h-7" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/></svg>
<span class="text-[11px] font-medium">Tools</span>
</a>
<a href="/settings" class="nav-item flex flex-col items-center gap-1 p-2 rounded-xl text-slate-400">
<svg class="w-7 h-7" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/></svg>
<span class="text-[11px] font-medium">Set</span>
</a>
</div>
<script>
function showToast(msg, type = 'success') {
const container = document.getElementById('toast-container');
const div = document.createElement('div');
const bg = type === 'success' ? 'bg-green-500/10 border-green-500/30 text-green-200' : 'bg-red-500/10 border-red-500/30 text-red-200';
div.className = `glass px-4 py-3 rounded-xl border backdrop-blur-md shadow-2xl flex items-center gap-3 transform translate-x-full transition-all duration-300 pointer-events-auto min-w-[280px] ${bg}`;
div.innerHTML = `<span class="font-medium text-sm">${msg}</span>`;
container.appendChild(div);
requestAnimationFrame(() => div.classList.remove('translate-x-full'));
setTimeout(() => {
div.classList.add('translate-x-full', 'opacity-0');
setTimeout(() => div.remove(), 300);
}, 3000);
}
async function fetchStats() {
try {
const res = await fetch('/stats');
if (res.redirected) {
window.location.href = res.url;
return;
}
const data = await res.json();
const uptime = parseInt(data.system.uptime);
const h = Math.floor(uptime / 3600);
const m = Math.floor((uptime % 3600) / 60);
document.getElementById('stat-uptime').innerText = `${h}h ${m}m ${uptime % 60}s`;
document.getElementById('stat-ram').innerText = data.system.ram_usage + ' MB';
document.getElementById('bar-ram').style.width = Math.min((data.system.ram_usage / 8000 * 100), 100) + '%';
document.getElementById('platform-info').innerText = `${data.system.platform} ${data.system.arch}`;
const total = data.api.total_requests;
document.getElementById('stat-total').innerText = total;
const successRate = total > 0 ? Math.round((data.api.success / total) * 100) : 0;
document.getElementById('stat-success').innerText = successRate + '%';
document.getElementById('bar-success').style.width = successRate + '%';
const listContainer = document.getElementById('api-list');
if(Object.keys(data.api.endpoints).length > 0) {
let html = '';
Object.entries(data.api.endpoints).forEach(([path, count]) => {
const pct = Math.round((count/total)*100);
html += `
<div class="flex items-center justify-between text-sm p-4 rounded-xl bg-slate-900/40 border border-white/5">
<div class="flex items-center gap-4">
<span class="font-mono text-primary font-bold">${path}</span>
<div class="w-24 h-2 bg-slate-800 rounded-full overflow-hidden">
<div class="h-full bg-primary" style="width: ${pct}%"></div>
</div>
</div>
<span class="text-slate-400 font-bold">${count} Hits</span>
</div>`;
});
if(listContainer.innerHTML !== html) listContainer.innerHTML = html;
}
const stText = document.getElementById('status-text');
const stDot = document.getElementById('status-dot');
const stDotM = document.getElementById('status-dot-m');
if(data.wa.connected) {
stText.innerText = 'ONLINE'; stText.className = 'text-[10px] font-bold uppercase tracking-widest text-primary';
stDot.className = 'w-2.5 h-2.5 rounded-full bg-primary shadow-[0_0_12px_#6366f1]';
stDotM.className = 'w-2 h-2 rounded-full bg-primary shadow-[0_0_12px_#6366f1]';
if(data.wa.user) document.getElementById('bot-name-display').innerText = data.wa.user.name || data.wa.user.id;
} else {
stText.innerText = 'DISCONNECTED'; stText.className = 'text-[10px] font-bold uppercase tracking-widest text-red-500';
stDot.className = 'w-2.5 h-2.5 rounded-full bg-red-500 animate-pulse';
stDotM.className = 'w-2 h-2 rounded-full bg-red-500 animate-pulse';
}
} catch (e) {}
}
setInterval(fetchStats, 2000);
fetchStats();
</script>
</body>
</html>