Files
vps_web/templates/admin/import_preview.html
ddrwode 5fe60fdd57 哈哈
2026-02-09 22:36:32 +08:00

90 lines
4.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>确认导入 - 后台</title>
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="/static/css/admin.css">
</head>
<body class="admin-page">
<header class="admin-header">
<h1>确认导入</h1>
<nav>
<a href="{{ url_for('admin_import') }}">重新上传</a>
<a href="{{ url_for('admin_dashboard') }}">返回总览</a>
<a href="{{ url_for('admin_logout') }}">退出</a>
</nav>
</header>
<main class="admin-main">
<p class="hint">本次解析结果:新增 {{ add_count or 0 }} 条,可更新 {{ update_count or 0 }} 条。勾选后点击「确认导入」执行写入。</p>
{% if error %}
<p class="error">{{ error }}</p>
{% endif %}
{% if not rows %}
<p>没有待处理数据(可能全部已存在且无变化)。<a href="{{ url_for('admin_import') }}">重新上传</a></p>
{% else %}
<form method="post" action="{{ url_for('admin_import_preview') }}">
<table class="admin-table">
<thead>
<tr>
<th><input type="checkbox" id="check-all" checked></th>
<th>动作</th>
<th>厂商</th>
<th>国家</th>
<th>vCPU</th>
<th>内存</th>
<th>存储</th>
<th>流量</th>
<th>月付¥</th>
<th>月付$</th>
<th>变更</th>
<th>配置官网</th>
</tr>
</thead>
<tbody>
{% for idx, item in rows %}
{% set row = item.get('row', {}) %}
<tr>
<td><input type="checkbox" name="row_index" value="{{ idx }}" checked></td>
<td>{% if item.get('action') == 'update' %}更新 #{{ item.get('plan_id') }}{% else %}新增{% endif %}</td>
<td>{{ row.get('厂商') or '—' }}</td>
<td>{{ row.get('国家') or '—' }}</td>
<td>{{ row.get('vCPU') or '—' }}</td>
<td>{{ row.get('内存GB') or '—' }}</td>
<td>{{ row.get('存储GB') or '—' }}</td>
<td>{{ row.get('流量') or '—' }}</td>
<td>{{ row.get('月付人民币') or '—' }}</td>
<td>{{ row.get('月付美元') or '—' }}</td>
<td>
{% if item.get('action') == 'add' %}
新配置
{% else %}
{% for c in item.get('changes', []) %}
<div>{{ c.get('label') }}{{ c.get('old_display') }} → {{ c.get('new_display') }}</div>
{% endfor %}
{% if item.get('provider_url_changed') %}
<div>厂商官网:{{ item.get('provider_url_old') or '—' }} → {{ item.get('provider_url_new') or '—' }}</div>
{% endif %}
{% endif %}
</td>
<td>{{ (row.get('配置官网') or '')[:30] }}{% if (row.get('配置官网') or '')|length > 30 %}…{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="form-actions" style="margin-top:1rem;">
<button type="submit">确认导入选中项</button>
<a href="{{ url_for('admin_import') }}" class="btn-cancel">取消</a>
</div>
</form>
<script>
document.getElementById('check-all').addEventListener('change', function() {
document.querySelectorAll('input[name="row_index"]').forEach(function(cb) { cb.checked = this.checked; }.bind(this));
});
</script>
{% endif %}
</main>
</body>
</html>