440 lines
24 KiB
HTML
440 lines
24 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>DNS服务器控制台</title>
|
|
<!-- Tailwind CSS -->
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<!-- Font Awesome -->
|
|
<link href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
|
|
<!-- Chart.js -->
|
|
<!-- Chart.js 本地备用 -->
|
|
<script src="js/vendor/chart.umd.min.js" onerror="this.onerror=null;this.src='js/chart.umd.min.js';"></script>
|
|
|
|
<!-- Tailwind 配置 -->
|
|
<script>
|
|
tailwind.config = {
|
|
theme: {
|
|
extend: {
|
|
colors: {
|
|
primary: '#165DFF',
|
|
secondary: '#36CFFB',
|
|
success: '#00B42A',
|
|
warning: '#FF7D00',
|
|
danger: '#F53F3F',
|
|
info: '#86909C',
|
|
dark: '#1D2129',
|
|
light: '#F2F3F5',
|
|
},
|
|
fontFamily: {
|
|
sans: ['Inter', 'system-ui', 'sans-serif'],
|
|
},
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<!-- 自定义工具类 -->
|
|
<style type="text/tailwindcss">
|
|
@layer utilities {
|
|
.content-auto {
|
|
content-visibility: auto;
|
|
}
|
|
.card-shadow {
|
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
}
|
|
.sidebar-item-active {
|
|
background-color: rgba(22, 93, 255, 0.1);
|
|
color: #165DFF;
|
|
border-right: 4px solid #165DFF;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body class="bg-gray-50 text-dark font-sans">
|
|
<div class="flex h-screen overflow-hidden">
|
|
<!-- 侧边栏 -->
|
|
<aside id="sidebar" class="w-64 bg-white border-r border-gray-200 flex flex-col transition-all duration-300 z-10">
|
|
<!-- Logo -->
|
|
<div class="flex items-center justify-center h-16 border-b border-gray-200">
|
|
<i class="fa fa-server text-3xl text-primary mr-3"></i>
|
|
<h1 class="text-xl font-bold text-primary">DNS 控制台</h1>
|
|
</div>
|
|
|
|
<!-- 菜单 -->
|
|
<nav class="flex-1 overflow-y-auto p-4">
|
|
<ul class="space-y-1">
|
|
<li>
|
|
<a href="#dashboard" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-100 rounded-md transition-all sidebar-item-active">
|
|
<i class="fa fa-tachometer mr-3 text-lg"></i>
|
|
<span>仪表盘</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="#shield" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-100 rounded-md transition-all">
|
|
<i class="fa fa-shield mr-3 text-lg"></i>
|
|
<span>屏蔽管理</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="#hosts" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-100 rounded-md transition-all">
|
|
<i class="fa fa-file-text mr-3 text-lg"></i>
|
|
<span>Hosts管理</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="#blacklists" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-100 rounded-md transition-all">
|
|
<i class="fa fa-ban mr-3 text-lg"></i>
|
|
<span>黑名单管理</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="#query" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-100 rounded-md transition-all">
|
|
<i class="fa fa-search mr-3 text-lg"></i>
|
|
<span>DNS查询</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="#config" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-100 rounded-md transition-all">
|
|
<i class="fa fa-cog mr-3 text-lg"></i>
|
|
<span>系统设置</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
|
|
<!-- 底部信息 -->
|
|
<div class="p-4 border-t border-gray-200 text-center text-gray-500 text-sm">
|
|
<p>DNS服务器 v1.0.0</p>
|
|
<p class="mt-1" id="uptime">正常运行中</p>
|
|
</div>
|
|
</aside>
|
|
|
|
<!-- 主内容区 -->
|
|
<main class="flex-1 overflow-y-auto">
|
|
<!-- 顶部导航栏 -->
|
|
<header class="bg-white border-b border-gray-200 h-16 flex items-center justify-between px-6">
|
|
<div class="flex items-center">
|
|
<button id="toggle-sidebar" class="lg:hidden text-gray-500 hover:text-gray-700">
|
|
<i class="fa fa-bars text-xl"></i>
|
|
</button>
|
|
<h2 class="ml-4 text-xl font-semibold" id="page-title">仪表盘</h2>
|
|
</div>
|
|
|
|
<div class="flex items-center space-x-4">
|
|
<button class="p-2 text-gray-500 hover:text-gray-700 rounded-full hover:bg-gray-100">
|
|
<i class="fa fa-bell text-lg"></i>
|
|
</button>
|
|
<div class="flex items-center">
|
|
<img src="https://picsum.photos/id/1005/40/40" alt="用户头像" class="w-8 h-8 rounded-full">
|
|
<span class="ml-2 hidden md:block">管理员</span>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- 页面内容 -->
|
|
<div class="p-6">
|
|
<!-- 仪表盘部分 -->
|
|
<div id="dashboard-content" class="space-y-6">
|
|
<!-- 统计卡片 -->
|
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
|
|
<!-- 查询总量卡片 -->
|
|
<div class="bg-white rounded-lg p-6 card-shadow relative overflow-hidden">
|
|
<!-- 颜色蒙版 -->
|
|
<div class="absolute -bottom-8 -right-8 w-24 h-24 rounded-full bg-primary opacity-10"></div>
|
|
<div class="relative z-10">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h3 class="text-gray-500 font-medium">查询总量</h3>
|
|
<div class="p-2 rounded-full bg-primary/10 text-primary">
|
|
<i class="fa fa-refresh"></i>
|
|
</div>
|
|
</div>
|
|
<div class="flex items-end justify-between">
|
|
<p class="text-3xl font-bold" id="total-queries">0</p>
|
|
<span class="text-success text-sm flex items-center">
|
|
<i class="fa fa-arrow-up mr-1"></i>
|
|
<span id="queries-percent">0%</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 屏蔽数量卡片 -->
|
|
<div class="bg-white rounded-lg p-6 card-shadow relative overflow-hidden">
|
|
<!-- 颜色蒙版 -->
|
|
<div class="absolute -bottom-8 -right-8 w-24 h-24 rounded-full bg-danger opacity-10"></div>
|
|
<div class="relative z-10">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h3 class="text-gray-500 font-medium">屏蔽数量</h3>
|
|
<div class="p-2 rounded-full bg-danger/10 text-danger">
|
|
<i class="fa fa-ban"></i>
|
|
</div>
|
|
</div>
|
|
<div class="flex items-end justify-between">
|
|
<p class="text-3xl font-bold" id="blocked-queries">0</p>
|
|
<span class="text-danger text-sm flex items-center">
|
|
<i class="fa fa-arrow-up mr-1"></i>
|
|
<span id="blocked-percent">0%</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 正常解析卡片 -->
|
|
<div class="bg-white rounded-lg p-6 card-shadow relative overflow-hidden">
|
|
<!-- 颜色蒙版 -->
|
|
<div class="absolute -bottom-8 -right-8 w-24 h-24 rounded-full bg-success opacity-10"></div>
|
|
<div class="relative z-10">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h3 class="text-gray-500 font-medium">正常解析</h3>
|
|
<div class="p-2 rounded-full bg-success/10 text-success">
|
|
<i class="fa fa-check"></i>
|
|
</div>
|
|
</div>
|
|
<div class="flex items-end justify-between">
|
|
<p class="text-3xl font-bold" id="allowed-queries">0</p>
|
|
<span class="text-success text-sm flex items-center">
|
|
<i class="fa fa-arrow-up mr-1"></i>
|
|
<span id="allowed-percent">0%</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 错误数量卡片 -->
|
|
<div class="bg-white rounded-lg p-6 card-shadow relative overflow-hidden">
|
|
<!-- 颜色蒙版 -->
|
|
<div class="absolute -bottom-8 -right-8 w-24 h-24 rounded-full bg-warning opacity-10"></div>
|
|
<div class="relative z-10">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h3 class="text-gray-500 font-medium">错误数量</h3>
|
|
<div class="p-2 rounded-full bg-warning/10 text-warning">
|
|
<i class="fa fa-exclamation-triangle"></i>
|
|
</div>
|
|
</div>
|
|
<div class="flex items-end justify-between">
|
|
<p class="text-3xl font-bold" id="error-queries">0</p>
|
|
<span class="text-warning text-sm flex items-center">
|
|
<i class="fa fa-arrow-up mr-1"></i>
|
|
<span id="error-percent">0%</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 平均响应时间卡片 -->
|
|
<div class="bg-white rounded-lg p-6 card-shadow relative overflow-hidden">
|
|
<!-- 颜色蒙版 -->
|
|
<div class="absolute -bottom-8 -right-8 w-24 h-24 rounded-full bg-info opacity-10"></div>
|
|
<div class="relative z-10">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h3 class="text-gray-500 font-medium">平均响应时间</h3>
|
|
<div class="p-2 rounded-full bg-info/10 text-info">
|
|
<i class="fa fa-clock-o"></i>
|
|
</div>
|
|
</div>
|
|
<div class="flex items-end justify-between">
|
|
<p class="text-3xl font-bold" id="avg-response-time">0ms</p>
|
|
<span class="text-success text-sm flex items-center">
|
|
<i class="fa fa-arrow-down mr-1"></i>
|
|
<span id="response-time-percent">0%</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 最常用查询类型卡片 -->
|
|
<div class="bg-white rounded-lg p-6 card-shadow relative overflow-hidden">
|
|
<!-- 颜色蒙版 -->
|
|
<div class="absolute -bottom-8 -right-8 w-24 h-24 rounded-full bg-secondary opacity-10"></div>
|
|
<div class="relative z-10">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h3 class="text-gray-500 font-medium">最常用查询类型</h3>
|
|
<div class="p-2 rounded-full bg-secondary/10 text-secondary">
|
|
<i class="fa fa-database"></i>
|
|
</div>
|
|
</div>
|
|
<div class="flex items-end justify-between">
|
|
<p class="text-3xl font-bold" id="top-query-type">A</p>
|
|
<span class="text-primary text-sm flex items-center">
|
|
<i class="fa fa-circle text-xs mr-1"></i>
|
|
<span id="query-type-percentage">0%</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 活跃来源IP数卡片 -->
|
|
<div class="bg-white rounded-lg p-6 card-shadow relative overflow-hidden">
|
|
<!-- 颜色蒙版 -->
|
|
<div class="absolute -bottom-8 -right-8 w-24 h-24 rounded-full bg-success opacity-10"></div>
|
|
<div class="relative z-10">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h3 class="text-gray-500 font-medium">活跃来源IP</h3>
|
|
<div class="p-2 rounded-full bg-success/10 text-success">
|
|
<i class="fa fa-globe"></i>
|
|
</div>
|
|
</div>
|
|
<div class="flex items-end justify-between">
|
|
<p class="text-3xl font-bold" id="active-ips">0</p>
|
|
<span class="text-success text-sm flex items-center">
|
|
<i class="fa fa-arrow-up mr-1"></i>
|
|
<span id="active-ips-percent">0%</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- CPU使用率卡片 -->
|
|
<div class="bg-white rounded-lg p-6 card-shadow relative overflow-hidden">
|
|
<!-- 颜色蒙版 -->
|
|
<div class="absolute -bottom-8 -right-8 w-24 h-24 rounded-full bg-warning opacity-10"></div>
|
|
<div class="relative z-10">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h3 class="text-gray-500 font-medium">CPU使用率</h3>
|
|
<div class="p-2 rounded-full bg-warning/10 text-warning">
|
|
<i class="fa fa-microchip"></i>
|
|
</div>
|
|
</div>
|
|
<div class="flex items-end justify-between">
|
|
<p class="text-3xl font-bold" id="cpu-usage">0%</p>
|
|
<span class="text-warning text-sm flex items-center">
|
|
<i class="fa fa-bolt mr-1"></i>
|
|
<span id="cpu-status">正常</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 图表和数据表格 -->
|
|
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
|
<!-- DNS请求趋势图表 -->
|
|
<div class="bg-white rounded-lg p-6 card-shadow lg:col-span-3">
|
|
<div class="flex items-center justify-between mb-6">
|
|
<h3 class="text-lg font-semibold">DNS请求趋势</h3>
|
|
<!-- 时间范围切换按钮 -->
|
|
<div class="flex space-x-2">
|
|
<button class="time-range-btn px-4 py-2 rounded-md bg-primary text-white" data-range="24h">24小时</button>
|
|
<button class="time-range-btn px-4 py-2 rounded-md bg-gray-200 text-gray-700 hover:bg-gray-300 transition-colors" data-range="7d">7天</button>
|
|
<button class="time-range-btn px-4 py-2 rounded-md bg-gray-200 text-gray-700 hover:bg-gray-300 transition-colors" data-range="30d">30天</button>
|
|
</div>
|
|
</div>
|
|
<div class="h-80">
|
|
<canvas id="dns-requests-chart"></canvas>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 解析与屏蔽比例 -->
|
|
<div class="bg-white rounded-lg p-6 card-shadow lg:col-span-3">
|
|
<h3 class="text-lg font-semibold mb-6">解析与屏蔽比例</h3>
|
|
<div class="h-80 flex items-center justify-center">
|
|
<canvas id="ratio-chart"></canvas>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 最近活动表格 -->
|
|
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
|
|
<!-- 最常屏蔽域名 -->
|
|
<div class="bg-white rounded-lg p-6 card-shadow">
|
|
<h3 class="text-lg font-semibold mb-6">最常屏蔽域名</h3>
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full">
|
|
<thead>
|
|
<tr class="border-b border-gray-200">
|
|
<th class="text-left py-3 px-4 text-sm font-medium text-gray-500">域名</th>
|
|
<th class="text-right py-3 px-4 text-sm font-medium text-gray-500">屏蔽次数</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="top-blocked-table">
|
|
<tr>
|
|
<td colspan="2" class="py-4 text-center text-gray-500">加载中...</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 最近屏蔽域名 -->
|
|
<div class="bg-white rounded-lg p-6 card-shadow">
|
|
<h3 class="text-lg font-semibold mb-6">最近屏蔽域名</h3>
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full">
|
|
<thead>
|
|
<tr class="border-b border-gray-200">
|
|
<th class="text-left py-3 px-4 text-sm font-medium text-gray-500">域名</th>
|
|
<th class="text-right py-3 px-4 text-sm font-medium text-gray-500">时间</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="recent-blocked-table">
|
|
<tr>
|
|
<td colspan="2" class="py-4 text-center text-gray-500">加载中...</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 其他页面内容(初始隐藏) -->
|
|
<div id="shield-content" class="hidden">
|
|
<!-- 屏蔽管理页面内容 -->
|
|
<div class="bg-white rounded-lg p-6 card-shadow">
|
|
<h3 class="text-lg font-semibold mb-6">屏蔽规则管理</h3>
|
|
<!-- 这里将添加屏蔽规则管理相关内容 -->
|
|
<p>屏蔽管理页面内容待实现</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="hosts-content" class="hidden">
|
|
<!-- Hosts管理页面内容 -->
|
|
<div class="bg-white rounded-lg p-6 card-shadow">
|
|
<h3 class="text-lg font-semibold mb-6">Hosts管理</h3>
|
|
<!-- 这里将添加Hosts管理相关内容 -->
|
|
<p>Hosts管理页面内容待实现</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="blacklists-content" class="hidden">
|
|
<!-- 黑名单管理页面内容 -->
|
|
<div class="bg-white rounded-lg p-6 card-shadow">
|
|
<h3 class="text-lg font-semibold mb-6">黑名单管理</h3>
|
|
<!-- 这里将添加黑名单管理相关内容 -->
|
|
<p>黑名单管理页面内容待实现</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="query-content" class="hidden">
|
|
<!-- DNS查询页面内容 -->
|
|
<div class="bg-white rounded-lg p-6 card-shadow">
|
|
<h3 class="text-lg font-semibold mb-6">DNS查询</h3>
|
|
<!-- 这里将添加DNS查询相关内容 -->
|
|
<p>DNS查询页面内容待实现</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="config-content" class="hidden">
|
|
<!-- 系统设置页面内容 -->
|
|
<div class="bg-white rounded-lg p-6 card-shadow">
|
|
<h3 class="text-lg font-semibold mb-6">系统设置</h3>
|
|
<!-- 这里将添加系统设置相关内容 -->
|
|
<p>系统设置页面内容待实现</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
<!-- 脚本 -->
|
|
<script src="js/main.js"></script>
|
|
<script src="js/api.js"></script>
|
|
<script src="js/dashboard.js"></script>
|
|
<script src="js/shield.js"></script>
|
|
<script src="js/hosts.js"></script>
|
|
<script src="js/query.js"></script>
|
|
<script src="js/config.js"></script>
|
|
</body>
|
|
</html> |