{% extends "service_manage/base.html" %}

{% block title %}服务信息{% endblock %}
{% block breadcrumb %}服务信息{% endblock %}

{% block extra_css %}
<style>
    .filter-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
    .filter-label { font-size: 14px; font-weight: 600; color: var(--gray-700); }
    .filter-select { padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: 8px; font-size: 14px; color: var(--gray-900); background: #fff; min-width: 160px; cursor: pointer; }
    .filter-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
    .info-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
    .info-card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid var(--gray-200); }
    .info-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
    .info-card-title { font-size: 16px; font-weight: 700; color: var(--gray-900); display: flex; align-items: center; gap: 8px; }
    .info-card-value { font-size: 36px; font-weight: 700; margin-bottom: 8px; }
    .info-card-unit { font-size: 14px; font-weight: 400; color: var(--gray-500); }
    .progress-bar { width: 100%; height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; margin-top: 8px; }
    .progress-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
    .progress-green { background: var(--green); }
    .progress-yellow { background: var(--yellow); }
    .progress-red { background: var(--red); }
    .info-card-detail { font-size: 13px; color: var(--gray-500); margin-top: 8px; }
    .status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }
    .badge-normal { background: var(--green-light); color: var(--green); }
    .badge-warning { background: var(--yellow-light); color: var(--yellow); }
    .badge-danger { background: var(--red-light); color: var(--red); }
    @media screen and (max-width: 768px) { .info-cards { grid-template-columns: 1fr; } }
</style>
{% endblock %}
{% block content %}
<div class="section-head"><h2 class="section-title">ℹ️ 服务信息</h2></div>

<div class="filter-bar">
    <label class="filter-label">监控类型：</label>
    <select class="filter-select" onchange="handleFilter(this.value)">
        <option value="system">系统</option>
        <option value="docker">Docker容器</option>
        <option value="nginx">Nginx</option>
        <option value="mysql">MySQL</option>
        <option value="redis">Redis</option>
    </select>
</div>

<div class="info-cards">
    <div class="info-card">
        <div class="info-card-header">
            <div class="info-card-title">🖥️ CPU 使用率</div>
            <span class="status-badge badge-normal">正常</span>
        </div>
        <div class="info-card-value" style="color: var(--green);">32.5<span class="info-card-unit">%</span></div>
        <div class="progress-bar"><div class="progress-fill progress-green" style="width: 32.5%;"></div></div>
        <div class="info-card-detail">核心数: 8 | 负载: 2.1, 1.8, 1.6</div>
    </div>

    <div class="info-card">
        <div class="info-card-header">
            <div class="info-card-title">💾 内存使用率</div>
            <span class="status-badge badge-warning">注意</span>
        </div>
        <div class="info-card-value" style="color: var(--yellow);">68.3<span class="info-card-unit">%</span></div>
        <div class="progress-bar"><div class="progress-fill progress-yellow" style="width: 68.3%;"></div></div>
        <div class="info-card-detail">已用: 10.9 GB / 总计: 16 GB</div>
    </div>

    <div class="info-card">
        <div class="info-card-header">
            <div class="info-card-title">💿 硬盘使用率</div>
            <span class="status-badge badge-normal">正常</span>
        </div>
        <div class="info-card-value" style="color: var(--green);">45.2<span class="info-card-unit">%</span></div>
        <div class="progress-bar"><div class="progress-fill progress-green" style="width: 45.2%;"></div></div>
        <div class="info-card-detail">已用: 90.4 GB / 总计: 200 GB</div>
    </div>
</div>
{% endblock %}
{% block extra_js %}
<script>
function handleFilter(type) {
    alert("筛选功能开发中，敬请期待 - 类型: " + type);
}
</script>
{% endblock %}