Skip to content

Commit 87934bb

Browse files
committed
Update.
1 parent 82a1305 commit 87934bb

File tree

5 files changed

+31
-37
lines changed

5 files changed

+31
-37
lines changed

resource/static/main.js

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,9 @@ function addOrEditServer(server, conf) {
490490
serverList = JSON.parse(ddns);
491491
// 确保它是一个数组
492492
if (!Array.isArray(serverList)) {
493-
console.error("DDNS配置不是数组格式:", ddns);
494493
serverList = [];
495494
}
496495
} catch (error) {
497-
console.error("解析DDNS配置出错:", error);
498496
serverList = [];
499497
}
500498
const node = modal.find("i.dropdown.icon.ddnsProfiles");
@@ -571,7 +569,6 @@ function addOrEditServer(server, conf) {
571569

572570
// 专门为服务器模态框初始化dropdown,避免干扰标签创建
573571
setTimeout(function() {
574-
console.log('服务器模态框:延迟初始化dropdown');
575572
// 只初始化DDNS dropdown,因为这是服务器编辑需要的
576573
$(".server.modal .ui.ddns.search.dropdown").dropdown({
577574
clearable: true,
@@ -582,7 +579,6 @@ function addOrEditServer(server, conf) {
582579
// 禁用onChange事件,避免干扰现有标签
583580
onChange: function(value, text, $choice) {
584581
// 不做任何操作,保持现有标签不变
585-
console.log('服务器DDNS dropdown onChange被触发,但已禁用处理');
586582
}
587583
});
588584
}, 500); // 延迟500ms确保标签已经创建完成
@@ -777,17 +773,17 @@ function addOrEditCron(cron) {
777773
response.results.forEach(server => {
778774
window.serverIdToName[server.value] = server.name;
779775
});
780-
console.log('Cron编辑:服务器名称映射更新完成:', window.serverIdToName);
776+
781777
}
782778
// 初始化标签
783779
initializeCronLabels();
784780
}).catch(function() {
785-
console.log('Cron编辑:服务器名称映射获取失败,使用默认标签');
781+
786782
// 即使失败也要初始化标签
787783
initializeCronLabels();
788784
});
789785
} else {
790-
console.log('Cron编辑:使用现有的服务器名称映射');
786+
791787
// 映射已存在,直接初始化标签
792788
initializeCronLabels();
793789
}
@@ -805,7 +801,6 @@ function addOrEditCron(cron) {
805801

806802
// 专门为Cron模态框初始化dropdown,避免干扰标签创建
807803
setTimeout(function() {
808-
console.log('Cron模态框:延迟初始化dropdown');
809804
// 只初始化服务器dropdown,因为这是Cron任务需要的
810805
$(".cron.modal .ui.servers.search.dropdown").dropdown({
811806
clearable: true,
@@ -816,7 +811,6 @@ function addOrEditCron(cron) {
816811
// 禁用onChange事件,避免干扰现有标签
817812
onChange: function(value, text, $choice) {
818813
// 不做任何操作,保持现有标签不变
819-
console.log('Cron dropdown onChange被触发,但已禁用处理');
820814
}
821815
});
822816
}, 500); // 延迟500ms确保标签已经创建完成
@@ -940,7 +934,7 @@ function initializeServersDropdown() {
940934
});
941935

942936
hiddenInput.val(JSON.stringify(currentValues));
943-
console.log('服务器dropdown值更新:', currentValues);
937+
944938
},
945939
// 添加删除标签的事件处理
946940
onLabelCreate: function(value, text) {
@@ -964,7 +958,7 @@ function initializeServersDropdown() {
964958
});
965959

966960
hiddenInput.val(JSON.stringify(currentValues));
967-
console.log('服务器删除后值更新:', currentValues);
961+
968962

969963
// 移除标签
970964
$label.remove();
@@ -1011,7 +1005,7 @@ function initializeTasksDropdown() {
10111005
});
10121006

10131007
hiddenInput.val(JSON.stringify(currentValues));
1014-
console.log('任务dropdown值更新:', currentValues);
1008+
10151009
},
10161010
// 添加删除标签的事件处理
10171011
onLabelCreate: function(value, text) {
@@ -1035,7 +1029,7 @@ function initializeTasksDropdown() {
10351029
});
10361030

10371031
hiddenInput.val(JSON.stringify(currentValues));
1038-
console.log('任务删除后值更新:', currentValues);
1032+
10391033

10401034
// 移除标签
10411035
$label.remove();
@@ -1082,7 +1076,7 @@ function initializeDDNSDropdown() {
10821076
});
10831077

10841078
hiddenInput.val(JSON.stringify(currentValues));
1085-
console.log('DDNS dropdown值更新:', currentValues);
1079+
10861080
},
10871081
// 添加删除标签的事件处理
10881082
onLabelCreate: function(value, text) {
@@ -1106,7 +1100,7 @@ function initializeDDNSDropdown() {
11061100
});
11071101

11081102
hiddenInput.val(JSON.stringify(currentValues));
1109-
console.log('DDNS删除后值更新:', currentValues);
1103+
11101104

11111105
// 移除标签
11121106
$label.remove();
@@ -1173,7 +1167,7 @@ function bindDeleteIconEvents() {
11731167

11741168
// 全局函数:重新初始化所有dropdown
11751169
window.reinitializeAllDropdowns = function() {
1176-
console.log('重新初始化所有dropdown...');
1170+
11771171

11781172
// 销毁现有的dropdown
11791173
$(".ui.servers.search.dropdown").dropdown('destroy');
@@ -1185,7 +1179,7 @@ window.reinitializeAllDropdowns = function() {
11851179
initializeServersDropdown();
11861180
initializeTasksDropdown();
11871181
initializeDDNSDropdown();
1188-
console.log('所有dropdown重新初始化完成');
1182+
11891183
}, 200);
11901184
};
11911185

@@ -1755,23 +1749,23 @@ function getServerNameById(serverId) {
17551749

17561750
// 更新服务器名称映射的函数
17571751
function updateServerNameMapping() {
1758-
console.log('开始更新服务器名称映射...'); // 调试日志
1752+
17591753
// 在页面加载时和每次修改后更新映射
17601754
$.get('/api/search-server?word=')
17611755
.done(function(resp) {
1762-
console.log('服务器搜索API响应:', resp); // 调试日志
1756+
17631757
if (resp.success && resp.results) {
17641758
window.serverIdToName = {};
17651759
resp.results.forEach(server => {
17661760
window.serverIdToName[server.value] = server.name;
17671761
});
1768-
console.log('服务器名称映射更新完成:', window.serverIdToName); // 调试日志
1762+
17691763
} else {
1770-
console.log('服务器搜索API响应无效'); // 调试日志
1764+
17711765
}
17721766
})
17731767
.fail(function(xhr, status, error) {
1774-
console.error('服务器名称映射更新失败:', status, error); // 调试日志
1768+
17751769
});
17761770
}
17771771

@@ -1823,10 +1817,10 @@ function updateTaskNameMapping() {
18231817

18241818
// 转换表格中的JSON数据为可读名称
18251819
function convertTableJsonToNames() {
1826-
console.log('开始转换表格JSON数据为可读名称,当前路径:', window.location.pathname); // 调试日志
1820+
18271821
// 只在监控配置页面和Cron任务页面运行,跳过报警规则页面
18281822
if (window.location.pathname.includes('/notification')) {
1829-
console.log('跳过报警规则页面'); // 调试日志
1823+
18301824
return; // 跳过报警规则页面,保持原始显示
18311825
}
18321826

@@ -1895,21 +1889,21 @@ function convertTableJsonToNames() {
18951889
const $cronServersCell = $row.find('td').eq(8); // Cron页面第9列是服务器列表
18961890
if ($cronServersCell.length > 0) {
18971891
const cronServersText = $cronServersCell.text().trim();
1898-
console.log('Cron服务器列表原始文本:', cronServersText); // 调试日志
1892+
18991893
if (cronServersText.startsWith('[') && cronServersText.endsWith(']')) {
19001894
try {
19011895
const serverIds = JSON.parse(cronServersText);
1902-
console.log('解析的服务器ID数组:', serverIds); // 调试日志
1896+
19031897
if (Array.isArray(serverIds) && serverIds.length > 0) {
19041898
const serverNames = serverIds.map(id => {
19051899
const name = getServerNameById(id);
1906-
console.log(`服务器ID ${id} -> 名称: ${name}`); // 调试日志
1900+
19071901
return name;
19081902
}).join(', ');
1909-
console.log('转换后的服务器名称:', serverNames); // 调试日志
1903+
19101904
$cronServersCell.text(serverNames);
19111905
} else if (serverIds.length === 0) {
1912-
console.log('服务器ID数组为空,设置为"无"'); // 调试日志
1906+
19131907
$cronServersCell.text('无');
19141908
}
19151909
} catch (e) {

resource/template/dashboard-default/file.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@
396396
isUpCompleted = true;
397397
return;
398398
} else {
399-
console.log('Unknown identifier');
399+
// Unknown identifier
400400
return;
401401
}
402402
} else {
@@ -417,7 +417,7 @@
417417
};
418418

419419
socket.onclose = function (event) {
420-
console.log('WebSocket connection closed:', event);
420+
// WebSocket connection closed
421421
};
422422

423423
document.getElementById('refresh').addEventListener('click', listFile);
@@ -479,4 +479,4 @@
479479
</body>
480480

481481
</html>
482-
{{end}}
482+
{{end}}

resource/template/dashboard-default/terminal.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
await sleep(1500);
104104
doResize();
105105
} catch (error) {
106-
console.log('resize', error);
106+
// resize error
107107
} finally {
108108
sendResizing = false
109109
}
@@ -161,4 +161,4 @@
161161
</body>
162162

163163
</html>
164-
{{end}}
164+
{{end}}

resource/template/theme-default/home.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@
10101010
};
10111011

10121012
ws.onclose = function(event) {
1013-
console.log('WebSocket closed, reconnecting in 5 seconds...');
1013+
// WebSocket closed, reconnecting in 5 seconds
10141014
setTimeout(initWebSocket, 5000);
10151015
};
10161016

resource/template/theme-default/network.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@
8080
}
8181
},
8282
error: function() {
83-
console.log('无法获取监控配置,使用默认名称');
83+
// 无法获取监控配置,使用默认名称
8484
}
8585
});
8686
} catch (e) {
87-
console.log('获取监控配置失败,使用默认名称');
87+
// 获取监控配置失败,使用默认名称
8888
}
8989
new Vue({
9090
el: '#app',

0 commit comments

Comments
 (0)