web异常待修复

This commit is contained in:
Alex Yang
2025-11-24 10:50:03 +08:00
parent 534878fa4d
commit 4467a0bf4c
14 changed files with 30715 additions and 243 deletions

View File

@@ -101,11 +101,8 @@ function saveConfig() {
if (response.success) {
window.showNotification('配置保存成功', 'success');
// 询问是否需要重启服务以应用配置
confirmAction(
'配置已保存。某些更改可能需要重启服务才能生效。是否现在重启服务?',
() => restartService()
);
// 由于服务器没有提供重启API移除重启提示
// 直接提示用户配置已保存
} else {
window.showNotification(`保存失败: ${response.message || '未知错误'}`, 'error');
}
@@ -116,27 +113,7 @@ function saveConfig() {
});
}
// 重启服务
function restartService() {
apiRequest('/service/restart', 'POST')
.then(response => {
if (response.success) {
window.showNotification('服务正在重启,请稍后刷新页面', 'success');
// 等待几秒后重新加载页面
setTimeout(() => {
location.reload();
}, 3000);
} else {
window.showNotification(`重启失败: ${response.message || '未知错误'}`, 'error');
}
})
.catch(error => {
console.error('重启服务失败:', error);
// 重启服务可能会导致连接中断,这是正常的
window.showNotification('服务重启中,请手动刷新页面确认状态', 'info');
});
}
// 服务重启功能已移除因为服务器没有提供对应的API端点
// 验证IP地址格式
function isValidIp(ip) {