Files
vps_web/templates/admin/import_preview.html
ddrwode 3a61598b59 哈哈
2026-02-09 14:18:42 +08:00

74 lines
3.2 KiB
HTML

<!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">以下为与现有数据不重复的配置,勾选需要写入的项后点击「确认导入」即可正式入库并展示。</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>vCPU</th>
<th>内存</th>
<th>存储</th>
<th>流量</th>
<th>月付¥</th>
<th>月付$</th>
<th>配置官网</th>
</tr>
</thead>
<tbody>
{% for idx, row in rows %}
<tr>
<td><input type="checkbox" name="row_index" value="{{ idx }}" checked></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>{{ (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>