Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0085c70266 | |||
| 5f9439c8a9 | |||
| 0d0354ac4e | |||
| 47a38032a6 | |||
| b59931f357 | |||
| 1420b08a43 | |||
| cd5bdb5938 | |||
| 69ade8dcbb | |||
| 7926a5b51f | |||
| 26e0ed26e1 |
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
|
||||
}
|
||||
}
|
||||
559
app.py
559
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,20 +695,20 @@ 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()
|
||||
|
||||
if not existing:
|
||||
# 尝试从命令推断分类和名称
|
||||
name = guess_cron_name(cron['command'])
|
||||
category = guess_cron_category(cron['command'])
|
||||
@@ -699,9 +720,9 @@ def api_cron_sync():
|
||||
|
||||
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,
|
||||
@@ -799,6 +825,58 @@ def api_system_stats():
|
||||
return jsonify({'error': str(e), 'available': False})
|
||||
|
||||
|
||||
@app.route('/api/system/processes')
|
||||
def api_system_processes():
|
||||
"""获取CPU占用最高的进程列表"""
|
||||
if not HAS_PSUTIL:
|
||||
return jsonify({'error': 'psutil未安装', 'available': False})
|
||||
|
||||
try:
|
||||
limit = int(request.args.get('limit', 10))
|
||||
limit = max(1, min(50, limit)) # 限制1-50
|
||||
|
||||
processes = []
|
||||
for proc in psutil.process_iter(['pid', 'name', 'memory_percent', 'status', 'create_time', 'exe', 'cmdline']):
|
||||
try:
|
||||
pinfo = proc.info
|
||||
# 获取实时CPU占用(需要单独调用)
|
||||
cpu_percent = proc.cpu_percent(interval=0.1)
|
||||
|
||||
# 格式化命令行
|
||||
cmdline = pinfo.get('cmdline', [])
|
||||
cmdline_str = ' '.join(cmdline) if cmdline else pinfo['name']
|
||||
if len(cmdline_str) > 60:
|
||||
cmdline_str = cmdline_str[:60] + '...'
|
||||
|
||||
# 启动时间
|
||||
create_time = datetime.fromtimestamp(pinfo['create_time']).strftime('%m-%d %H:%M')
|
||||
|
||||
processes.append({
|
||||
'pid': pinfo['pid'],
|
||||
'name': pinfo['name'],
|
||||
'cpu': cpu_percent,
|
||||
'memory': pinfo['memory_percent'] or 0,
|
||||
'status': pinfo['status'],
|
||||
'create_time': create_time,
|
||||
'exe': pinfo.get('exe', '') or '',
|
||||
'cmdline': cmdline_str
|
||||
})
|
||||
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
||||
continue
|
||||
|
||||
# 按CPU占用排序,取前N个
|
||||
processes.sort(key=lambda x: x['cpu'], reverse=True)
|
||||
top_processes = processes[:limit]
|
||||
|
||||
return jsonify({
|
||||
'available': True,
|
||||
'processes': top_processes,
|
||||
'count': len(top_processes)
|
||||
})
|
||||
except Exception as e:
|
||||
return jsonify({'error': str(e), 'available': False})
|
||||
|
||||
|
||||
def guess_cron_name(command):
|
||||
"""从命令推断任务名称"""
|
||||
keywords = {
|
||||
@@ -851,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'])
|
||||
@@ -1103,7 +1356,7 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>项目服务管理面板 v3.2</title>
|
||||
<title>项目服务管理面板 v3.3.1</title>
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>📊</text></svg>">
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
|
||||
@@ -1183,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()">
|
||||
@@ -1325,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">
|
||||
@@ -1394,7 +1660,7 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
||||
</div>
|
||||
<div class="threshold-item">
|
||||
<div class="threshold-label">
|
||||
<i class="ri-memory-card-line threshold-icon text-green-400"></i>
|
||||
<i class="ri-database-2-line threshold-icon text-green-400"></i>
|
||||
<span class="text-gray-300 text-sm">内存使用率</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
@@ -1464,6 +1730,32 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
||||
</select>
|
||||
<span id="realtimeIndicator" class="text-xs text-green-400 ml-1 hidden">●</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 ml-4">
|
||||
<input type="checkbox" id="showProcessListCheck" class="w-4 h-4 cursor-pointer" onchange="toggleProcessList()">
|
||||
<label for="showProcessListCheck" class="text-gray-300 text-xs cursor-pointer">显示进程列表</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 进程列表(实时监控时显示) -->
|
||||
<div id="processListSection" class="hidden mt-6">
|
||||
<div class="flex items-center justify-between mb-3">
|
||||
<h3 class="font-bold text-gray-200 flex items-center gap-2">
|
||||
<i class="ri-bar-chart-horizontal text-purple-400"></i> CPU占用最高的进程
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-gray-400 text-xs">显示数量:</span>
|
||||
<select id="processLimitSelect" class="bg-gray-700 text-gray-200 px-2 py-1 rounded text-xs" onchange="loadTopProcesses()">
|
||||
<option value="5">5</option>
|
||||
<option value="10" selected>10</option>
|
||||
<option value="15">15</option>
|
||||
<option value="20">20</option>
|
||||
<option value="30">30</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id="processList" class="space-y-2">
|
||||
<div class="text-gray-500 text-center py-4"><i class="ri-loader-4-line animate-spin"></i> 加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1834,8 +2126,10 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
||||
clearInterval(realtimeTimer);
|
||||
realtimeTimer = null;
|
||||
document.getElementById('realtimeCheck').checked = false;
|
||||
document.getElementById('showProcessListCheck').checked = false;
|
||||
document.getElementById('realtimeToggle').classList.remove('active');
|
||||
document.getElementById('realtimeIndicator').classList.add('hidden');
|
||||
document.getElementById('processListSection').classList.add('hidden');
|
||||
}
|
||||
|
||||
if (tab === 'cron') {
|
||||
@@ -1850,24 +2144,50 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
||||
}
|
||||
|
||||
// 加载阈值设置
|
||||
function loadThresholds() {
|
||||
const saved = localStorage.getItem('systemThresholds');
|
||||
if (saved) {
|
||||
thresholds = JSON.parse(saved);
|
||||
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)
|
||||
@@ -2034,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) + '%';
|
||||
@@ -2059,11 +2386,63 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
||||
// 检查阈值
|
||||
checkThresholds(data);
|
||||
|
||||
// 如果实时监控和进程列表都开启,加载进程列表
|
||||
if (document.getElementById('realtimeCheck').checked && document.getElementById('showProcessListCheck').checked) {
|
||||
loadTopProcesses();
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.error('系统资源加载失败:', e);
|
||||
}
|
||||
}
|
||||
|
||||
// 加载CPU占用最高的进程
|
||||
async function loadTopProcesses() {
|
||||
try {
|
||||
const limit = document.getElementById('processLimitSelect').value;
|
||||
const res = await fetch(`/api/system/processes?limit=${limit}`);
|
||||
const data = await res.json();
|
||||
|
||||
if (!data.available) {
|
||||
document.getElementById('processList').innerHTML = '<div class="text-red-400 text-center py-4">无法获取进程信息</div>';
|
||||
return;
|
||||
}
|
||||
|
||||
const list = document.getElementById('processList');
|
||||
if (data.processes.length === 0) {
|
||||
list.innerHTML = '<div class="text-gray-500 text-center py-4">暂无进程数据</div>';
|
||||
return;
|
||||
}
|
||||
|
||||
list.innerHTML = data.processes.map(proc => `
|
||||
<div class="card rounded-lg p-3 hover:border-gray-500 transition-colors">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center gap-3 min-w-0">
|
||||
<span class="text-purple-400 font-mono text-sm">${proc.pid}</span>
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="text-gray-200 truncate">${proc.name}</div>
|
||||
<div class="text-gray-500 text-xs truncate">${proc.cmdline || proc.exe}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-4 text-xs shrink-0">
|
||||
<div class="text-right">
|
||||
<span class="text-blue-400 font-bold">${proc.cpu.toFixed(1)}%</span>
|
||||
<span class="text-gray-500 ml-1">CPU</span>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<span class="text-green-400 font-bold">${proc.memory.toFixed(1)}%</span>
|
||||
<span class="text-gray-500 ml-1">内存</span>
|
||||
</div>
|
||||
<div class="text-gray-400">${proc.create_time}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`).join('');
|
||||
} catch (e) {
|
||||
console.error('进程列表加载失败:', e);
|
||||
}
|
||||
}
|
||||
|
||||
function toggleRealtime() {
|
||||
const checked = document.getElementById('realtimeCheck').checked;
|
||||
const toggle = document.getElementById('realtimeToggle');
|
||||
@@ -2076,9 +2455,15 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
||||
loadSystemStats();
|
||||
// 启动定时器
|
||||
realtimeTimer = setInterval(loadSystemStats, realtimeInterval * 1000);
|
||||
// 如果进程列表开关也开启,则显示并加载
|
||||
if (document.getElementById('showProcessListCheck').checked) {
|
||||
document.getElementById('processListSection').classList.remove('hidden');
|
||||
loadTopProcesses();
|
||||
}
|
||||
} else {
|
||||
toggle.classList.remove('active');
|
||||
indicator.classList.add('hidden');
|
||||
document.getElementById('processListSection').classList.add('hidden');
|
||||
// 停止定时器
|
||||
if (realtimeTimer) {
|
||||
clearInterval(realtimeTimer);
|
||||
@@ -2087,10 +2472,33 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
||||
}
|
||||
}
|
||||
|
||||
function toggleProcessList() {
|
||||
const checked = document.getElementById('showProcessListCheck').checked;
|
||||
const realtimeChecked = document.getElementById('realtimeCheck').checked;
|
||||
const processSection = document.getElementById('processListSection');
|
||||
|
||||
if (checked && realtimeChecked) {
|
||||
processSection.classList.remove('hidden');
|
||||
loadTopProcesses();
|
||||
} else {
|
||||
processSection.classList.add('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
||||
@@ -2426,17 +2834,16 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
|
||||
}
|
||||
|
||||
const resourceNames = { 'cpu': 'CPU', 'memory': '内存', 'disk': '磁盘' };
|
||||
const triggerNames = {
|
||||
'single': '一次性',
|
||||
'continuous': `连续${rule.triggerParam}次`,
|
||||
'duration': `持续${rule.triggerParam}秒`,
|
||||
'average': `平均${rule.triggerParam}次`
|
||||
};
|
||||
|
||||
list.innerHTML = rules.map(rule => {
|
||||
const silentInfo = rule.silentEnabled ? `静默:${rule.silentStart}-${rule.silentEnd}` : '';
|
||||
const triggerType = rule.triggerType || 'single';
|
||||
const triggerDisplay = triggerNames[triggerType] || triggerNames['single'];
|
||||
const triggerParam = rule.triggerParam || 3;
|
||||
let triggerDisplay = '一次性';
|
||||
if (triggerType === 'continuous') triggerDisplay = `连续${triggerParam}次`;
|
||||
else if (triggerType === 'duration') triggerDisplay = `持续${triggerParam}秒`;
|
||||
else if (triggerType === 'average') triggerDisplay = `平均${triggerParam}次`;
|
||||
|
||||
return `
|
||||
<div class="flex items-center justify-between bg-gray-700/50 px-3 py-2 rounded-lg">
|
||||
<div class="flex items-center gap-3 flex-wrap">
|
||||
@@ -3171,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' }); }
|
||||
|
||||
@@ -3193,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);
|
||||
}
|
||||
@@ -3222,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.
30315
logs/app.log
30315
logs/app.log
File diff suppressed because it is too large
Load Diff
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