{% extends "base.html" %}

{% block title %}설정 파일 비교 - Dell Server Info{% endblock %}

{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/scp.css') }}">
{% endblock %}

{% block content %}
<div class="container mt-4">
    <div class="d-flex justify-content-between align-items-center mb-3">
        <h2>설정 파일 비교</h2>
        <a href="{{ url_for('xml.xml_management') }}" class="btn btn-secondary">
            <i class="fas fa-arrow-left me-1"></i> 목록으로
        </a>
    </div>

    <div class="card mb-4">
        <div class="card-header bg-info text-white">
            <i class="fas fa-exchange-alt me-2"></i>비교 대상
        </div>
        <div class="card-body">
            <div class="row text-center">
                <div class="col-md-5">
                    <h5>{{ file1 }}</h5>
                </div>
                <div class="col-md-2">
                    <i class="fas fa-arrow-right text-muted"></i>
                </div>
                <div class="col-md-5">
                    <h5>{{ file2 }}</h5>
                </div>
            </div>
        </div>
    </div>

    <div class="card">
        <div class="card-header">
            <i class="fas fa-code me-2"></i>Diff 결과
        </div>
        <div class="card-body p-0">
            <div class="diff-container">
                {% for line in diff_content.splitlines() %}
                {% if line.startswith('+++') or line.startswith('---') %}
                <span class="diff-line diff-header">{{ line }}</span>
                {% elif line.startswith('+') %}
                <span class="diff-line diff-add">{{ line }}</span>
                {% elif line.startswith('-') %}
                <span class="diff-line diff-del">{{ line }}</span>
                {% else %}
                <span class="diff-line">{{ line }}</span>
                {% endif %}
                {% endfor %}
            </div>
        </div>
    </div>
</div>
{% endblock %}