修改说明
This commit is contained in:
Binary file not shown.
@@ -58,6 +58,21 @@ def get_alerts():
|
||||
except Exception as e:
|
||||
return jsonify({"error": str(e)}), 500
|
||||
|
||||
@app.route('/api/alerts', methods=['POST'])
|
||||
def create_alert():
|
||||
"""创建预警"""
|
||||
try:
|
||||
data = request.get_json()
|
||||
alert = assistant.create_alert(
|
||||
alert_type=data.get('alert_type', 'manual'),
|
||||
title=data.get('title', '手动预警'),
|
||||
description=data.get('description', ''),
|
||||
level=data.get('level', 'medium')
|
||||
)
|
||||
return jsonify({"success": True, "alert": alert})
|
||||
except Exception as e:
|
||||
return jsonify({"error": str(e)}), 500
|
||||
|
||||
@app.route('/api/alerts/statistics')
|
||||
def get_alert_statistics():
|
||||
"""获取预警统计"""
|
||||
|
||||
@@ -101,7 +101,7 @@ class AlertManager {
|
||||
|
||||
updateHealthDisplay() {
|
||||
const healthScore = this.health.health_score || 0;
|
||||
const healthStatus = this.health.health_status || 'unknown';
|
||||
const healthStatus = this.health.status || 'unknown';
|
||||
|
||||
const scoreElement = document.getElementById('health-score-text');
|
||||
const circleElement = document.getElementById('health-score-circle');
|
||||
|
||||
@@ -217,7 +217,7 @@ class TSPDashboard {
|
||||
|
||||
updateHealthDisplay(health) {
|
||||
const healthScore = health.health_score || 0;
|
||||
const healthStatus = health.health_status || 'unknown';
|
||||
const healthStatus = health.status || 'unknown';
|
||||
|
||||
// 更新健康指示器
|
||||
const healthDot = document.getElementById('health-dot');
|
||||
@@ -312,6 +312,8 @@ class TSPDashboard {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
initCharts() {
|
||||
// 性能趋势图
|
||||
const performanceCtx = document.getElementById('performanceChart');
|
||||
|
||||
Reference in New Issue
Block a user