This commit is contained in:
Alex Yang
2025-11-25 00:35:37 +08:00
parent 9f81b449f1
commit c570f303e7
7 changed files with 56 additions and 50 deletions

View File

@@ -191,7 +191,7 @@ function updateDomainRankings() {
// 更新统计卡片数据
function updateStatCards() {
// 获取所有统计数据
apiRequest('/stats')
apiRequest('/api/stats')
.then(data => {
// 更新请求统计
if (data && data.dns) {
@@ -239,7 +239,7 @@ function updateStatCards() {
});
// 获取规则数
apiRequest('/shield')
apiRequest('/api/shield')
.then(data => {
let rulesCount = 0;
@@ -285,7 +285,7 @@ function updateStatCards() {
});
// 获取Hosts条目数量
apiRequest('/shield/hosts')
apiRequest('/api/shield/hosts')
.then(data => {
let hostsCount = 0;
@@ -318,7 +318,7 @@ function updateStatCards() {
});
// 获取Hosts条目数
apiRequest('/shield/hosts')
apiRequest('/api/shield/hosts')
.then(data => {
let hostsCount = 0;
if (Array.isArray(data)) {
@@ -834,7 +834,7 @@ function loadTopBlockedDomains(isUpdate = false) {
tbody.innerHTML = `<td colspan="100%" style="color: #7f8c8d; font-style: italic;">加载中...</td>`;
}
return apiRequest('/top-blocked')
return apiRequest('/api/top-blocked')
.then(data => {
// 处理多种可能的数据格式,特别优化对用户提供格式的支持
let processedData = [];
@@ -909,7 +909,7 @@ function loadTopResolvedDomains(isUpdate = false) {
tbody.innerHTML = `<td colspan="100%" style="color: #7f8c8d; font-style: italic;">加载中...</td>`;
}
return apiRequest('/top-resolved')
return apiRequest('/api/top-resolved')
.then(data => {
// 处理多种可能的数据格式
let processedData = [];