This commit is contained in:
Alex Yang
2026-04-12 21:40:22 +08:00
parent 7abc2b5339
commit f9e2e5a6bc
52 changed files with 3388 additions and 368846 deletions
+175 -6
View File
@@ -47,11 +47,18 @@
<span>屏蔽管理</span>
</a>
</li>
<li>
<a href="#domain-info"
class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-100 rounded-md transition-all">
<i class="fa fa-database 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>
<span>Hosts 管理</span>
</a>
</li>
<li>
@@ -146,11 +153,18 @@
<span>屏蔽管理</span>
</a>
</li>
<li>
<a href="#domain-info"
class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-100 rounded-md transition-all">
<i class="fa fa-database 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>
<span>Hosts 管理</span>
</a>
</li>
<li>
@@ -730,6 +744,164 @@
<!-- 添加域名信息列表模态框 -->
<div id="add-domain-info-modal" class="fixed inset-0 bg-black/50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-lg w-full max-w-md p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-semibold">添加域名信息列表</h3>
<button onclick="window.domainInfo.hideAddListModal()"
class="p-2 rounded-full hover:bg-gray-100 transition-colors">
<i class="fa fa-times"></i>
</button>
</div>
<form id="add-domain-info-form">
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">名称</label>
<input type="text" id="list-name" required
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">URL</label>
<input type="url" id="list-url" required
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">类型</label>
<select id="list-type" required
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
<option value="domain-info">域名信息</option>
<option value="threat-database">威胁数据库</option>
<option value="tracker">跟踪器</option>
</select>
</div>
<div>
<label class="flex items-center space-x-2">
<input type="checkbox" id="list-enabled" checked
class="rounded border-gray-300 text-primary focus:ring-primary">
<span class="text-sm text-gray-700">启用</span>
</label>
</div>
</div>
<div class="mt-6 flex space-x-3">
<button type="button" onclick="window.domainInfo.hideAddListModal()"
class="px-4 py-2 border border-gray-300 rounded-md hover:bg-gray-50 transition-colors text-sm flex-1">
取消
</button>
<button type="submit"
class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors text-sm flex-1">
添加
</button>
</div>
</form>
</div>
</div>
<!-- 域名信息管理页面内容(初始隐藏) -->
<div id="domain-info-content" class="hidden space-y-6">
<!-- 域名信息统计卡片 -->
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 sm:gap-6">
<!-- 域名信息数量卡片 -->
<div class="bg-blue-50 rounded-lg p-3 sm:p-4 card-shadow relative overflow-hidden transition-all hover:shadow-md">
<div class="absolute -bottom-6 -right-6 w-20 h-20 sm:w-24 sm:h-24 rounded-full bg-primary opacity-10"></div>
<div class="relative z-10">
<div class="flex items-center justify-between mb-3 sm:mb-4">
<h3 class="text-xs sm:text-sm text-gray-500 font-medium">域名信息数量</h3>
<div class="p-1.5 sm:p-2 rounded-full bg-primary/10 text-primary">
<i class="fa fa-database text-xs sm:text-sm"></i>
</div>
</div>
<div class="mb-2">
<div class="flex items-end justify-between">
<p class="text-2xl sm:text-3xl font-bold" id="domain-info-count">0</p>
</div>
</div>
</div>
</div>
<!-- 威胁域名数量卡片 -->
<div class="bg-red-50 rounded-lg p-3 sm:p-4 card-shadow relative overflow-hidden transition-all hover:shadow-md">
<div class="absolute -bottom-6 -right-6 w-20 h-20 sm:w-24 sm:h-24 rounded-full bg-danger opacity-10"></div>
<div class="relative z-10">
<div class="flex items-center justify-between mb-3 sm:mb-4">
<h3 class="text-xs sm:text-sm text-gray-500 font-medium">威胁域名数量</h3>
<div class="p-1.5 sm:p-2 rounded-full bg-danger/10 text-danger">
<i class="fa fa-exclamation-triangle text-xs sm:text-sm"></i>
</div>
</div>
<div class="mb-2">
<div class="flex items-end justify-between">
<p class="text-2xl sm:text-3xl font-bold" id="threat-count">0</p>
</div>
</div>
</div>
</div>
<!-- 跟踪器数量卡片 -->
<div class="bg-purple-50 rounded-lg p-3 sm:p-4 card-shadow relative overflow-hidden transition-all hover:shadow-md">
<div class="absolute -bottom-6 -right-6 w-20 h-20 sm:w-24 sm:h-24 rounded-full bg-purple-500 opacity-10"></div>
<div class="relative z-10">
<div class="flex items-center justify-between mb-3 sm:mb-4">
<h3 class="text-xs sm:text-sm text-gray-500 font-medium">跟踪器数量</h3>
<div class="p-1.5 sm:p-2 rounded-full bg-purple-500/10 text-purple-500">
<i class="fa fa-bullseye text-xs sm:text-sm"></i>
</div>
</div>
<div class="mb-2">
<div class="flex items-end justify-between">
<p class="text-2xl sm:text-3xl font-bold" id="tracker-count">0</p>
</div>
</div>
</div>
</div>
</div>
<!-- 域名信息列表管理 -->
<div class="bg-white rounded-lg p-4 sm:p-6 card-shadow">
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between mb-4 sm:mb-6">
<h3 class="text-base sm:text-lg font-semibold mb-3 sm:mb-0">远程域名信息列表</h3>
<div class="flex space-x-2 sm:space-x-3">
<button onclick="window.domainInfo.updateAllDomainInfo()"
class="px-3 sm:px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors text-sm flex items-center">
<i class="fa fa-refresh mr-2"></i>
更新所有列表
</button>
<button onclick="window.domainInfo.showAddListModal()"
class="px-3 sm:px-4 py-2 bg-green-500 text-white rounded-md hover:bg-green-600 transition-colors text-sm flex items-center">
<i class="fa fa-plus mr-2"></i>
添加列表
</button>
</div>
</div>
<!-- 最后更新时间 -->
<div class="mb-4 text-sm text-gray-500">
<i class="fa fa-clock-o mr-2"></i>
最后更新时间:<span id="last-update-time">从未更新</span>
</div>
<!-- 域名信息列表表格 -->
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">名称</th>
<th class="px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">状态</th>
<th class="px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">类型</th>
<th class="px-3 sm:px-4 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">规则数量</th>
<th class="px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">最后更新</th>
<th class="px-3 sm:px-4 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">操作</th>
</tr>
</thead>
<tbody id="domain-info-lists-table-body" class="bg-white divide-y divide-gray-200">
<!-- 动态生成 -->
</tbody>
</table>
</div>
</div>
</div>
<!-- 威胁告警页面内容(初始隐藏) -->
<div id="threats-content" class="hidden space-y-6">
<!-- 威胁统计卡片 -->
@@ -2219,16 +2391,13 @@
<script src="js/api.js"></script>
<script src="js/dashboard.js"></script>
<script src="js/shield.js"></script>
<script src="js/modules/domain-info.js"></script>
<script src="js/hosts.js"></script>
<script src="js/query.js"></script>
<script src="js/logs.js"></script>
<script src="js/config.js"></script>
<script src="js/about.js"></script>
<!-- 直接渲染滚动列表的静态HTML内容 -->
<script src="js/whois.js"></script>
<!-- 威胁告警页面脚本 -->
<script src="js/threats.js"></script>
</body>