Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0085c70266 | |||
| 5f9439c8a9 | |||
| 0d0354ac4e | |||
| 47a38032a6 | |||
| b59931f357 | |||
| 1420b08a43 |
BIN
__pycache__/app.cpython-312.pyc
Normal file
BIN
__pycache__/app.cpython-312.pyc
Normal file
Binary file not shown.
12
alert_config.json
Normal file
12
alert_config.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"thresholds": {
|
||||
"cpu": 75,
|
||||
"memory": 80,
|
||||
"disk": 85,
|
||||
"interval": 60
|
||||
},
|
||||
"web_settings": {
|
||||
"external_ip": "121.40.164.32",
|
||||
"refresh_interval": 30
|
||||
}
|
||||
}
|
||||
413
app.py
413
app.py
@@ -30,6 +30,27 @@ try:
|
||||
except ImportError:
|
||||
HAS_PSUTIL = False
|
||||
|
||||
# CPU 温度获取
|
||||
def get_cpu_temperatures():
|
||||
"""获取 CPU Package 温度"""
|
||||
temps = {'package_0': None, 'package_1': None}
|
||||
try:
|
||||
result = subprocess.run(['sensors'], capture_output=True, text=True, timeout=5)
|
||||
output = result.stdout
|
||||
# 解析 Package id 0 和 Package id 1
|
||||
for line in output.split('\n'):
|
||||
if 'Package id 0:' in line:
|
||||
match = re.search(r'Package id 0:\s*([+\d.]+)°C', line)
|
||||
if match:
|
||||
temps['package_0'] = float(match.group(1).replace('+', ''))
|
||||
elif 'Package id 1:' in line:
|
||||
match = re.search(r'Package id 1:\s*([+\d.]+)°C', line)
|
||||
if match:
|
||||
temps['package_1'] = float(match.group(1).replace('+', ''))
|
||||
except Exception as e:
|
||||
log_message(f"获取CPU温度失败: {e}")
|
||||
return temps
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
@@ -674,34 +695,34 @@ def api_cron_categories():
|
||||
|
||||
@app.route('/api/cron/sync', methods=['POST'])
|
||||
def api_cron_sync():
|
||||
"""从系统 crontab 同步到数据库"""
|
||||
"""从系统 crontab 同步到数据库(清空旧的,只保留当前系统实际存在的)"""
|
||||
crons = get_system_crons()
|
||||
user_crons = [c for c in crons if c['source'] == 'user']
|
||||
|
||||
db = get_db()
|
||||
c = db.cursor()
|
||||
|
||||
# 清空数据库中的旧任务
|
||||
c.execute("DELETE FROM cron_history WHERE task_id IN (SELECT id FROM cron_tasks)")
|
||||
c.execute("DELETE FROM cron_logs WHERE task_id IN (SELECT id FROM cron_tasks)")
|
||||
c.execute("DELETE FROM cron_tasks")
|
||||
|
||||
synced_count = 0
|
||||
for cron in user_crons:
|
||||
# 检查是否已存在
|
||||
c.execute("SELECT id FROM cron_tasks WHERE expression = ? AND command = ?", (cron['expression'], cron['command']))
|
||||
existing = c.fetchone()
|
||||
# 尝试从命令推断分类和名称
|
||||
name = guess_cron_name(cron['command'])
|
||||
category = guess_cron_category(cron['command'])
|
||||
|
||||
if not existing:
|
||||
# 尝试从命令推断分类和名称
|
||||
name = guess_cron_name(cron['command'])
|
||||
category = guess_cron_category(cron['command'])
|
||||
|
||||
c.execute('''INSERT INTO cron_tasks (name, expression, command, description, category, enabled)
|
||||
VALUES (?, ?, ?, ?, ?, 1)''',
|
||||
(name, cron['expression'], cron['command'], '', category))
|
||||
synced_count += 1
|
||||
c.execute('''INSERT INTO cron_tasks (name, expression, command, description, category, enabled)
|
||||
VALUES (?, ?, ?, ?, ?, 1)''',
|
||||
(name, cron['expression'], cron['command'], '', category))
|
||||
synced_count += 1
|
||||
|
||||
db.commit()
|
||||
|
||||
log_message(f"从系统 crontab 同步了 {synced_count} 个任务")
|
||||
log_message(f"从系统 crontab 同步了 {synced_count} 个任务(已清空旧任务)")
|
||||
|
||||
return jsonify({'message': f'同步完成,新增 {synced_count} 个任务'})
|
||||
return jsonify({'message': f'同步完成,共 {synced_count} 个任务', 'count': synced_count})
|
||||
|
||||
|
||||
# ==================== 系统资源监控 API ====================
|
||||
@@ -718,6 +739,9 @@ def api_system_stats():
|
||||
cpu_count = psutil.cpu_count(logical=False) or psutil.cpu_count()
|
||||
cpu_count_logical = psutil.cpu_count(logical=True)
|
||||
|
||||
# CPU 温度
|
||||
cpu_temps = get_cpu_temperatures()
|
||||
|
||||
# 内存
|
||||
mem = psutil.virtual_memory()
|
||||
mem_total_gb = round(mem.total / (1024**3), 2)
|
||||
@@ -769,7 +793,9 @@ def api_system_stats():
|
||||
'cpu': {
|
||||
'percent': cpu_percent,
|
||||
'count': cpu_count,
|
||||
'logical': cpu_count_logical
|
||||
'logical': cpu_count_logical,
|
||||
'temp_package_0': cpu_temps['package_0'],
|
||||
'temp_package_1': cpu_temps['package_1']
|
||||
},
|
||||
'memory': {
|
||||
'total_gb': mem_total_gb,
|
||||
@@ -903,6 +929,181 @@ def get_next_run_time(expression):
|
||||
return '无法计算'
|
||||
|
||||
|
||||
# ==================== 配置管理 API ====================
|
||||
|
||||
CONFIG_FILE = 'config.json'
|
||||
|
||||
def load_full_config():
|
||||
"""加载完整配置(合并项目和预警配置)"""
|
||||
# 加载 projects.json 完整数据
|
||||
try:
|
||||
with open(PROJECTS_FILE, 'r', encoding='utf-8') as f:
|
||||
projects_data = json.load(f)
|
||||
except:
|
||||
projects_data = {'server': {}, 'projects': [], 'external_services': []}
|
||||
|
||||
# 加载预警配置
|
||||
alert_config = {}
|
||||
if os.path.exists('alert_config.json'):
|
||||
try:
|
||||
with open('alert_config.json', 'r', encoding='utf-8') as f:
|
||||
alert_config = json.load(f)
|
||||
except:
|
||||
pass
|
||||
|
||||
# 合并配置
|
||||
config = {
|
||||
"version": "1.0",
|
||||
"exported_at": datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
|
||||
"server": projects_data.get('server', {}),
|
||||
"projects": projects_data.get('projects', []),
|
||||
"external_services": projects_data.get('external_services', []),
|
||||
"web_settings": {
|
||||
"external_ip": alert_config.get('web_settings', {}).get('external_ip', '121.40.164.32'),
|
||||
"refresh_interval": alert_config.get('web_settings', {}).get('refresh_interval', 30)
|
||||
},
|
||||
"alerts": alert_config.get('alerts', alert_config) # 支持两种结构
|
||||
}
|
||||
return config
|
||||
|
||||
def save_full_config(config):
|
||||
"""保存完整配置"""
|
||||
# 保存 projects 部分
|
||||
projects_data = {
|
||||
"server": config.get('server', {}),
|
||||
"projects": config.get('projects', []),
|
||||
"external_services": config.get('external_services', [])
|
||||
}
|
||||
with open(PROJECTS_FILE, 'w', encoding='utf-8') as f:
|
||||
json.dump(projects_data, f, ensure_ascii=False, indent=2)
|
||||
|
||||
# 保存预警配置和网页设置
|
||||
alert_config = {
|
||||
"web_settings": config.get('web_settings', {}),
|
||||
"thresholds": config.get('alerts', {}).get('thresholds', config.get('alerts', {}))
|
||||
}
|
||||
with open('alert_config.json', 'w', encoding='utf-8') as f:
|
||||
json.dump(alert_config, f, ensure_ascii=False, indent=2)
|
||||
|
||||
return True
|
||||
|
||||
@app.route('/api/config/export', methods=['GET'])
|
||||
def api_config_export():
|
||||
"""导出配置文件"""
|
||||
try:
|
||||
config = load_full_config()
|
||||
return jsonify(config)
|
||||
except Exception as e:
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
@app.route('/api/config/import', methods=['POST'])
|
||||
def api_config_import():
|
||||
"""导入配置文件"""
|
||||
try:
|
||||
config = request.get_json()
|
||||
if not config:
|
||||
return jsonify({'error': '无效的配置数据'}), 400
|
||||
|
||||
# 验证配置结构
|
||||
required_keys = ['server', 'projects']
|
||||
for key in required_keys:
|
||||
if key not in config:
|
||||
return jsonify({'error': f'缺少必要字段: {key}'}), 400
|
||||
|
||||
# 备份当前配置
|
||||
backup_time = datetime.now().strftime('%Y%m%d_%H%M%S')
|
||||
if os.path.exists(PROJECTS_FILE):
|
||||
shutil.copy(PROJECTS_FILE, f'{PROJECTS_FILE}.bak.{backup_time}')
|
||||
if os.path.exists('alert_config.json'):
|
||||
shutil.copy('alert_config.json', f'alert_config.json.bak.{backup_time}')
|
||||
|
||||
# 保存新配置
|
||||
save_full_config(config)
|
||||
|
||||
return jsonify({
|
||||
'message': '配置导入成功',
|
||||
'projects_count': len(config.get('projects', [])),
|
||||
'services_count': len(config.get('external_services', []))
|
||||
})
|
||||
except Exception as e:
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
@app.route('/api/alerts', methods=['GET'])
|
||||
def api_get_alerts():
|
||||
"""获取预警配置"""
|
||||
try:
|
||||
if os.path.exists('alert_config.json'):
|
||||
with open('alert_config.json', 'r', encoding='utf-8') as f:
|
||||
return jsonify(json.load(f))
|
||||
return jsonify({})
|
||||
except Exception as e:
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
@app.route('/api/alerts', methods=['POST'])
|
||||
def api_save_alerts():
|
||||
"""保存预警配置"""
|
||||
try:
|
||||
config = request.get_json()
|
||||
|
||||
# 加载现有配置
|
||||
existing_config = {}
|
||||
if os.path.exists('alert_config.json'):
|
||||
try:
|
||||
with open('alert_config.json', 'r', encoding='utf-8') as f:
|
||||
existing_config = json.load(f)
|
||||
except:
|
||||
pass
|
||||
|
||||
# 合并配置(保留web_settings)
|
||||
if 'thresholds' in config:
|
||||
existing_config['thresholds'] = config['thresholds']
|
||||
if 'web_settings' in config:
|
||||
existing_config['web_settings'] = config['web_settings']
|
||||
|
||||
with open('alert_config.json', 'w', encoding='utf-8') as f:
|
||||
json.dump(existing_config, f, ensure_ascii=False, indent=2)
|
||||
return jsonify({'message': '保存成功'})
|
||||
except Exception as e:
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
@app.route('/api/web-settings', methods=['GET'])
|
||||
def api_get_web_settings():
|
||||
"""获取网页设置"""
|
||||
try:
|
||||
if os.path.exists('alert_config.json'):
|
||||
with open('alert_config.json', 'r', encoding='utf-8') as f:
|
||||
config = json.load(f)
|
||||
web_settings = config.get('web_settings', {})
|
||||
return jsonify(web_settings)
|
||||
return jsonify({'external_ip': '121.40.164.32', 'refresh_interval': 30})
|
||||
except Exception as e:
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
@app.route('/api/web-settings', methods=['POST'])
|
||||
def api_save_web_settings():
|
||||
"""保存网页设置"""
|
||||
try:
|
||||
settings = request.get_json()
|
||||
|
||||
# 加载现有配置
|
||||
existing_config = {}
|
||||
if os.path.exists('alert_config.json'):
|
||||
try:
|
||||
with open('alert_config.json', 'r', encoding='utf-8') as f:
|
||||
existing_config = json.load(f)
|
||||
except:
|
||||
pass
|
||||
|
||||
# 更新网页设置
|
||||
existing_config['web_settings'] = settings
|
||||
|
||||
with open('alert_config.json', 'w', encoding='utf-8') as f:
|
||||
json.dump(existing_config, f, ensure_ascii=False, indent=2)
|
||||
return jsonify({'message': '保存成功'})
|
||||
except Exception as e:
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
|
||||
# ==================== 邮件通知 API ====================
|
||||
|
||||
@app.route('/api/email/send', methods=['POST'])
|
||||
@@ -1235,11 +1436,18 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-gray-400 text-sm">对外IP:</span>
|
||||
<input type="text" id="externalIp" value="192.168.2.17" class="bg-gray-700 text-gray-200 px-2 py-1 rounded text-sm w-28" onchange="saveExternalIp()">
|
||||
<input type="text" id="externalIp" value="121.40.164.32" class="bg-gray-700 text-gray-200 px-2 py-1 rounded text-sm w-28" onchange="saveExternalIp()">
|
||||
</div>
|
||||
<button onclick="refreshAll()" class="btn bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-lg flex items-center gap-2">
|
||||
<i class="ri-refresh-line"></i> 刷新
|
||||
</button>
|
||||
<button onclick="exportConfig()" class="btn bg-green-600 hover:bg-green-700 px-4 py-2 rounded-lg flex items-center gap-2">
|
||||
<i class="ri-download-line"></i> 导出配置
|
||||
</button>
|
||||
<label class="btn bg-purple-600 hover:bg-purple-700 px-4 py-2 rounded-lg flex items-center gap-2 cursor-pointer">
|
||||
<i class="ri-upload-line"></i> 导入配置
|
||||
<input type="file" accept=".json" onchange="importConfig(event)" class="hidden">
|
||||
</label>
|
||||
<div class="flex items-center gap-1">
|
||||
<span class="text-gray-400 text-xs">间隔:</span>
|
||||
<input type="number" id="refreshInterval" value="30" min="5" max="300" class="bg-gray-700 text-gray-200 px-2 py-1 rounded text-xs w-12" onchange="updateRefreshInterval()">
|
||||
@@ -1377,10 +1585,16 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
||||
<div id="cpuBar" class="bg-blue-500 h-4 rounded-full transition-all duration-300" style="width: 0%"></div>
|
||||
</div>
|
||||
<p class="text-gray-400 text-sm">物理核心: <span id="cpuPhysical">-</span> | 逻辑核心: <span id="cpuLogical">-</span></p>
|
||||
<div class="mt-3 pt-3 border-t border-gray-700">
|
||||
<p class="text-gray-400 text-sm flex items-center gap-4">
|
||||
<span><i class="ri-temp-hot-line text-red-400"></i> CPU0: <span id="cpuTemp0" class="text-white font-medium">-</span>°C</span>
|
||||
<span><i class="ri-temp-hot-line text-red-400"></i> CPU1: <span id="cpuTemp1" class="text-white font-medium">-</span>°C</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card rounded-xl p-6">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<h3 class="font-bold text-lg flex items-center gap-2"><i class="ri-memory-card-line text-green-400"></i> 内存使用</h3>
|
||||
<h3 class="font-bold text-lg flex items-center gap-2"><i class="ri-database-2-line text-green-400"></i> 内存使用</h3>
|
||||
<span id="memPercent" class="text-2xl font-bold text-green-400">-</span>
|
||||
</div>
|
||||
<div class="w-full bg-gray-700 rounded-full h-4 mb-2">
|
||||
@@ -1930,24 +2144,50 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
||||
}
|
||||
|
||||
// 加载阈值设置
|
||||
function loadThresholds() {
|
||||
const saved = localStorage.getItem('systemThresholds');
|
||||
if (saved) {
|
||||
thresholds = JSON.parse(saved);
|
||||
document.getElementById('thresholdCpu').value = thresholds.cpu || 80;
|
||||
document.getElementById('thresholdMemory').value = thresholds.memory || 85;
|
||||
document.getElementById('thresholdDisk').value = thresholds.disk || 90;
|
||||
document.getElementById('thresholdInterval').value = thresholds.interval || 60;
|
||||
async function loadThresholds() {
|
||||
try {
|
||||
const response = await fetch('/api/alerts');
|
||||
const config = await response.json();
|
||||
|
||||
if (config.thresholds) {
|
||||
thresholds = config.thresholds;
|
||||
document.getElementById('thresholdCpu').value = thresholds.cpu || 80;
|
||||
document.getElementById('thresholdMemory').value = thresholds.memory || 85;
|
||||
document.getElementById('thresholdDisk').value = thresholds.disk || 90;
|
||||
document.getElementById('thresholdInterval').value = thresholds.interval || 60;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('加载阈值配置失败:', e);
|
||||
}
|
||||
}
|
||||
|
||||
// 保存阈值设置
|
||||
function saveThresholds() {
|
||||
async function saveThresholds() {
|
||||
thresholds.cpu = parseInt(document.getElementById('thresholdCpu').value) || 80;
|
||||
thresholds.memory = parseInt(document.getElementById('thresholdMemory').value) || 85;
|
||||
thresholds.disk = parseInt(document.getElementById('thresholdDisk').value) || 90;
|
||||
thresholds.interval = parseInt(document.getElementById('thresholdInterval').value) || 60;
|
||||
localStorage.setItem('systemThresholds', JSON.stringify(thresholds));
|
||||
|
||||
try {
|
||||
// 先获取现有配置
|
||||
let config = {};
|
||||
try {
|
||||
const response = await fetch('/api/alerts');
|
||||
config = await response.json();
|
||||
} catch (e) {}
|
||||
|
||||
// 更新阈值
|
||||
config.thresholds = thresholds;
|
||||
|
||||
// 保存到服务器
|
||||
await fetch('/api/alerts', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(config)
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('保存阈值配置失败:', e);
|
||||
}
|
||||
}
|
||||
|
||||
// 桌面通知开关(已在外部声明 desktopNotifyEnabled)
|
||||
@@ -2114,6 +2354,13 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
||||
document.getElementById('cpuBar').style.width = data.cpu.percent + '%';
|
||||
document.getElementById('cpuPhysical').textContent = data.cpu.count;
|
||||
document.getElementById('cpuLogical').textContent = data.cpu.logical;
|
||||
// CPU 温度
|
||||
if (data.cpu.temp_package_0 !== null) {
|
||||
document.getElementById('cpuTemp0').textContent = data.cpu.temp_package_0.toFixed(1);
|
||||
}
|
||||
if (data.cpu.temp_package_1 !== null) {
|
||||
document.getElementById('cpuTemp1').textContent = data.cpu.temp_package_1.toFixed(1);
|
||||
}
|
||||
|
||||
// 内存
|
||||
document.getElementById('memPercent').textContent = data.memory.percent.toFixed(1) + '%';
|
||||
@@ -2239,9 +2486,19 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
||||
}
|
||||
|
||||
// IP 保存
|
||||
function saveExternalIp() {
|
||||
async function saveExternalIp() {
|
||||
externalIp = document.getElementById('externalIp').value.trim();
|
||||
localStorage.setItem('externalIp', externalIp);
|
||||
|
||||
try {
|
||||
await fetch('/api/web-settings', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ external_ip: externalIp, refresh_interval: parseInt(document.getElementById('refreshInterval').value) || 30 })
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('保存失败:', e);
|
||||
}
|
||||
|
||||
renderProjects();
|
||||
}
|
||||
|
||||
@@ -3321,6 +3578,64 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
||||
}
|
||||
}
|
||||
|
||||
// 导出配置
|
||||
async function exportConfig() {
|
||||
try {
|
||||
const response = await fetch('/api/config/export');
|
||||
const config = await response.json();
|
||||
|
||||
// 创建下载文件
|
||||
const blob = new Blob([JSON.stringify(config, null, 2)], { type: 'application/json' });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = `project-panel-config-${new Date().toISOString().slice(0,10)}.json`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(url);
|
||||
|
||||
alert('配置导出成功!');
|
||||
} catch (e) {
|
||||
alert('导出失败: ' + e.message);
|
||||
}
|
||||
}
|
||||
|
||||
// 导入配置
|
||||
async function importConfig(event) {
|
||||
const file = event.target.files[0];
|
||||
if (!file) return;
|
||||
|
||||
if (!confirm('导入配置将覆盖当前所有设置,是否继续?')) {
|
||||
event.target.value = '';
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const text = await file.text();
|
||||
const config = JSON.parse(text);
|
||||
|
||||
const response = await fetch('/api/config/import', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(config)
|
||||
});
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
if (result.error) {
|
||||
alert('导入失败: ' + result.error);
|
||||
} else {
|
||||
alert(`配置导入成功!\n项目数: ${result.projects_count}\n外部服务数: ${result.services_count}`);
|
||||
location.reload();
|
||||
}
|
||||
} catch (e) {
|
||||
alert('导入失败: ' + e.message);
|
||||
}
|
||||
|
||||
event.target.value = '';
|
||||
}
|
||||
|
||||
function scrollToTop() { window.scrollTo({ top: 0, behavior: 'smooth' }); }
|
||||
function scrollToBottom() { window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' }); }
|
||||
|
||||
@@ -3343,15 +3658,43 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
||||
|
||||
// 初始化
|
||||
loadProjects();
|
||||
loadWebSettings(); // 加载网页设置
|
||||
|
||||
let refreshIntervalMs = parseInt(localStorage.getItem('refreshInterval') || '30') * 1000;
|
||||
document.getElementById('refreshInterval').value = refreshIntervalMs / 1000;
|
||||
let refreshIntervalMs = 30 * 1000; // 默认值
|
||||
let refreshTimer = setInterval(() => { if (currentTab === 'projects') loadProjects(); }, refreshIntervalMs);
|
||||
|
||||
// 加载网页设置
|
||||
async function loadWebSettings() {
|
||||
try {
|
||||
const response = await fetch('/api/web-settings');
|
||||
const settings = await response.json();
|
||||
|
||||
if (settings.external_ip) {
|
||||
externalIp = settings.external_ip;
|
||||
document.getElementById('externalIp').value = settings.external_ip;
|
||||
}
|
||||
if (settings.refresh_interval) {
|
||||
document.getElementById('refreshInterval').value = settings.refresh_interval;
|
||||
clearInterval(refreshTimer);
|
||||
refreshIntervalMs = settings.refresh_interval * 1000;
|
||||
refreshTimer = setInterval(() => { if (currentTab === 'projects') loadProjects(); }, refreshIntervalMs);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('加载网页设置失败:', e);
|
||||
}
|
||||
}
|
||||
|
||||
function updateRefreshInterval() {
|
||||
const seconds = Math.max(5, Math.min(300, parseInt(document.getElementById('refreshInterval').value) || 30));
|
||||
document.getElementById('refreshInterval').value = seconds;
|
||||
localStorage.setItem('refreshInterval', seconds);
|
||||
|
||||
// 保存到服务器
|
||||
fetch('/api/web-settings', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ external_ip: externalIp, refresh_interval: seconds })
|
||||
}).catch(e => console.error('保存失败:', e));
|
||||
|
||||
clearInterval(refreshTimer);
|
||||
refreshTimer = setInterval(() => { if (currentTab === 'projects') loadProjects(); }, seconds * 1000);
|
||||
}
|
||||
@@ -3372,8 +3715,8 @@ if __name__ == '__main__':
|
||||
|
||||
log_message("=" * 50)
|
||||
log_message("项目服务管理面板 v2.0.0 启动")
|
||||
log_message("访问地址: http://localhost:19013")
|
||||
log_message("访问地址: http://localhost:16022")
|
||||
log_message(f"进程PID: {os.getpid()}")
|
||||
log_message("=" * 50)
|
||||
|
||||
app.run(host='0.0.0.0', port=19013, debug=False)
|
||||
app.run(host='0.0.0.0', port=16022, debug=False)
|
||||
BIN
cron_manager.db
BIN
cron_manager.db
Binary file not shown.
207
logs/app.log
207
logs/app.log
@@ -30095,3 +30095,210 @@ Press CTRL+C to quit
|
||||
192.168.2.8 - - [24/Apr/2026 10:42:22] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:42:24] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:42:26] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:42:29] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:42:30] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:42:34] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:42:36] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:42:39] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:42:40] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:42:44] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:42:46] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:42:49] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:42:50] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:42:51] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:42:52] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:42:54] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:42:56] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:42:59] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:43:00] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:43:04] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:43:06] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:43:09] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:43:11] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:43:14] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:43:15] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:43:19] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:43:20] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:43:21] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:43:22] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:43:24] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:43:26] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:43:29] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:43:30] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:43:34] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:43:36] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:43:39] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:43:40] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:43:44] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:43:46] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:43:49] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:43:50] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:43:50] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:43:52] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:43:54] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:43:56] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:44:00] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:44:01] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:44:04] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:44:06] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:44:10] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:44:11] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:44:14] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:44:16] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:44:20] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:44:21] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:44:21] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:44:22] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:44:24] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:44:26] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:44:30] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:44:32] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:44:34] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:44:36] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:44:40] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:44:42] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:44:44] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:44:46] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:44:50] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:44:51] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:44:52] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:44:53] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:44:54] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:44:56] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:45:01] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:45:02] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:45:04] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:45:06] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:45:11] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:45:12] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:45:14] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:45:16] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:45:17] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:45:21] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:45:21] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:45:22] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:45:22] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:45:22] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:45:23] "GET /api/system/stats HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:45:23] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:45:24] "GET /api/system/stats HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:45:31] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:45:31] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:45:32] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:45:32] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:45:41] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:45:41] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:45:42] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:45:42] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:45:51] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:45:51] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:45:52] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:45:52] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:45:52] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:45:53] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:46:01] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:46:01] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:46:02] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:46:02] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:46:11] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:46:11] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:46:12] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:46:12] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:46:21] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:46:21] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:46:22] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:46:22] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:46:22] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:46:23] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:46:31] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:46:31] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:46:32] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:46:32] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:46:41] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:46:41] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:46:42] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:46:42] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:46:51] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:46:51] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:46:52] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:46:52] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:46:52] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:46:53] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:47:01] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:47:01] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:47:02] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:47:02] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:47:11] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:47:11] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:47:12] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:47:12] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:47:21] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:47:21] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:47:22] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:47:22] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:47:22] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:47:23] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:47:31] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:47:31] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:47:32] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:47:33] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:47:34] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:47:36] "GET /api/system/stats HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:47:37] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:47:38] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:47:39] "GET /api/system/stats HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:47:41] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:47:43] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:47:47] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:47:48] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:47:51] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:47:52] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:47:53] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:47:54] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:47:57] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:47:58] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:48:02] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:48:03] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:48:07] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:48:08] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:48:12] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:48:13] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:48:17] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:48:18] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:48:22] "GET / HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:48:23] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:48:24] "GET /api/projects HTTP/1.1" 200 -
|
||||
192.168.2.8 - - [24/Apr/2026 10:48:24] "GET /api/projects HTTP/1.1" 200 -
|
||||
127.0.0.1 - - [24/Apr/2026 10:48:27] "GET / HTTP/1.1" 200 -
|
||||
192.168.2.14 - - [24/Apr/2026 10:48:28] "GET /api/projects HTTP/1.1" 200 -
|
||||
[2026-06-01 11:53:42] ⚠️ 进程收到 SIGTERM 信号,即将退出!
|
||||
[2026-06-01 11:53:43] ==================================================
|
||||
[2026-06-01 11:53:43] 项目服务管理面板 v2.0.0 启动
|
||||
[2026-06-01 11:53:43] 访问地址: http://localhost:16022
|
||||
[2026-06-01 11:53:43] 进程PID: 776708
|
||||
[2026-06-01 11:53:43] ==================================================
|
||||
[2026-06-01 11:56:06] ⚠️ 进程收到 SIGTERM 信号,即将退出!
|
||||
[2026-06-01 11:56:07] ==================================================
|
||||
[2026-06-01 11:56:07] 项目服务管理面板 v2.0.0 启动
|
||||
[2026-06-01 11:56:07] 访问地址: http://localhost:16022
|
||||
[2026-06-01 11:56:07] 进程PID: 777176
|
||||
[2026-06-01 11:56:07] ==================================================
|
||||
[2026-06-01 12:01:26] ⚠️ 进程收到 SIGTERM 信号,即将退出!
|
||||
[2026-06-01 12:01:28] ==================================================
|
||||
[2026-06-01 12:01:28] 项目服务管理面板 v2.0.0 启动
|
||||
[2026-06-01 12:01:28] 访问地址: http://localhost:16022
|
||||
[2026-06-01 12:01:28] 进程PID: 778445
|
||||
[2026-06-01 12:01:28] ==================================================
|
||||
[2026-06-01 12:02:47] ⚠️ 进程收到 SIGTERM 信号,即将退出!
|
||||
[2026-06-01 12:02:49] ==================================================
|
||||
[2026-06-01 12:02:49] 项目服务管理面板 v2.0.0 启动
|
||||
[2026-06-01 12:02:49] 访问地址: http://localhost:16022
|
||||
[2026-06-01 12:02:49] 进程PID: 778757
|
||||
[2026-06-01 12:02:49] ==================================================
|
||||
[2026-06-01 12:11:08] ⚠️ 进程收到 SIGTERM 信号,即将退出!
|
||||
[2026-06-01 12:11:34] ==================================================
|
||||
[2026-06-01 12:11:34] 项目服务管理面板 v2.0.0 启动
|
||||
[2026-06-01 12:11:34] 访问地址: http://localhost:16022
|
||||
[2026-06-01 12:11:34] 进程PID: 780597
|
||||
[2026-06-01 12:11:34] ==================================================
|
||||
[2026-06-01 12:12:13] 从系统 crontab 同步了 0 个任务(已清空旧任务)
|
||||
|
||||
6
logs/pdf-translate-web.log
Normal file
6
logs/pdf-translate-web.log
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
==================================================
|
||||
[2026-06-01T11:59:52.266560] start
|
||||
Command: mkdir -p logs && nohup /home/hz1/miniconda3/envs/openclaw/bin/python3.12 app.py > logs/app.log 2>&1 & disown
|
||||
Directory: /home/openclaw/.openclaw/workspace-hz4th_coder/works/pdf-translate-web
|
||||
/bin/sh: 1: disown: not found
|
||||
235
projects.json
235
projects.json
@@ -1,221 +1,48 @@
|
||||
{
|
||||
"server": {
|
||||
"name": "hz1-PowerEdge-R730xd",
|
||||
"description": "黄庄1号服务器 - PowerEdge R730xd",
|
||||
"python_path": "/home/hz1/miniconda3/envs/openclaw/bin/python3.12",
|
||||
"updated": "2026-06-01"
|
||||
},
|
||||
"projects": [
|
||||
{
|
||||
"id": "pdf-translate-v2",
|
||||
"name": "PDF翻译助手 V2",
|
||||
"id": "pdf-translate-web",
|
||||
"name": "PDF翻译助手",
|
||||
"type": "web",
|
||||
"ports": [19000],
|
||||
"directory": "works/pdf-translate-web-v2",
|
||||
"start_cmd": "mkdir -p logs && nohup python3 app.py > logs/app.log 2>&1 & disown",
|
||||
"health_url": "http://localhost:19000/api/health",
|
||||
"ports": [16021],
|
||||
"directory": "works/pdf-translate-web",
|
||||
"start_cmd": "mkdir -p logs && nohup /home/hz1/miniconda3/envs/openclaw/bin/python3.12 app.py > logs/app.log 2>&1 & disown",
|
||||
"stop_cmd": "pkill -f 'python.*pdf-translate-web.*app.py' || true",
|
||||
"health_url": "http://localhost:16021/",
|
||||
"description": "英文PDF翻译中文网站,支持用户系统、会员体系",
|
||||
"admin_url": "http://localhost:19000/admin",
|
||||
"git_repo": "http://192.168.2.8:12007/coder/pdf-translate-web",
|
||||
"version": "v2.1.0"
|
||||
},
|
||||
{
|
||||
"id": "llm-index-rag",
|
||||
"name": "LLM Index RAG",
|
||||
"type": "web",
|
||||
"ports": [19001],
|
||||
"directory": "works/llm-index-rag",
|
||||
"start_cmd": "mkdir -p logs && nohup python3 app.py > logs/app.log 2>&1 & disown",
|
||||
"health_url": "http://localhost:19001/api/stats",
|
||||
"description": "基于索引和搜索的知识检索系统",
|
||||
"admin_url": "http://localhost:19001/settings",
|
||||
"git_repo": "http://192.168.2.8:12007/coder/llm-index-rag",
|
||||
"version": "v1.1.2"
|
||||
},
|
||||
{
|
||||
"id": "snippet-notes",
|
||||
"name": "碎片信息记录",
|
||||
"type": "web",
|
||||
"ports": [19009],
|
||||
"directory": "works/snippet-notes",
|
||||
"start_cmd": "mkdir -p logs && nohup python3 app.py > logs/app.log 2>&1 & disown",
|
||||
"health_url": "http://localhost:19009/api/notes",
|
||||
"description": "碎片信息记录工具,AI自动生成标题",
|
||||
"git_repo": null,
|
||||
"version": "v1.0.0"
|
||||
},
|
||||
{
|
||||
"id": "param-hub",
|
||||
"name": "ParamHub Python",
|
||||
"type": "web",
|
||||
"ports": [19010],
|
||||
"directory": "works/param-hub-python",
|
||||
"start_cmd": "mkdir -p logs && nohup python3 app.py > logs/app.log 2>&1 & disown",
|
||||
"health_url": "http://localhost:19010/api/stats",
|
||||
"description": "AI大模型与硬件参数速查平台",
|
||||
"admin_url": "http://localhost:19010/admin",
|
||||
"git_repo": "http://192.168.2.8:12007/coder/param-hub-python",
|
||||
"version": "v1.2.0"
|
||||
},
|
||||
{
|
||||
"id": "ai-chat-system",
|
||||
"name": "AI对话系统",
|
||||
"type": "web",
|
||||
"ports": [19020],
|
||||
"directory": "works/ai-chat",
|
||||
"start_cmd": "mkdir -p logs && nohup python3 main_v2.py > logs/app.log 2>&1 & disown",
|
||||
"health_url": "http://localhost:19020/api/admin/stats",
|
||||
"description": "网页端和Matrix端实时同步的AI聊天系统",
|
||||
"admin_url": "http://localhost:19020/admin",
|
||||
"git_repo": "http://192.168.2.8:12007/coder/ai-chat-system",
|
||||
"version": "v2.5.4"
|
||||
},
|
||||
{
|
||||
"id": "product-crawler",
|
||||
"name": "产品参数爬取系统",
|
||||
"type": "web",
|
||||
"ports": [19011],
|
||||
"directory": "/home/xian/.openclaw/common/projects/product-crawler",
|
||||
"start_cmd": "mkdir -p logs && nohup python3 app.py > logs/app.log 2>&1 & disown",
|
||||
"health_url": "http://localhost:19011/api/products",
|
||||
"description": "自动从官网爬取产品参数信息",
|
||||
"admin_url": "http://localhost:19011/admin",
|
||||
"git_repo": "http://192.168.2.8:12007/coder/product-crawler",
|
||||
"version": "v2.0.0"
|
||||
},
|
||||
{
|
||||
"id": "llm-proxy",
|
||||
"name": "LLM Proxy",
|
||||
"type": "web",
|
||||
"ports": [19007],
|
||||
"directory": "/home/xian/.openclaw/common/projects/llm-proxy",
|
||||
"start_cmd": "mkdir -p logs && nohup python3 app.py > logs/app.log 2>&1 & disown",
|
||||
"health_url": "http://localhost:19007/health",
|
||||
"description": "大模型API中转系统,多提供商调度",
|
||||
"admin_url": "http://localhost:19007/admin",
|
||||
"git_repo": "http://192.168.2.8:12007/coder/llm-proxy",
|
||||
"admin_url": "http://localhost:16021/admin",
|
||||
"git_repo": "http://121.40.164.32:12007/coder/pdf-translate-web",
|
||||
"version": "v2.0.0"
|
||||
},
|
||||
{
|
||||
"id": "project-panel",
|
||||
"name": "项目服务管理面板",
|
||||
"type": "web",
|
||||
"ports": [19013],
|
||||
"ports": [16022],
|
||||
"directory": "works/project-panel",
|
||||
"start_cmd": "mkdir -p logs && nohup python3 app.py > logs/app.log 2>&1 & disown",
|
||||
"health_url": "http://localhost:19013/",
|
||||
"start_cmd": "mkdir -p logs && nohup /home/hz1/miniconda3/envs/openclaw/bin/python3.12 app.py > logs/app.log 2>&1 & disown",
|
||||
"stop_cmd": "pkill -f 'python.*project-panel.*app.py' || true",
|
||||
"health_url": "http://localhost:16022/",
|
||||
"description": "统一管理所有Web服务项目",
|
||||
"admin_url": "http://localhost:19013",
|
||||
"git_repo": "http://192.168.2.8:12007/coder/project-panel",
|
||||
"version": "v1.0.1"
|
||||
},
|
||||
"admin_url": "http://localhost:16022",
|
||||
"git_repo": "http://121.40.164.32:12007/hz4th_coder/project-panel",
|
||||
"version": "v2.0.0"
|
||||
}
|
||||
],
|
||||
"external_services": [
|
||||
{
|
||||
"id": "web-context-extension",
|
||||
"name": "网页助手插件",
|
||||
"type": "extension",
|
||||
"directory": "works/web-context-extension",
|
||||
"description": "浏览器扩展,右键菜单支持收藏网页、AI总结",
|
||||
"git_repo": "http://192.168.2.8:12007/coder/web-context-extension",
|
||||
"version": "v0.1.0"
|
||||
},
|
||||
{
|
||||
"id": "service-monitor",
|
||||
"name": "Web服务监控",
|
||||
"type": "cron",
|
||||
"directory": "works/service-monitor",
|
||||
"cron": "*/20 * * * *",
|
||||
"cron_cmd": "/usr/bin/python3 /home/xian/.openclaw/workspace-coder/works/service-monitor/monitor.py",
|
||||
"description": "每20分钟检查服务状态,邮件通知",
|
||||
"git_repo": "http://192.168.2.8:12007/coder/service-monitor",
|
||||
"version": "v1.0.0"
|
||||
},
|
||||
{
|
||||
"id": "board-monitor",
|
||||
"name": "A股板块监控",
|
||||
"type": "cron",
|
||||
"directory": "works/board-monitor",
|
||||
"cron": "0 17 * * 1-5",
|
||||
"cron_cmd": "python3 board_monitor.py report",
|
||||
"description": "每个交易日17:00发送板块分析报告",
|
||||
"git_repo": "http://192.168.2.8:12007/coder/board-monitor",
|
||||
"version": "v1.3.0"
|
||||
},
|
||||
{
|
||||
"id": "stock-system",
|
||||
"name": "A股历史数据系统",
|
||||
"type": "cli",
|
||||
"directory": "/home/xian/.openclaw/common/stock_system",
|
||||
"run_cmd": "python3 fetch_history_v2.py",
|
||||
"description": "获取A股历史行情数据,支持断点续传",
|
||||
"git_repo": "http://192.168.2.8:12007/coder/stock_system",
|
||||
"version": "v0.2.0"
|
||||
},
|
||||
{
|
||||
"id": "pdf-translator",
|
||||
"name": "PDF翻译脚本",
|
||||
"type": "cli",
|
||||
"directory": "works/pdf-translator",
|
||||
"run_cmd": "python3 translate_pdf.py",
|
||||
"description": "命令行PDF翻译工具",
|
||||
"git_repo": null,
|
||||
"version": "v1.0.0"
|
||||
},
|
||||
{
|
||||
"id": "xian-favor",
|
||||
"name": "Xian Favor 收藏系统",
|
||||
"type": "web",
|
||||
"ports": [19014],
|
||||
"directory": "works/xian-favor",
|
||||
"start_cmd": "mkdir -p logs && nohup python3 -c \"from xian_favor.api import start_server; start_server(port=19014)\" > logs/app.log 2>&1 & disown",
|
||||
"health_url": "http://localhost:19014/api/items?limit=1",
|
||||
"description": "文本笔记、链接收藏、待办事项管理系统",
|
||||
"admin_url": "http://localhost:19014",
|
||||
"git_repo": "http://192.168.2.8:12007/coder/xian-favor",
|
||||
"version": "v3.5.0"
|
||||
},
|
||||
{
|
||||
"id": "multi-agent-bidding",
|
||||
"name": "多智能体竞标调度系统",
|
||||
"type": "web",
|
||||
"ports": [19015],
|
||||
"directory": "works/multi-agent-bidding",
|
||||
"start_cmd": "mkdir -p logs && nohup python3 -m app.app --port 19015 > logs/app.log 2>&1 & disown",
|
||||
"health_url": "http://localhost:19015/api/agents",
|
||||
"description": "基于竞标机制的多智能体任务调度系统",
|
||||
"admin_url": "http://localhost:19015",
|
||||
"git_repo": "http://192.168.2.8:12007/coder/multi-agent-bidding",
|
||||
"version": "v1.0.0"
|
||||
},
|
||||
{
|
||||
"id": "tech-forum",
|
||||
"name": "技术论坛",
|
||||
"type": "web",
|
||||
"ports": [19004],
|
||||
"directory": "/home/xian/.openclaw/common/projects/tech-forum",
|
||||
"start_cmd": "mkdir -p logs && nohup python3 backend/app.py > logs/app.log 2>&1 & disown",
|
||||
"health_url": "http://localhost:19004/api/health",
|
||||
"description": "技术交流、工具分享、问答讨论社区",
|
||||
"admin_url": "http://localhost:19004/admin",
|
||||
"git_repo": "http://192.168.2.8:12007/coder/tech-forum",
|
||||
"version": "v1.2.0"
|
||||
},
|
||||
{
|
||||
"id": "image-editor",
|
||||
"name": "图片编辑器",
|
||||
"type": "web",
|
||||
"ports": [19018],
|
||||
"directory": "works/image-editor",
|
||||
"start_cmd": "mkdir -p logs && nohup python3 app.py > logs/app.log 2>&1 & disown",
|
||||
"health_url": "http://localhost:19018/api/health",
|
||||
"description": "前端图片处理:合并、分割、挖孔、圆形切图、文字图片",
|
||||
"git_repo": "http://192.168.2.8:12007/coder/image-editor",
|
||||
"version": "v1.2.1"
|
||||
},
|
||||
{
|
||||
"id": "voice-chat-web",
|
||||
"name": "语音对话网页",
|
||||
"type": "web",
|
||||
"ports": [19019],
|
||||
"directory": "works/voice-chat-web",
|
||||
"start_cmd": "mkdir -p logs && MODEL_SERVICE_URL=http://192.168.2.5:12001 nohup python3 main.py > logs/server.log 2>&1 & disown",
|
||||
"health_url": "http://localhost:19019/api/status",
|
||||
"description": "基于Qwen2-Audio的语音交互网页,支持录音和文字对话",
|
||||
"git_repo": "http://192.168.2.8:12007/coder/voice-chat-web",
|
||||
"version": "v1.2.0"
|
||||
"id": "meilisearch",
|
||||
"name": "Meilisearch 搜索引擎",
|
||||
"type": "external",
|
||||
"ports": [16001],
|
||||
"health_url": "http://localhost:16001/health",
|
||||
"description": "高性能搜索引擎,只读监控"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user