diff --git a/routes/tscm.py b/routes/tscm.py index 6493cad..aad21dc 100644 --- a/routes/tscm.py +++ b/routes/tscm.py @@ -3165,12 +3165,18 @@ def list_playbooks(): try: from utils.tscm.advanced import PLAYBOOKS + # Return as array with id field for JavaScript compatibility + playbooks_list = [] + for pid, pb in PLAYBOOKS.items(): + pb_dict = pb.to_dict() + pb_dict['id'] = pid + pb_dict['name'] = pb_dict.get('title', pid) + pb_dict['category'] = pb_dict.get('risk_level', 'general') + playbooks_list.append(pb_dict) + return jsonify({ 'status': 'success', - 'playbooks': { - pid: pb.to_dict() - for pid, pb in PLAYBOOKS.items() - } + 'playbooks': playbooks_list }) except Exception as e: diff --git a/templates/index.html b/templates/index.html index 947946f..f137f6b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -9402,14 +9402,14 @@ ${playbooks.map(p => `
${escapeHtml(p.description || '')}
@@ -9442,21 +9442,32 @@${escapeHtml(step.description || '')}
- ${step.warning ? `${escapeHtml(step.details || step.description || '')}
+ ${step.safety_note ? `${escapeHtml(p.when_to_escalate)}
+